Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
4a5ab81b
Commit
4a5ab81b
authored
Mar 30, 1992
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
posix -> os
parent
3a585bb9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
Tools/scripts/dutree.py
Tools/scripts/dutree.py
+3
-3
No files found.
Tools/scripts/dutree.py
View file @
4a5ab81b
#! /usr/local/python
# Format du output in a tree shape
import
posix
,
string
,
sys
,
path
import
os
,
string
,
sys
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
,
{}
for
line
in
p
.
readlines
():
[
num
,
file
]
=
string
.
split
(
line
)
...
...
@@ -36,7 +36,7 @@ def show(total, d, prefix):
list
.
append
((
tsub
,
key
))
if
tsub
is
not
None
:
sum
=
sum
+
tsub
if
sum
<
total
:
list
.
append
((
total
-
sum
,
'.'
))
list
.
append
((
total
-
sum
,
os
.
curdir
))
list
.
sort
()
list
.
reverse
()
width
=
len
(
`list[0][0]`
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment