summaryrefslogtreecommitdiffstats
path: root/Tools/scripts/dutree.py
diff options
context:
space:
mode:
authorWalter Dörwald <walter@livinglogic.de>2002-09-11 20:36:02 (GMT)
committerWalter Dörwald <walter@livinglogic.de>2002-09-11 20:36:02 (GMT)
commitaaab30e00cc3e8d90c71b8657c284feeb4ac1413 (patch)
treed055e0bd374770014d9afdff1b961418b1828584 /Tools/scripts/dutree.py
parent6a0477b099560a452e37fe77c3850bf232487c16 (diff)
downloadcpython-aaab30e00cc3e8d90c71b8657c284feeb4ac1413.zip
cpython-aaab30e00cc3e8d90c71b8657c284feeb4ac1413.tar.gz
cpython-aaab30e00cc3e8d90c71b8657c284feeb4ac1413.tar.bz2
Apply diff2.txt from SF patch http://www.python.org/sf/572113
(with one small bugfix in bgen/bgen/scantools.py) This replaces string module functions with string methods for the stuff in the Tools directory. Several uses of string.letters etc. are still remaining.
Diffstat (limited to 'Tools/scripts/dutree.py')
-rwxr-xr-xTools/scripts/dutree.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Tools/scripts/dutree.py b/Tools/scripts/dutree.py
index 7a32533..35b3916 100755
--- a/Tools/scripts/dutree.py
+++ b/Tools/scripts/dutree.py
@@ -1,10 +1,10 @@
#! /usr/bin/env python
# Format du output in a tree shape
-import os, string, sys, errno
+import os, sys, errno
def main():
- p = os.popen('du ' + string.join(sys.argv[1:]), 'r')
+ p = os.popen('du ' + ' '.join(sys.argv[1:]), 'r')
total, d = None, {}
for line in p.readlines():
i = 0
@@ -12,7 +12,7 @@ def main():
size = eval(line[:i])
while line[i] in ' \t': i = i+1
file = line[i:-1]
- comps = string.splitfields(file, '/')
+ comps = file.split('/')
if comps[0] == '': comps[0] = '/'
if comps[len(comps)-1] == '': del comps[len(comps)-1]
total, d = store(size, comps, total, d)
@@ -51,7 +51,7 @@ def show(total, d, prefix):
if tsub is None:
psub = prefix
else:
- print prefix + string.rjust(`tsub`, width) + ' ' + key
+ print prefix + repr(tsub).rjust(width) + ' ' + key
psub = prefix + ' '*(width-1) + '|' + ' '*(len(key)+1)
if d.has_key(key):
show(tsub, d[key][1], psub)