We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 7673dbb + 1e4a309 commit 2cbe919Copy full SHA for 2cbe919
problemtools/problem2html.py
@@ -90,6 +90,16 @@ def convert(problem, options=None):
90
if not options.quiet:
91
print("Warning: Command 'tidy' not found. Install tidy or run with --messy")
92
93
+ # identify any large generated files (especially images)
94
+ if not options.quiet:
95
+ for path, dirs, files in os.walk('.'):
96
+ for f in files:
97
+ file_size_kib = os.stat(os.path.join(path, f)).st_size // 1024
98
+ if file_size_kib > 1024:
99
+ print(f"WARNING: FILE {f} HAS SIZE {file_size_kib} KiB; CONSIDER REDUCING IT")
100
+ elif file_size_kib > 300:
101
+ print(f"Warning: file {f} has size {file_size_kib} KiB; consider reducing it")
102
+
103
if options.bodyonly:
104
content = open(destfile).read()
105
body = re.search('<body>(.*)</body>', content, re.DOTALL)
0 commit comments