kopia lustrzana https://github.com/jupyterhub/repo2docker
check-tmp needs to run on Python 3.5
rodzic
38f5aceb45
commit
2da784ca21
|
@ -50,11 +50,11 @@ def check_dir_size(path):
|
||||||
path = os.path.expanduser(path)
|
path = os.path.expanduser(path)
|
||||||
|
|
||||||
if not os.path.exists(path):
|
if not os.path.exists(path):
|
||||||
print(f"{path}: missing OK")
|
print("{path}: missing OK".format(**locals()))
|
||||||
return True
|
return True
|
||||||
|
|
||||||
size_mb = du(path)
|
size_mb = du(path)
|
||||||
print(f"{path}: {size_mb:.1f} MB", end=" ")
|
print("{path}: {size_mb:.1f} MB".format(**locals()), end=" ")
|
||||||
if size_mb <= THRESHOLD:
|
if size_mb <= THRESHOLD:
|
||||||
print("OK")
|
print("OK")
|
||||||
return True
|
return True
|
||||||
|
@ -66,7 +66,7 @@ def check_dir_size(path):
|
||||||
if os.path.isfile(subpath):
|
if os.path.isfile(subpath):
|
||||||
file_sz = os.stat(subpath).st_size / MB
|
file_sz = os.stat(subpath).st_size / MB
|
||||||
if file_sz > 0.1:
|
if file_sz > 0.1:
|
||||||
print(f" {file_sz:.1f}M {subpath}")
|
print(" {file_sz:.1f}M {subpath}".format(**locals()))
|
||||||
# get report on all subdirs that are at least 100k
|
# get report on all subdirs that are at least 100k
|
||||||
print(
|
print(
|
||||||
indent(
|
indent(
|
||||||
|
|
Ładowanie…
Reference in New Issue