def __init__(self): try: context = ssl._create_unverified_context() except AttributeError: context = None FancyURLopener.__init__(self, context=context)
def __init__(self, *args): FancyURLopener.__init__(self, *args) for i, (header, val) in enumerate(self.addheaders): if header == "User-Agent": del self.addheaders[i] break self.addheader('User-Agent', 'OSMViz/1.0 +http://cbick.github.com/osmviz')
def __init__(self, *args, **kwargs): FancyURLopener.__init__(self, *args, **kwargs) # Headers to add to every request. # XXX: IMDb's web server doesn't like urllib-based programs, # so lets fake to be Mozilla. # Wow! I'm shocked by my total lack of ethic! <g> self.set_header('User-agent', 'Mozilla/5.0') # XXX: This class is used also to perform "Exact Primary # [Title|Name]" searches, and so by default the cookie is set. c_header = 'id=%s; uu=%s' % (_cookie_id, _cookie_uu) self.set_header('Cookie', c_header)
def __init__(self, *args, **kwargs): self._last_url = u'' FancyURLopener.__init__(self, *args, **kwargs) # Headers to add to every request. # XXX: IMDb's web server doesn't like urllib-based programs, # so lets fake to be Mozilla. # Wow! I'm shocked by my total lack of ethic! <g> self.set_header('User-agent', 'Mozilla/5.0') # XXX: This class is used also to perform "Exact Primary # [Title|Name]" searches, and so by default the cookie is set. c_header = 'id=%s; uu=%s' % (_cookie_id, _cookie_uu) self.set_header('Cookie', c_header)
def __init__(self, ftpproxy=''): """RebaseUpdate([ftpproxy]]) -> new RebaseUpdate instance. if ftpproxy is not given RebaseUpdate uses the corresponding variable from RanaConfig. ftpproxy is the proxy to use if any. """ proxy = {'ftp': ftpproxy or ftp_proxy} if not Rebase_name: raise FtpNameError('Rebase') if not proxy['ftp']: proxy = {} FancyURLopener.__init__(self, proxy)
def __init__(self, *args, **kwargs): self._last_url = u'' FancyURLopener.__init__(self, *args, **kwargs) # Headers to add to every request. # XXX: IMDb's web server doesn't like urllib-based programs, # so lets fake to be Mozilla. # Wow! I'm shocked by my total lack of ethic! <g> for header in ('User-Agent', 'User-agent', 'user-agent'): self.del_header(header) self.set_header('User-Agent', 'Mozilla/5.0') self.set_header('Accept-Language', 'en-us,en;q=0.5') # XXX: This class is used also to perform "Exact Primary # [Title|Name]" searches, and so by default the cookie is set. c_header = 'uu=%s; id=%s' % (_cookie_uu, _cookie_id) self.set_header('Cookie', c_header)
def __init__(self, *args, **kwargs): self._last_url = u"" FancyURLopener.__init__(self, *args, **kwargs) # Headers to add to every request. # XXX: IMDb's web server doesn't like urllib-based programs, # so lets fake to be Mozilla. # Wow! I'm shocked by my total lack of ethic! <g> for header in ("User-Agent", "User-agent", "user-agent"): self.del_header(header) self.set_header("User-Agent", "Mozilla/5.0") self.set_header("Accept-Language", "en-us,en;q=0.5") # XXX: This class is used also to perform "Exact Primary # [Title|Name]" searches, and so by default the cookie is set. c_header = "uu=%s; id=%s" % (_cookie_uu, _cookie_id) self.set_header("Cookie", c_header)
def __init__(self, e_mail="", ftpproxy=""): """RebaseUpdate([e_mail[, ftpproxy]]) -> new RebaseUpdate instance. if e_mail and ftpproxy are not given RebaseUpdate uses the corresponding variable from RanaConfig. e_mail is the password for the anonymous ftp connection to Rebase. ftpproxy is the proxy to use if any.""" proxy = {"ftp": ftpproxy or ftp_proxy} global Rebase_password Rebase_password = e_mail or Rebase_password if not Rebase_password: raise FtpPasswordError("Rebase") if not Rebase_name: raise FtpNameError("Rebase") FancyURLopener.__init__(self, proxy)
def __init__(self, e_mail='', ftpproxy=''): """RebaseUpdate([e_mail[, ftpproxy]]) -> new RebaseUpdate instance. if e_mail and ftpproxy are not given RebaseUpdate uses the corresponding variable from RanaConfig. e_mail is the password for the anonymous ftp connection to Rebase. ftpproxy is the proxy to use if any.""" proxy = {'ftp': ftpproxy or ftp_proxy} global Rebase_password Rebase_password = e_mail or Rebase_password if not Rebase_password: raise FtpPasswordError('Rebase') if not Rebase_name: raise FtpNameError('Rebase') FancyURLopener.__init__(self, proxy)
def __init__(self, *args, **kwargs): try: self.username = kwargs['username'] except KeyError: self.username = None try: self.password = kwargs['password'] except KeyError: self.password = None # once urllib uses new style classes, or in python 3.0+, use: # super(FancyURLopenerMod, self).__init__(*args, **kwargs) # till then this will work, but not in python 3.0+: FancyURLopener.__init__(self, *args, **kwargs) # only try opening the account once #self.authtries = 0 #self.maxauthtries = 3 self.flag = False
def __init__(self, user, passwd): self._user = user self._passwd = passwd self._promptcalled = False FancyURLopener.__init__(self)
def __init__(self): self.version = 'Audible ADM 6.6.0.19;Windows Vista Service Pack 1 Build 7601' FancyURLopener.__init__(self)
def __init__(self, username=None, passwd=None, *args, **kw): FancyURLopener.__init__(self, *args, **kw) self.username = username self.passwd = passwd
def __init__(self, user_agent): self.version = user_agent FancyURLopener.__init__(self)
def __init__(self, *args): FancyURLopener.__init__(self, *args)
def __init__(self): FancyURLopener.__init__(self)
def __init__(self, username=None, passwd=None, *args, **kw): FancyURLopener.__init__( self, *args, **kw) self.username = username self.passwd = passwd
def __init__(self): FancyURLopener.__init__(self, proxies={})