MCPcopy
hub / github.com/arrowtype/recursive / splitall

Function splitall

mastering/utils.py:23–41  ·  view source on GitHub ↗

Splits a path into all it's parts, returns a list. *path* is the path to split

(path)

Source from the content-addressed store, hash-verified

21
22
23def splitall(path):
24 """
25 Splits a path into all it's parts, returns a list.
26
27 *path* is the path to split
28 """
29 allparts = []
30 while 1:
31 parts = os.path.split(path)
32 if parts[0] == path: # sentinel for absolute paths
33 allparts.insert(0, parts[0])
34 break
35 elif parts[1] == path: # sentinel for relative paths
36 allparts.insert(0, parts[1])
37 break
38 else:
39 path = parts[0]
40 allparts.insert(0, parts[1])
41 return allparts
42
43
44def printProgressBar(iteration, total, prefix='', suffix='',

Callers 1

buildTTFfilesFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected