Example #1
0
 def opener(self):
     return opener_for_url_prefix(
         self.url_prefix(),
         self.username,
         self.password,
         cache_dict=self.opener_cache_dict,
     )
Example #2
0
def open_locker_uri(uri, opener_cache_dict=None):
    sha1 = uri[9:]
    assert len(sha1) == 40
    context = SynchronizerContext()
    opener = opener_for_url_prefix(
        openretro_url_prefix(), username=context.username,
        password=context.password, cache_dict=opener_cache_dict)
    url = "{0}/api/locker/{1}".format(openretro_url_prefix(), sha1)
    path = Downloader.cache_file_from_url(url, opener=opener)
    return path
Example #3
0
def open_locker_uri(uri, opener_cache_dict=None):
    sha1 = uri[9:]
    assert len(sha1) == 40
    context = SynchronizerContext()
    opener = opener_for_url_prefix(openretro_url_prefix(),
                                   username=context.username,
                                   password=context.password,
                                   cache_dict=opener_cache_dict)
    url = "{0}/api/locker/{1}".format(openretro_url_prefix(), sha1)
    path = Downloader.cache_file_from_url(url, opener=opener)
    return path
Example #4
0
 def opener(self):
     return opener_for_url_prefix(
         self.url_prefix(), self.context.username, self.context.password,
         cache_dict=self.opener_cache_dict)
Example #5
0
 def opener(self):
     username, password = self.get_credentials()
     # FIXME: use cache dict?
     return opener_for_url_prefix(self.url_prefix(), username, password)
Example #6
0
 def opener(self):
     username, password = self.get_credentials()
     # FIXME: use cache dict?
     return opener_for_url_prefix(self.url_prefix(), username, password)