• Facebook
  • Twitter
  • Reddit
  • StumbleUpon
  • Digg
  • email


src/c/m/cmislib-0.3/src/cmislib/net.py   cmislib(Download)
'''
 
from urllib import urlencode
from urllib2 import HTTPBasicAuthHandler, \
                    HTTPPasswordMgrWithDefaultRealm, \
                    HTTPRedirectHandler, \
                    HTTPDefaultErrorHandler, \
class DefaultErrorHandler(HTTPDefaultErrorHandler):
 
    """ Default error handler """
 
    def http_error_default(self, req, fp, code, msg, headers):
        """Provide an implementation for the default handler"""
        result = HTTPError(

src/u/r/urlimport-0.86c-dev/urlimport/urlimport.py   urlimport(Download)
from base64 import encodestring
from urlparse import urlsplit, urlunsplit
from httplib import HTTPSConnection
from urllib2 import HTTPDefaultErrorHandler, HTTPSHandler, HTTPError, \
    HTTPRedirectHandler, build_opener, urlopen, Request
 
 
class DefaultErrorHandler(HTTPDefaultErrorHandler, HTTPRedirectHandler):
 
    def http_error_301(self, req, fp, code, msg, headers):
        response = \
            HTTPRedirectHandler.http_error_301(self, req, fp, code, msg, headers)
        response.status = code
        return response