Пример #1
0
	def __init__(self):
		try:
			context = ssl._create_unverified_context()
		except AttributeError:
			context = None

		FancyURLopener.__init__(self, context=context)
Пример #2
0
 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')
Пример #3
0
 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)
Пример #4
0
 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)
Пример #5
0
    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)
Пример #6
0
 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)
Пример #7
0
 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)
Пример #8
0
    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)
Пример #9
0
    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)
Пример #10
0
    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
Пример #11
0
    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
Пример #12
0
 def __init__(self, user, passwd):
     self._user = user
     self._passwd = passwd
     self._promptcalled = False
     FancyURLopener.__init__(self)
Пример #13
0
 def __init__(self):
     self.version = 'Audible ADM 6.6.0.19;Windows Vista Service Pack 1 Build 7601'
     FancyURLopener.__init__(self)
Пример #14
0
 def __init__(self, username=None, passwd=None, *args, **kw):
     FancyURLopener.__init__(self, *args, **kw)
     self.username = username
     self.passwd = passwd
Пример #15
0
 def __init__(self, user_agent):
     self.version = user_agent
     FancyURLopener.__init__(self)
Пример #16
0
 def __init__(self, user_agent):
     self.version = user_agent
     FancyURLopener.__init__(self)
Пример #17
0
 def __init__(self, *args):
   FancyURLopener.__init__(self, *args)
Пример #18
0
 def __init__(self, user, passwd):
     self._user = user
     self._passwd = passwd
     self._promptcalled = False
     FancyURLopener.__init__(self)
Пример #19
0
 def __init__(self):
     FancyURLopener.__init__(self)
Пример #20
0
 def __init__(self, username=None, passwd=None, *args, **kw):
     FancyURLopener.__init__( self, *args, **kw)
     self.username = username
     self.passwd = passwd
Пример #21
0
 def __init__(self):
     FancyURLopener.__init__(self, proxies={})