Ejemplo n.º 1
0
 def __init__(
     self,
     index_url="https://pypi.org/simple/",
     hosts=("*",),
     ca_bundle=None,
     verify_ssl=True,
     *args,
     **kw
 ):
     Environment.__init__(self, *args, **kw)
     self.index_url = index_url + "/"[: not index_url.endswith("/")]
     self.scanned_urls = {}
     self.fetched_urls = {}
     self.package_pages = {}
     self.allows = re.compile("|".join(map(translate, hosts))).match
     self.to_scan = []
     use_ssl = (
         verify_ssl
         and ssl_support.is_available
         and (ca_bundle or ssl_support.find_ca_bundle())
     )
     if use_ssl:
         self.opener = ssl_support.opener_for(ca_bundle)
     else:
         self.opener = urllib.request.urlopen
Ejemplo n.º 2
0
    def __init__(self,
                 index_url="https://pypi.org/simple/",
                 hosts=('*', ),
                 ca_bundle=None,
                 verify_ssl=True,
                 *args,
                 **kw):
        Environment.__init__(self, *args, **kw)
        self.index_url = index_url + "/"[:not index_url.endswith('/')]
        self.scanned_urls = {}
        self.fetched_urls = {}
        self.package_pages = {}
        self.allows = re.compile('|'.join(map(translate, hosts))).match
        self.to_scan = []
        use_ssl = (verify_ssl and ssl_support.is_available
                   and (ca_bundle or ssl_support.find_ca_bundle()))

        # XXX DUO MOD @akgood: DISABLE ALL ATTEMPTS TO DOWNLOAD PACKAGES
        # if use_ssl:
        #     self.opener = ssl_support.opener_for(ca_bundle)
        # else:
        #    self.opener = urllib.request.urlopen
        def opener(request, *args, **kwargs):
            if hasattr(request, 'get_full_url'):
                url = request.get_full_url()
            else:
                url = request

            raise RuntimeError(
                'setuptools package downloads are disabled for authproxy '
                'builds; did you forget a dependency? '
                'offending url: {!r}'.format(url))

        self.opener = opener
 def __init__(
         self, index_url="https://pypi.org/simple/", hosts=('*',),
         ca_bundle=None, verify_ssl=True, *args, **kw
 ):
     Environment.__init__(self, *args, **kw)
     self.index_url = index_url + "/" [:not index_url.endswith('/')]
     self.scanned_urls = {}
     self.fetched_urls = {}
     self.package_pages = {}
     self.allows = re.compile('|'.join(map(translate, hosts))).match
     self.to_scan = []
     self.opener = urllib.request.urlopen
Ejemplo n.º 4
0
 def __init__(
         self, index_url="https://pypi.python.org/simple", hosts=('*',),
         ca_bundle=None, verify_ssl=True, *args, **kw
         ):
     Environment.__init__(self,*args,**kw)
     self.index_url = index_url + "/"[:not index_url.endswith('/')]
     self.scanned_urls = {}
     self.fetched_urls = {}
     self.package_pages = {}
     self.allows = re.compile('|'.join(map(translate,hosts))).match
     self.to_scan = []
     if verify_ssl and ssl_support.is_available and (ca_bundle or ssl_support.find_ca_bundle()):
         self.opener = ssl_support.opener_for(ca_bundle)