Skip to content

Commit

Permalink
24 November 2024 21:53:08 - Add CLI mode support and refactor app ent…
Browse files Browse the repository at this point in the history
…ry point
  • Loading branch information
VKrishna04 committed Nov 24, 2024
1 parent db64a0b commit 8435e13
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
16 changes: 12 additions & 4 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,16 @@
from cli_app import run_cli_app

if __name__ == "__main__":
streamlit_server = os.getenv("STREAMLIT_SERVER")
if streamlit_server and "streamlit" in streamlit_server:
run_streamlit_app()
else:
parser = argparse.ArgumentParser(
description="Run the application in different modes"
)
parser.add_argument(
"--cli", action="store_true", help="Run the application in CLI mode"
)

args = parser.parse_args()

if args.cli:
run_cli_app()
else:
run_streamlit_app()
1 change: 0 additions & 1 deletion run_app.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@echo off
set STREAMLIT_SERVER=streamlit
cd /d "%~dp0"

echo Checking for required dependencies...
Expand Down

0 comments on commit 8435e13

Please sign in to comment.