Skip to content

Commit f1c698d

Browse files
committed
ref(viewer): simplify freeze viewer
1 parent 4cef3f5 commit f1c698d

1 file changed

Lines changed: 11 additions & 19 deletions

File tree

freeze_viewer.py

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,7 @@ def main():
7777
logs_dir = Path(args.logs_dir).resolve()
7878
output_dir = Path(args.output_dir).resolve()
7979

80-
if not logs_dir.exists():
81-
print(f"Error: Logs directory '{logs_dir}' does not exist")
82-
return 1
80+
assert logs_dir.exists()
8381

8482
# Set the logs directory for the app
8583
set_log_base_directory(logs_dir)
@@ -99,22 +97,16 @@ def main():
9997
freezer = setup_freezer(str(output_dir))
10098

10199
# Generate static site
102-
try:
103-
print("Freezing Flask application...")
104-
freezer.freeze()
105-
106-
# Post-process: Add .html extensions to files that don't have them
107-
print("Post-processing: Adding .html extensions...")
108-
_add_html_extensions(output_dir)
109-
110-
print(f"✅ Static site generated successfully in: {output_dir}")
111-
print(f"📁 Open {output_dir}/index.html in your browser to view the static site")
112-
print(f"💡 For best results, serve via HTTP server: cd {output_dir} && python -m http.server 8000")
113-
114-
return 0
115-
except Exception as e:
116-
print(f"❌ Error generating static site: {e}")
117-
return 1
100+
print("Freezing Flask application...")
101+
freezer.freeze()
102+
103+
# Post-process: Add .html extensions to files that don't have them
104+
print("Post-processing: Adding .html extensions...")
105+
_add_html_extensions(output_dir)
106+
107+
print(f"✅ Static site generated successfully in: {output_dir}")
108+
print(f"📁 Open {output_dir}/index.html in your browser to view the static site")
109+
print(f"💡 For best results, serve via HTTP server: cd {output_dir} && python -m http.server 8000")
118110

119111

120112
def _add_html_extensions(build_dir: Path):

0 commit comments

Comments
 (0)