mirror of
https://github.com/python/cpython.git
synced 2025-12-10 11:00:14 +00:00
posix -> os
This commit is contained in:
parent
3a585bb964
commit
4a5ab81bc9
1 changed files with 3 additions and 3 deletions
|
|
@ -1,10 +1,10 @@
|
||||||
#! /usr/local/python
|
#! /usr/local/python
|
||||||
# Format du output in a tree shape
|
# Format du output in a tree shape
|
||||||
|
|
||||||
import posix, string, sys, path
|
import os, string, sys
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
p = posix.popen('du ' + string.join(sys.argv[1:]), 'r')
|
p = os.popen('du ' + string.join(sys.argv[1:]), 'r')
|
||||||
total, d = None, {}
|
total, d = None, {}
|
||||||
for line in p.readlines():
|
for line in p.readlines():
|
||||||
[num, file] = string.split(line)
|
[num, file] = string.split(line)
|
||||||
|
|
@ -36,7 +36,7 @@ def show(total, d, prefix):
|
||||||
list.append((tsub, key))
|
list.append((tsub, key))
|
||||||
if tsub is not None: sum = sum + tsub
|
if tsub is not None: sum = sum + tsub
|
||||||
if sum < total:
|
if sum < total:
|
||||||
list.append((total - sum, '.'))
|
list.append((total - sum, os.curdir))
|
||||||
list.sort()
|
list.sort()
|
||||||
list.reverse()
|
list.reverse()
|
||||||
width = len(`list[0][0]`)
|
width = len(`list[0][0]`)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue