Revision 14b25e00 kamaki/cli/utils.py
b/kamaki/cli/utils.py | ||
---|---|---|
34 | 34 |
from sys import stdout, stdin |
35 | 35 |
from re import compile as regex_compile |
36 | 36 |
from time import sleep |
37 |
from os import walk, path |
|
37 | 38 |
|
38 | 39 |
from kamaki.cli.errors import raiseCLIError |
39 | 40 |
|
... | ... | |
463 | 464 |
print('%s. Split this: (%s)' % (i + 1, example)) |
464 | 465 |
ret = old_split_input(example) |
465 | 466 |
print('\t(%s) of size %s' % (ret, len(ret))) |
467 |
|
|
468 |
|
|
469 |
def get_path_size(testpath): |
|
470 |
if path.isfile(testpath): |
|
471 |
return path.getsize(testpath) |
|
472 |
total_size = 0 |
|
473 |
for top, dirs, files in walk(path.abspath(testpath)): |
|
474 |
for f in files: |
|
475 |
f = path.join(top, f) |
|
476 |
if path.isfile(f): |
|
477 |
total_size += path.getsize(f) |
|
478 |
return total_size |
Also available in: Unified diff