MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / main

Function main

tools/python-3.11.9-amd64/Tools/scripts/dutree.py:6–23  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4import os, sys, errno
5
6def main():
7 total, d = None, {}
8 with os.popen('du ' + ' '.join(sys.argv[1:])) as p:
9 for line in p:
10 i = 0
11 while line[i] in '0123456789': i = i+1
12 size = eval(line[:i])
13 while line[i] in ' \t': i = i+1
14 filename = line[i:-1]
15 comps = filename.split('/')
16 if comps[0] == '': comps[0] = '/'
17 if comps[len(comps)-1] == '': del comps[len(comps)-1]
18 total, d = store(size, comps, total, d)
19 try:
20 display(total, d)
21 except IOError as e:
22 if e.errno != errno.EPIPE:
23 raise
24
25def store(size, comps, total, d):
26 if comps == []:

Callers 1

dutree.pyFile · 0.70

Calls 4

storeFunction · 0.70
displayFunction · 0.70
joinMethod · 0.45
splitMethod · 0.45

Tested by

no test coverage detected