Skip to content

Commit

Permalink
Add support for running arcmapper in debug mode
Browse files Browse the repository at this point in the history
  • Loading branch information
abhidg committed Nov 6, 2024
1 parent 91064c9 commit 1012414
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ uv sync
uv run arcmapper
```

This will run arcmapper in production mode. During development it is helpful to
see debug information, to do so run arcmapper with the `-d` or `--debug` flag.

## Usage

The browser should open with the ARCMapper interface
Expand Down
5 changes: 5 additions & 0 deletions src/arcmapper/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import sys
import time
import socket
import logging
Expand Down Expand Up @@ -60,6 +61,10 @@ def wait_for_server(


def main():
if len(sys.argv) > 1 and sys.argv[1] in ["--debug", "-d"]:
print("Using debug mode...")
app.run_server(debug=True)
return
if check_port(ARCMAPPER_HOST, ARCMAPPER_PORT):
logging.info("Port is already in use. Opening browser.")
webbrowser.open(f"http://{ARCMAPPER_HOST}:{ARCMAPPER_PORT}")
Expand Down

0 comments on commit 1012414

Please sign in to comment.