[yum-cvs] yum/yum repos.py,1.59.2.1,1.59.2.2
Seth Vidal
skvidal at login.linux.duke.edu
Sat Feb 19 22:27:44 UTC 2005
Update of /home/groups/yum/cvs/yum/yum
In directory login:/tmp/cvs-serv19599/yum
Modified Files:
Tag: yum-2_2_X
repos.py
Log Message:
merge back proxy fixes and doc updates from HEAD
Index: repos.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/repos.py,v
retrieving revision 1.59.2.1
retrieving revision 1.59.2.2
diff -u -r1.59.2.1 -r1.59.2.2
--- repos.py 7 Feb 2005 06:26:57 -0000 1.59.2.1
+++ repos.py 19 Feb 2005 22:27:42 -0000 1.59.2.2
@@ -322,19 +322,20 @@
raise Errors.RepoError, 'Error opening file for checksum'
def dump(self):
- string = '[%s]\n' % self.id
- for attr in dir(self):
- if attr in ['name', 'bandwidth', 'enabled', 'enablegroups',
- 'gpgcheck', 'includepkgs', 'keepalive', 'proxy'
- 'proxy_password', 'proxy_username', 'excludes',
- 'retries', 'throttle', 'timeout']:
-
- string = string + '%s = %s\n' % (attr, getattr(self, attr))
- string = string + 'baseurl='
+ output = '[%s]\n' % self.id
+ vars = ['name', 'bandwidth', 'enabled', 'enablegroups',
+ 'gpgcheck', 'includepkgs', 'keepalive', 'proxy',
+ 'proxy_password', 'proxy_username', 'excludes',
+ 'retries', 'throttle', 'timeout', 'mirrorlistfn',
+ 'cachedir', 'gpgkey', 'pkgdir', 'hdrdir']
+ vars.sort()
+ for attr in vars:
+ output = output + '%s = %s\n' % (attr, getattr(self, attr))
+ output = output + 'baseurl ='
for url in self.urls:
- string = string + ' %s\n' % url
+ output = output + ' %s\n' % url
- return string
+ return output
def enable(self):
self.baseurlSetup()
@@ -369,17 +370,20 @@
return
self.proxy_dict = {} # zap it
- if self.proxy is not None:
+ proxy_string = None
+ if self.proxy not in [None, '_none_']:
proxy_string = '%s' % self.proxy
if self.proxy_username is not None:
proxy_string = '%s@%s' % (self.proxy_username, self.proxy)
if self.proxy_password is not None:
proxy_string = '%s:%s@%s' % (self.proxy_username,
self.proxy_password, self.proxy)
+
+ if proxy_string is not None:
self.proxy_dict['http'] = proxy_string
self.proxy_dict['https'] = proxy_string
self.proxy_dict['ftp'] = proxy_string
-
+
def setupGrab(self):
"""sets up the grabber functions with the already stocked in urls for
the mirror groups"""
@@ -393,7 +397,7 @@
self.doProxyDict()
prxy = None
if self.proxy_dict:
- pryx = self.proxy_dict
+ prxy = self.proxy_dict
self.grabfunc = URLGrabber(keepalive=self.keepalive,
bandwidth=self.bandwidth,
@@ -480,7 +484,7 @@
self.doProxyDict()
prxy = None
if self.proxy_dict:
- pryx = self.proxy_dict
+ prxy = self.proxy_dict
if url is not None:
ug = URLGrabber(keepalive = self.keepalive,
More information about the Yum-cvs-commits
mailing list