From: antarus Date: Sun, 1 Apr 2007 03:42:49 +0000 (-0000) Subject: remove deprecated string usage X-Git-Tag: gentoolkit-0.2.4.3~143 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c94a5cdec8c810a23c7952db2ab6b3aa2958c904;p=gentoolkit.git remove deprecated string usage svn path=/; revision=370 --- diff --git a/trunk/src/eclean/eclean b/trunk/src/eclean/eclean index 066b0d2..5c5f117 100644 --- a/trunk/src/eclean/eclean +++ b/trunk/src/eclean/eclean @@ -17,7 +17,7 @@ __description__ = "A cleaning tool for Gentoo distfiles and binaries." # Python imports: import sys import os, stat -import string, re +import re import time import getopt import fpformat @@ -249,7 +249,7 @@ def parseSize(size): mymatch = re.match(r"^(?P\d+)(?P[GMKBgmkb])?$",size) mysize = int(mymatch.group('value')) if mymatch.group('unit'): - mysize *= myunits[string.capitalize(mymatch.group('unit'))] + mysize *= myunits[mymatch.group('unit').capitalize()] except: raise ParseArgsException('size') return mysize @@ -271,7 +271,7 @@ def parseTime(timespec): mymatch = re.match(r"^(?P\d+)(?P[YMWDHymwdh])?$",timespec) myvalue = int(mymatch.group('value')) if not mymatch.group('unit'): myunit = 'D' - else: myunit = string.capitalize(mymatch.group('unit')) + else: myunit = mymatch.group('unit').capitalize() except: raise ParseArgsException('time') # calculate the limit EPOCH date mytime = time.time() - (myvalue * myunits[myunit])