Skip to content

Commit

Permalink
Update tm351_nb_utils.py
Browse files Browse the repository at this point in the history
  • Loading branch information
psychemedia committed Dec 6, 2021
1 parent f3bb423 commit cee31a1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tm351_nb_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,12 +381,12 @@ def cli_zipview(filename, warnings, quiet):
for f in listify(filename):
zip_contents.append((f, insideZip(f)))

if warnings:
print("\n\n====== Zip file quality report ======\n")
if warnings and zip_contents:
for (zn, item) in zip_contents:
print(f"\n\n====== Zip file quality report: {zn} ======\n")
for record in item:
if record[1] > 1e6:
print(f"WARNING: \"{zn}\": looks quite large file ({humanize.naturalsize(record[0])} unzipped, {humanize.naturalsize(record[1])} compressed)")
print(f"WARNING: \"{record[3]}\" looks quite large file ({humanize.naturalsize(record[0])} unzipped, {humanize.naturalsize(record[1])} compressed)")
for _path in record[3].split('/'):
if len(_path) > 50:
print(f"ERROR: the filepath element \"{_path}\" in \"{record[3]}\" is too long (max. 50 chars)")
Expand Down

0 comments on commit cee31a1

Please sign in to comment.