[yum-cvs] yum/yum comps.py, 1.10.4.2, 1.10.4.3 depsolve.py, 1.105.2.2, 1.105.2.3 failover.py, 1.2.8.1, 1.2.8.2 mdparser.py, 1.5.4.1, 1.5.4.2 misc.py, 1.19.2.4, 1.19.2.5 packageSack.py, 1.18.2.4, 1.18.2.5 packages.py, 1.73.2.5, 1.73.2.6 pgpmsg.py, 1.5.4.1, 1.5.4.2 sqlitecache.py, 1.13.2.1, 1.13.2.2 update_md.py, 1.3.2.1, 1.3.2.2

James Bowes jbowes at linux.duke.edu
Tue Dec 5 14:03:36 UTC 2006


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

Modified Files:
      Tag: yum-3_0_X
	comps.py depsolve.py failover.py mdparser.py misc.py 
	packageSack.py packages.py pgpmsg.py sqlitecache.py 
	update_md.py 
Log Message:
Revert previous pychecker fixes patch, since I broke things good and proper

Index: comps.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/comps.py,v
retrieving revision 1.10.4.2
retrieving revision 1.10.4.3
diff -u -r1.10.4.2 -r1.10.4.3
--- comps.py	5 Dec 2006 00:44:26 -0000	1.10.4.2
+++ comps.py	5 Dec 2006 14:03:33 -0000	1.10.4.3
@@ -261,7 +261,7 @@
                 self.translated_description[lang] = obj.translated_description[lang]
 
         
-class Comps(object):
+class Comps:
     def __init__(self, overwrite_groups=False):
         self._groups = {}
         self._categories = {}

Index: depsolve.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/depsolve.py,v
retrieving revision 1.105.2.2
retrieving revision 1.105.2.3
diff -u -r1.105.2.2 -r1.105.2.3
--- depsolve.py	5 Dec 2006 00:44:26 -0000	1.105.2.2
+++ depsolve.py	5 Dec 2006 14:03:33 -0000	1.105.2.3
@@ -14,9 +14,12 @@
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 # Copyright 2005 Duke University 
 
+import os
+import os.path
 import re
 import types
 import logging
+import time
 
 import rpmUtils.transaction
 import rpmUtils.miscutils

Index: failover.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/failover.py,v
retrieving revision 1.2.8.1
retrieving revision 1.2.8.2
diff -u -r1.2.8.1 -r1.2.8.2
--- failover.py	5 Dec 2006 00:44:26 -0000	1.2.8.1
+++ failover.py	5 Dec 2006 14:03:33 -0000	1.2.8.2
@@ -72,7 +72,7 @@
         if index >= len(self.repo.urls):
             return None
         
-        return self.repo.urls[index]
+        return self.repos.urls[index]
         
         
     

Index: mdparser.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/mdparser.py,v
retrieving revision 1.5.4.1
retrieving revision 1.5.4.2
diff -u -r1.5.4.1 -r1.5.4.2
--- mdparser.py	5 Dec 2006 00:44:26 -0000	1.5.4.1
+++ mdparser.py	5 Dec 2006 14:03:33 -0000	1.5.4.2
@@ -17,7 +17,10 @@
 import gzip
 from cElementTree import iterparse
 
-from cStringIO import StringIO
+try:
+    from cStringIO import StringIO
+except ImportError:
+    from StringIO import StringIO
 
 #TODO: document everything here
 
@@ -47,6 +50,9 @@
         if not self._handlercls:
             raise ValueError('Unknown repodata type "%s" in %s' % (
                 elem.tag, filename))
+        # Get the total number of packages
+        total = elem.get('packages', None)
+        self.total = total is None and None or int(total)
 
     def __iter__(self):
         return self
@@ -147,13 +153,14 @@
                 p.update(self._prefixprops(child, 'rpm_header'))
 
             elif name == 'file':
-                file_type = child.get('type', 'file')
+                type = child.get('type', 'file')
                 path = child.text
-                self.files[path] = file_type
+                self.files[path] = type
 
     def getPrco(self, elem):
         members = []
         for child in elem:
+            name = self._bn(child.tag)
             members.append(child.attrib)
         return members
         
@@ -166,9 +173,9 @@
         for child in elem:
             name = self._bn(child.tag)
             if name == 'file':
-                file_type = child.get('type', 'file')
+                type = child.get('type', 'file')
                 path = child.text
-                self.files[path] = file_type
+                self.files[path] = type
         elem.clear()
                 
 class OtherEntry(BaseEntry):

Index: misc.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/misc.py,v
retrieving revision 1.19.2.4
retrieving revision 1.19.2.5
diff -u -r1.19.2.4 -r1.19.2.5
--- misc.py	5 Dec 2006 00:44:26 -0000	1.19.2.4
+++ misc.py	5 Dec 2006 14:03:33 -0000	1.19.2.5
@@ -1,4 +1,5 @@
 import types
+import string
 import os
 import os.path
 from cStringIO import StringIO
@@ -135,7 +136,7 @@
         if os.path.isdir(path + '/' + d):
             filelist = getFileList(path + '/' + d, ext, filelist)
         else:
-            if d[-extlen:].lower() == '%s' % (ext):
+            if string.lower(d[-extlen:]) == '%s' % (ext):
                newpath = os.path.normpath(path + '/' + d)
                filelist.append(newpath)
                     

Index: packageSack.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/packageSack.py,v
retrieving revision 1.18.2.4
retrieving revision 1.18.2.5
diff -u -r1.18.2.4 -r1.18.2.5
--- packageSack.py	5 Dec 2006 11:20:13 -0000	1.18.2.4
+++ packageSack.py	5 Dec 2006 14:03:33 -0000	1.18.2.5
@@ -22,7 +22,7 @@
 import re
 import fnmatch
 
-class PackageSackBase(object):
+class PackageSackBase:
     """Base class that provides the interface for PackageSacks."""
     def __init__(self):
         self.added = {}

Index: packages.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/packages.py,v
retrieving revision 1.73.2.5
retrieving revision 1.73.2.6
diff -u -r1.73.2.5 -r1.73.2.6
--- packages.py	5 Dec 2006 00:44:26 -0000	1.73.2.5
+++ packages.py	5 Dec 2006 14:03:33 -0000	1.73.2.6
@@ -171,7 +171,7 @@
                 return (csumtype, csum)
 
                 
-class RpmBase(object):
+class RpmBase:
     """return functions and storage for rpm-specific data"""
 
     def __init__(self):
@@ -475,7 +475,7 @@
         
         try:
             filesum = misc.checksum(csum_type, self.localPkg())
-        except Errors.MiscError:
+        except Errors.MiscError, e:
             return False
         
         if filesum != csum:

Index: pgpmsg.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/pgpmsg.py,v
retrieving revision 1.5.4.1
retrieving revision 1.5.4.2
diff -u -r1.5.4.1 -r1.5.4.2
--- pgpmsg.py	5 Dec 2006 00:44:26 -0000	1.5.4.1
+++ pgpmsg.py	5 Dec 2006 14:03:33 -0000	1.5.4.2
@@ -13,7 +13,7 @@
 ##You should have received a copy of the GNU General Public License
 ##along with this program; if not, write to the Free Software
 ##Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-import struct, time, cStringIO, base64, types, md5, sha
+import string, struct, time, cStringIO, base64, types, md5, sha
 
 debug = None
 
@@ -329,7 +329,7 @@
     return (l[1], l[2])
 
 def str_to_hex(s) :
-    return ''.join(map(lambda x : hex(ord(x))[2:].zfill(2), list(s)))
+    return string.join(map(lambda x : string.zfill(hex(ord(x))[2:], 2), list(s)), '')
 
 def duration_to_str(s) :
     if s == 0 :
@@ -353,7 +353,7 @@
             slist.append(m[i])
         else :
             slist.append('unknown(' + str(i) + ')')
-    return ', '.join(slist)
+    return string.join(slist, ', ')
 
 class pgp_packet :
     def __init__(self) :
@@ -364,7 +364,7 @@
 
 class public_key(pgp_packet) :
     def __init__(self) :
-        pgp_packet.__init__(self)
+        # just initialize the fields
         self.version = None
         self.pk_algo = None
         self.key_size = 0
@@ -478,8 +478,8 @@
 
 class user_id(pgp_packet) :
     def __init__(self) :
-        pgp_packet.__init__(self)
-        self.id = None
+        # just initialize the fields
+        id = None
 
     def deserialize(self, msg, idx, pkt_len) :
         self.id = msg[idx:idx + pkt_len]
@@ -489,7 +489,7 @@
 
 class signature(pgp_packet) :
     def __init__(self) :
-        pgp_packet.__init__(self)
+        # just initialize the fields
         self.version = None
         self.sig_type = None
         self.pk_algo = None
@@ -643,7 +643,7 @@
             return 'preferred symmetric algorithms: ' + map_to_str(algo_sk_to_str, sp[1])
         if sp[0] == SIG_SUB_TYPE_REVOKE_KEY : # revocation key
             s = 'revocation key: '
-            if sp[1] & REVOKE_KEY_CLASS_SENS :
+            if sp[1] & REVOKE_KEY_CLASS_SEN :
                 s = s + '(sensitive) '
             return s + map_to_str(algo_pk_to_str, sp[2]) + ' ' + str_to_hex(sp[3])
         if sp[0] == SIG_SUB_TYPE_ISSUER_KEY_ID : # issuer key ID
@@ -659,7 +659,7 @@
             prefs = []
             if sp[1][0] & 0x80 :
                 prefs.append('No-modify')
-            return s + ', '.join(prefs)
+            return s + string.join(prefs, ', ')
         if sp[0] == SIG_SUB_TYPE_PREF_KEY_SRVR : # preferred key server
             return 'preferred key server: %s' % sp[1]
         if sp[0] == SIG_SUB_TYPE_PRIM_USER_ID : # primary user id
@@ -686,7 +686,7 @@
                 flags.append('private component may have been secret-sharing split')
             if flgs1 & KEY_FLAGS1_GROUP :
                 flags.append('group key')
-            return 'key flags: ' + ', '.join(flags)
+            return 'key flags: ' + string.join(flags, ', ')
         if sp[0] == SIG_SUB_TYPE_SGNR_USER_ID : # signer's user id
             return 'signer id: ' + sp[1]
         if sp[0] == SIG_SUB_TYPE_REVOKE_REASON : # reason for revocation
@@ -769,7 +769,7 @@
 # a series of PGP packets of certain types in certain orders
 #
 
-class pgp_certificate(object):
+class pgp_certificate :
     def __init__(self) :
         self.version = None
         self.public_key = None
@@ -1021,9 +1021,9 @@
             plen, idx = get_whole_int(msg, idx, 4)
             return b & CTB_PKT_MASK, plen, idx
         else :
-            raise Exception, 'partial message bodies are not supported by this version (%d)', b
+            raise 'partial message bodies are not supported by this version (%d)', b
     else :
-        raise Exception, "unknown (not \"normal\") cypher type bit %d at byte %d" % (b, idx)
+        raise "unknown (not \"normal\") cypher type bit %d at byte %d" % (b, idx)
 
 def crc24(msg) :
     crc24_init = 0xb704ce
@@ -1072,7 +1072,7 @@
 def decode_msg(msg) :
     # first we'll break the block up into lines and trim each line of any 
     # carriage return chars
-    pgpkey_lines = map(lambda x : x.rstrip(), msg.split('\n'))
+    pgpkey_lines = map(lambda x : string.rstrip(x), string.split(msg, '\n'))
 
     # check out block
     in_block = 0
@@ -1104,7 +1104,7 @@
 
             # check the checksum
             if csum != crc24(cert_msg) :
-                raise Exception, 'bad checksum on pgp message'
+                raise 'bad checksum on pgp message'
 
             # ok, the sum looks ok so we'll actually decode the thing
             pkt_list = decode(cert_msg)

Index: sqlitecache.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/sqlitecache.py,v
retrieving revision 1.13.2.1
retrieving revision 1.13.2.2
diff -u -r1.13.2.1 -r1.13.2.2
--- sqlitecache.py	5 Dec 2006 00:44:26 -0000	1.13.2.1
+++ sqlitecache.py	5 Dec 2006 14:03:33 -0000	1.13.2.2
@@ -76,6 +76,7 @@
         dbchecksum = ''
         # First try to open an existing database
         try:
+            f = open(filename)
             (dbchecksum,db) = self.loadCache(filename)
         except (IOError,sqlite.DatabaseError,KeyError):
             # If it doesn't exist, create it
@@ -235,6 +236,7 @@
         # Try to create the databse in filename, or use in memory when
         # this fails
         try:
+            f = open(filename,'w')
             db = sqlite.connect(filename) 
         except IOError:
             self.verbose_logger.log(logginglevels.INFO_1, "Warning could not create sqlite cache file, using in memory cache instead")

Index: update_md.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/update_md.py,v
retrieving revision 1.3.2.1
retrieving revision 1.3.2.2
diff -u -r1.3.2.1 -r1.3.2.2
--- update_md.py	5 Dec 2006 00:44:26 -0000	1.3.2.1
+++ update_md.py	5 Dec 2006 14:03:33 -0000	1.3.2.2
@@ -19,6 +19,7 @@
 
 import sys
 import gzip
+import string
 import exceptions
 
 from yum.yumRepo import YumRepository
@@ -212,7 +213,7 @@
 
     def get_notice(self, nvr):
         """ Retrieve an update notice for a given (name, version, release). """
-        nvr = '-'.join(nvr)
+        nvr = string.join(nvr, '-')
         return self._cache.has_key(nvr) and self._cache[nvr] or None
 
     def add(self, obj, mdtype='updateinfo'):




More information about the Yum-cvs-commits mailing list