Remove functions in string module that are also string methods. Also remove:
* all calls to functions in the string module (except maketrans)
* everything from stropmodule except for maketrans() which is still used
diff --git a/Lib/plat-irix6/cddb.py b/Lib/plat-irix6/cddb.py
index bfdf57d..bdd2ec3 100644
--- a/Lib/plat-irix6/cddb.py
+++ b/Lib/plat-irix6/cddb.py
@@ -14,14 +14,14 @@
# You can then use c.write() to write out the changed values to the
# .cdplayerrc file.
-import string, posix, os
+import posix, os
_cddbrc = '.cddb'
_DB_ID_NTRACKS = 5
_dbid_map = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ@_=+abcdefghijklmnopqrstuvwxyz'
def _dbid(v):
if v >= len(_dbid_map):
- return string.zfill(v, 2)
+ return v.zfill(2)
else:
return _dbid_map[v]
@@ -164,11 +164,10 @@
for i in range(nidtracks):
start, length = tracklist[i]
self.id = self.id + _dbid(length[0]) + _dbid(length[1])
- self.toc = string.zfill(ntracks, 2)
+ self.toc = ntracks.zfill(2)
for track in tracklist:
start, length = track
- self.toc = self.toc + string.zfill(length[0], 2) + \
- string.zfill(length[1], 2)
+ self.toc = self.toc + length[0].zfill(2) + length[1].zfill(2)
def write(self):
import posixpath
diff --git a/Lib/plat-irix6/cdplayer.py b/Lib/plat-irix6/cdplayer.py
index a2be8b4..493527f 100644
--- a/Lib/plat-irix6/cdplayer.py
+++ b/Lib/plat-irix6/cdplayer.py
@@ -18,7 +18,6 @@
class Cdplayer:
def __init__(self, tracklist):
- import string
self.artist = ''
self.title = ''
if type(tracklist) == type(''):
@@ -29,11 +28,11 @@
int(tracklist[i+2:i+4]))))
tracklist = t
self.track = [None] + [''] * len(tracklist)
- self.id = 'd' + string.zfill(len(tracklist), 2)
+ self.id = 'd' + repr(len(tracklist)).zfill(2)
for track in tracklist:
start, length = track
- self.id = self.id + string.zfill(length[0], 2) + \
- string.zfill(length[1], 2)
+ self.id = self.id + repr(length[0]).zfill(2) + \
+ repr(length[1]).zfill(2)
try:
import posix
f = open(posix.environ['HOME'] + '/' + cdplayerrc, 'r')