diff --git a/public_transit_viewer/entrypoint.py b/public_transit_viewer/entrypoint.py index 8aed7f3..27b0346 100644 --- a/public_transit_viewer/entrypoint.py +++ b/public_transit_viewer/entrypoint.py @@ -1,4 +1,4 @@ -import os +from pathlib import Path import subprocess SERVER_ADDRESS = "0.0.0.0" @@ -6,19 +6,19 @@ def main(): - script_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) - main_py_path = os.path.join(script_dir, "public_transit_viewer", "main.py") + root_dir = Path(__file__).resolve().parent.parent + main_py_path = root_dir / "public_transit_viewer" / "main.py" subprocess.run( [ "streamlit", "run", - main_py_path, + str(main_py_path), f"--server.port={SERVER_PORT}", f"--server.address={SERVER_ADDRESS}", "--browser.gatherUsageStats=false", ], - cwd=script_dir, + cwd=root_dir, )