[yum-cvs] yum/yum comps.py, 1.10.4.1, 1.10.4.2 depsolve.py, 1.105.2.1, 1.105.2.2 failover.py, 1.2, 1.2.8.1 mdparser.py, 1.5, 1.5.4.1 misc.py, 1.19.2.3, 1.19.2.4 packageSack.py, 1.18.2.2, 1.18.2.3 packages.py, 1.73.2.4, 1.73.2.5 pgpmsg.py, 1.5, 1.5.4.1 sqlitecache.py, 1.13, 1.13.2.1 update_md.py, 1.3, 1.3.2.1
James Bowes
jbowes at linux.duke.edu
Tue Dec 5 00:44:29 UTC 2006
- Previous message: [yum-cvs] yum callback.py, 1.29, 1.29.2.1 cli.py, 1.241.2.4, 1.241.2.5 output.py, 1.72.2.1, 1.72.2.2 progress_meter.py, 1.3, 1.3.6.1 shell.py, 1.33.2.1, 1.33.2.2 yum-updatesd.py, 1.22.2.5, 1.22.2.6
- Next message: [yum-cvs] yum/yum __init__.py, 1.259.2.5, 1.259.2.6 packageSack.py, 1.18.2.3, 1.18.2.4
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /home/groups/yum/cvs/yum/yum
In directory login1.linux.duke.edu:/tmp/cvs-serv792/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:
pychecker related fixes, including unused imports, and removal of use of deprecated methods from the string module
Index: comps.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/comps.py,v
retrieving revision 1.10.4.1
retrieving revision 1.10.4.2
diff -u -r1.10.4.1 -r1.10.4.2
--- comps.py 18 Oct 2006 04:18:03 -0000 1.10.4.1
+++ comps.py 5 Dec 2006 00:44:26 -0000 1.10.4.2
@@ -261,7 +261,7 @@
self.translated_description[lang] = obj.translated_description[lang]
-class Comps:
+class Comps(object):
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.1
retrieving revision 1.105.2.2
diff -u -r1.105.2.1 -r1.105.2.2
--- depsolve.py 13 Oct 2006 13:13:16 -0000 1.105.2.1
+++ depsolve.py 5 Dec 2006 00:44:26 -0000 1.105.2.2
@@ -14,12 +14,9 @@
# 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
retrieving revision 1.2.8.1
diff -u -r1.2 -r1.2.8.1
--- failover.py 2 Feb 2004 07:14:30 -0000 1.2
+++ failover.py 5 Dec 2006 00:44:26 -0000 1.2.8.1
@@ -72,7 +72,7 @@
if index >= len(self.repo.urls):
return None
- return self.repos.urls[index]
+ return self.repo.urls[index]
Index: mdparser.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/mdparser.py,v
retrieving revision 1.5
retrieving revision 1.5.4.1
diff -u -r1.5 -r1.5.4.1
--- mdparser.py 8 Dec 2005 21:50:14 -0000 1.5
+++ mdparser.py 5 Dec 2006 00:44:26 -0000 1.5.4.1
@@ -17,10 +17,7 @@
import gzip
from cElementTree import iterparse
-try:
- from cStringIO import StringIO
-except ImportError:
- from StringIO import StringIO
+from cStringIO import StringIO
#TODO: document everything here
@@ -50,9 +47,6 @@
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
@@ -153,14 +147,13 @@
p.update(self._prefixprops(child, 'rpm_header'))
elif name == 'file':
- type = child.get('type', 'file')
+ file_type = child.get('type', 'file')
path = child.text
- self.files[path] = type
+ self.files[path] = file_type
def getPrco(self, elem):
members = []
for child in elem:
- name = self._bn(child.tag)
members.append(child.attrib)
return members
@@ -173,9 +166,9 @@
for child in elem:
name = self._bn(child.tag)
if name == 'file':
- type = child.get('type', 'file')
+ file_type = child.get('type', 'file')
path = child.text
- self.files[path] = type
+ self.files[path] = file_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.3
retrieving revision 1.19.2.4
diff -u -r1.19.2.3 -r1.19.2.4
--- misc.py 14 Nov 2006 21:07:55 -0000 1.19.2.3
+++ misc.py 5 Dec 2006 00:44:26 -0000 1.19.2.4
@@ -1,5 +1,4 @@
import types
-import string
import os
import os.path
from cStringIO import StringIO
@@ -136,7 +135,7 @@
if os.path.isdir(path + '/' + d):
filelist = getFileList(path + '/' + d, ext, filelist)
else:
- if string.lower(d[-extlen:]) == '%s' % (ext):
+ if d[-extlen:].lower() == '%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.2
retrieving revision 1.18.2.3
diff -u -r1.18.2.2 -r1.18.2.3
--- packageSack.py 3 Dec 2006 15:56:51 -0000 1.18.2.2
+++ packageSack.py 5 Dec 2006 00:44:26 -0000 1.18.2.3
@@ -22,7 +22,7 @@
import re
import fnmatch
-class PackageSackBase:
+class PackageSackBase(object):
"""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.4
retrieving revision 1.73.2.5
diff -u -r1.73.2.4 -r1.73.2.5
--- packages.py 18 Oct 2006 04:18:03 -0000 1.73.2.4
+++ packages.py 5 Dec 2006 00:44:26 -0000 1.73.2.5
@@ -171,7 +171,7 @@
return (csumtype, csum)
-class RpmBase:
+class RpmBase(object):
"""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, e:
+ except Errors.MiscError:
return False
if filesum != csum:
Index: pgpmsg.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/pgpmsg.py,v
retrieving revision 1.5
retrieving revision 1.5.4.1
diff -u -r1.5 -r1.5.4.1
--- pgpmsg.py 2 Mar 2006 21:20:33 -0000 1.5
+++ pgpmsg.py 5 Dec 2006 00:44:26 -0000 1.5.4.1
@@ -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 string, struct, time, cStringIO, base64, types, md5, sha
+import struct, time, cStringIO, base64, types, md5, sha
debug = None
@@ -329,7 +329,7 @@
return (l[1], l[2])
def str_to_hex(s) :
- return string.join(map(lambda x : string.zfill(hex(ord(x))[2:], 2), list(s)), '')
+ return ''.join(map(lambda x : hex(ord(x))[2:].zfill(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 string.join(slist, ', ')
+ return ', '.join(slist)
class pgp_packet :
def __init__(self) :
@@ -364,7 +364,7 @@
class public_key(pgp_packet) :
def __init__(self) :
- # just initialize the fields
+ pgp_packet.__init__(self)
self.version = None
self.pk_algo = None
self.key_size = 0
@@ -478,8 +478,8 @@
class user_id(pgp_packet) :
def __init__(self) :
- # just initialize the fields
- id = None
+ pgp_packet.__init__(self)
+ self.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) :
- # just initialize the fields
+ pgp_packet.__init__(self)
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_SEN :
+ if sp[1] & REVOKE_KEY_CLASS_SENS :
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 + string.join(prefs, ', ')
+ return s + ', '.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: ' + string.join(flags, ', ')
+ return 'key flags: ' + ', '.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 :
+class pgp_certificate(object):
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 'partial message bodies are not supported by this version (%d)', b
+ raise Exception, 'partial message bodies are not supported by this version (%d)', b
else :
- raise "unknown (not \"normal\") cypher type bit %d at byte %d" % (b, idx)
+ raise Exception, "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 : string.rstrip(x), string.split(msg, '\n'))
+ pgpkey_lines = map(lambda x : x.rstrip(), msg.split('\n'))
# check out block
in_block = 0
@@ -1104,7 +1104,7 @@
# check the checksum
if csum != crc24(cert_msg) :
- raise 'bad checksum on pgp message'
+ raise Exception, '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
retrieving revision 1.13.2.1
diff -u -r1.13 -r1.13.2.1
--- sqlitecache.py 10 Jul 2006 16:54:25 -0000 1.13
+++ sqlitecache.py 5 Dec 2006 00:44:26 -0000 1.13.2.1
@@ -76,7 +76,6 @@
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
@@ -236,7 +235,6 @@
# 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
retrieving revision 1.3.2.1
diff -u -r1.3 -r1.3.2.1
--- update_md.py 9 Aug 2006 14:44:07 -0000 1.3
+++ update_md.py 5 Dec 2006 00:44:26 -0000 1.3.2.1
@@ -19,7 +19,6 @@
import sys
import gzip
-import string
import exceptions
from yum.yumRepo import YumRepository
@@ -213,7 +212,7 @@
def get_notice(self, nvr):
""" Retrieve an update notice for a given (name, version, release). """
- nvr = string.join(nvr, '-')
+ nvr = '-'.join(nvr)
return self._cache.has_key(nvr) and self._cache[nvr] or None
def add(self, obj, mdtype='updateinfo'):
- Previous message: [yum-cvs] yum callback.py, 1.29, 1.29.2.1 cli.py, 1.241.2.4, 1.241.2.5 output.py, 1.72.2.1, 1.72.2.2 progress_meter.py, 1.3, 1.3.6.1 shell.py, 1.33.2.1, 1.33.2.2 yum-updatesd.py, 1.22.2.5, 1.22.2.6
- Next message: [yum-cvs] yum/yum __init__.py, 1.259.2.5, 1.259.2.6 packageSack.py, 1.18.2.3, 1.18.2.4
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Yum-cvs-commits
mailing list