[yum-cvs] yum/yum repos.py,1.91,1.92 yumRepo.py,1.4,1.5

Paul Nasrat pnasrat at linux.duke.edu
Wed May 24 18:41:39 UTC 2006


Update of /home/groups/yum/cvs/yum/yum
In directory login1.linux.duke.edu:/tmp/cvs-serv7181/yum

Modified Files:
	repos.py yumRepo.py 
Log Message:
Enable failure_callbacks on mirror objects

Index: repos.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/repos.py,v
retrieving revision 1.91
retrieving revision 1.92
diff -u -r1.91 -r1.92
--- repos.py	11 Apr 2006 21:34:10 -0000	1.91
+++ repos.py	24 May 2006 18:41:37 -0000	1.92
@@ -154,17 +154,23 @@
             repo.basecachedir = cachedir
 
     def setProgressBar(self, obj):
-        """set's the progress bar for downloading files from repos"""
+        """sets the progress bar for downloading files from repos"""
         
         for repo in self.repos.values():
             repo.setCallback(obj)
 
     def setFailureCallback(self, obj):
-        """set's the failure callback for all repos"""
+        """sets the failure callback for all repos"""
         
         for repo in self.repos.values():
             repo.setFailureObj(obj)
 
+    def setMirrorFailureCallback(self, obj):
+        """sets the failure callback for all mirrors"""
+        
+        for repo in self.repos.values():
+            repo.setMirrorFailureObj(obj)
+
     def getPackageSack(self):
         return self.pkgSack
 
@@ -279,6 +285,9 @@
     def setFailureObj(self, obj):
         raise NotImplementedError()
 
+    def setMirrorFailureObj(self, obj):
+        raise NotImplementedError()
+
     def getPackage(self, package, checkfunc = None, text = None, cache = True):
         raise NotImplementedError()
 

Index: yumRepo.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/yumRepo.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- yumRepo.py	19 Apr 2006 22:10:37 -0000	1.4
+++ yumRepo.py	24 May 2006 18:41:37 -0000	1.5
@@ -140,8 +140,6 @@
         self.repoMDFile = 'repodata/repomd.xml'
         self.repoXML = None
         self.cache = 0
-        self.callback = None # callback for the grabber
-        self.failure_obj = None
         self.mirrorlist = None # filename/url of mirrorlist file
         self.mirrorlistparsed = 0
         self.baseurl = [] # baseurls from the config file 
@@ -165,6 +163,7 @@
         # callbacks
         self.callback = None  # for the grabber
         self.failure_obj = None
+        self.mirror_failure_obj = None
 
         # Check to see if we can import sqlite stuff
         try:
@@ -334,7 +333,8 @@
                                    timeout=self.timeout,
                                    reget='simple')
 
-        self.grab = mgclass(self.grabfunc, self.urls)
+        self.grab = mgclass(self.grabfunc, self.urls,
+                            failure_callback=self.mirror_failure_obj)
 
     def dirSetup(self):
         """make the necessary dirs, if possible, raise on failure"""
@@ -694,6 +694,9 @@
     def setFailureObj(self, failure_obj):
         self.failure_obj = failure_obj
 
+    def setMirrorFailureObj(self, failure_obj):
+        self.mirror_failure_obj = failure_obj
+
 
 
 def getMirrorList(mirrorlist, pdict = None):




More information about the Yum-cvs-commits mailing list