[yum-cvs] yum/yum __init__.py,1.234,1.235 packages.py,1.56,1.57

Seth Vidal skvidal at linux.duke.edu
Fri Aug 25 05:13:25 UTC 2006


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

Modified Files:
	__init__.py packages.py 
Log Message:

get rid of packageobject.size() method - replaced with packageobject.size
attribute/property


Index: __init__.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/__init__.py,v
retrieving revision 1.234
retrieving revision 1.235
diff -u -r1.234 -r1.235
--- __init__.py	23 Aug 2006 11:59:56 -0000	1.234
+++ __init__.py	25 Aug 2006 05:13:23 -0000	1.235
@@ -642,7 +642,7 @@
             local = po.localPkg()
             if os.path.exists(local):
                 cursize = os.stat(local)[6]
-                totsize = int(po.size())
+                totsize = int(po.size)
                 try:
                     result = self.verifyPkg(local, po, raiseError=1)
                 except URLGrabError, e: # fails the check

Index: packages.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/packages.py,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -r1.56 -r1.57
--- packages.py	25 Aug 2006 04:51:29 -0000	1.56
+++ packages.py	25 Aug 2006 05:13:23 -0000	1.57
@@ -265,10 +265,12 @@
         
     def returnChangelog(self):
         """return changelog entries"""
+        # fixme - maybe should die - make 'changelog' just a property/attribute
         return self.changelog
         
     def returnFileEntries(self, ftype='file'):
         """return list of files based on type"""
+        # fixme - maybe should die - use direct access to attribute
         if self.files.has_key(ftype):
             return self.files[ftype]
         else:
@@ -276,10 +278,10 @@
             
     def returnFileTypes(self):
         """return list of types of files in the package"""
+        # maybe should die - use direct access to attribute
         return self.files.keys()
     
 
-
 class YumAvailablePackage(PackageObject, RpmBase):
     """derived class for the  packageobject and RpmBase packageobject yum
        uses this for dealing with packages in a repository"""
@@ -304,9 +306,7 @@
             self.arch = self.returnSimple('arch')
             self.pkgtup = self._pkgtup()
             self.remote_path = self.returnSimple('relativepath')
-            
-    def size(self):
-        return self.returnSimple('packagesize')
+            self.size =  self.returnSimple('packagesize')
 
 
     def printVer(self):
@@ -611,9 +611,11 @@
     def _pkgtup(self):
         return (self.name, self.arch, self.epoch, self.version, self.release)
     
-    def size(self):
+    def _size(self):
         return self.tagByName('size')
-
+    
+    size = property(_size)
+    
     def printVer(self):
         """returns a printable version string - including epoch, if it's set"""
         if self.epoch != '0':




More information about the Yum-cvs-commits mailing list