Splits a path into all it's parts, returns a list. *path* is the path to split
(path)
| 21 | |
| 22 | |
| 23 | def 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 | |
| 44 | def printProgressBar(iteration, total, prefix='', suffix='', |