def __init__(self, recipeName, repositoryCache, localDirs=None, multiurlMap=None, refreshFilter=None, mirrorDirs=None, cfg=None): self.cfg = cfg self.recipeName = recipeName self.repCache = repositoryCache if self.repCache: self.repCache.setConfig(cfg) if localDirs is None: localDirs = [] self.localDirs = localDirs self.multiurlMap = multiurlMap self.mirrorDirs = mirrorDirs self.noproxyFilter = util.noproxyFilter()
def _shouldBypass(self, url, proxy): if proxy is None: return False dest = str(url.hostport.host) pdest = str(proxy.hostport.host) # Don't proxy localhost unless the proxy is also localhost. if dest in httputils.LocalHosts and pdest not in httputils.LocalHosts: return True # Ignore no_proxy for Conary proxies. if proxy.scheme in ('conary', 'conarys'): return False # Check no_proxy npFilt = util.noproxyFilter() return npFilt.bypassProxy(dest)