1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-07-24 01:27:50 +02:00

print the list of URL to try, when in HTTP debug mode

This commit is contained in:
Dr. Peter Poeml
2007-09-10 12:22:13 +00:00
parent 40d2ce205e
commit bd9ae2fd05
2 changed files with 10 additions and 2 deletions

View File

@@ -23,7 +23,7 @@ def join_url(self, base_url, rel_url):
class Fetcher:
def __init__(self, cachedir = '/tmp', auth_dict = {}, urllist = []):
def __init__(self, cachedir = '/tmp', auth_dict = {}, urllist = [], http_debug = False):
__version__ = '0.1'
__user_agent__ = 'osbuild/%s' % __version__
@@ -37,6 +37,7 @@ class Fetcher:
self.cachedir = cachedir
self.urllist = urllist
self.http_debug = http_debug
passmgr = urllib2.HTTPPasswordMgrWithDefaultRealm()
for host in auth_dict.keys():
@@ -67,6 +68,12 @@ class Fetcher:
MirrorGroup._join_url = join_url
mg = MirrorGroup(self.gr, pac.urllist)
if self.http_debug:
print
print 'URLs to try for package \'%s\':' % pac
print '\n'.join(pac.urllist)
print
try:
# it returns the filename
ret = mg.urlgrab(pac.filename,