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

Function recursedown

tools/python-3.11.9-amd64/Tools/scripts/pathfix.py:96–116  ·  view source on GitHub ↗
(dirname)

Source from the content-addressed store, hash-verified

94
95
96def recursedown(dirname):
97 dbg('recursedown(%r)\n' % (dirname,))
98 bad = 0
99 try:
100 names = os.listdir(dirname)
101 except OSError as msg:
102 err('%s: cannot list directory: %r\n' % (dirname, msg))
103 return 1
104 names.sort()
105 subdirs = []
106 for name in names:
107 if name in (os.curdir, os.pardir): continue
108 fullname = os.path.join(dirname, name)
109 if os.path.islink(fullname): pass
110 elif os.path.isdir(fullname):
111 subdirs.append(fullname)
112 elif ispython(name):
113 if fix(fullname): bad = 1
114 for fullname in subdirs:
115 if recursedown(fullname): bad = 1
116 return bad
117
118
119def fix(filename):

Callers 1

mainFunction · 0.70

Calls 7

ispythonFunction · 0.85
listdirMethod · 0.80
fixFunction · 0.70
sortMethod · 0.45
joinMethod · 0.45
isdirMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected