Initial commit: reocon camera dashboard project
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
import sys
|
||||
import logging
|
||||
from reocon.cameras import get_camera_infos_df
|
||||
from reocon.dashboard import app
|
||||
|
||||
logging.basicConfig(
|
||||
level=logging.INFO,
|
||||
format="%(asctime)s [%(levelname)s] %(message)s",
|
||||
handlers=[logging.StreamHandler()]
|
||||
)
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def run_console():
|
||||
logger.info("Running in console mode")
|
||||
df = get_camera_infos_df()
|
||||
print(df.to_string(index=False))
|
||||
|
||||
|
||||
def run_web():
|
||||
logger.info("Starting Flask web dashboard")
|
||||
app.run(debug=True)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
if len(sys.argv) > 1 and sys.argv[1] == "console":
|
||||
run_console()
|
||||
else:
|
||||
run_web()
|
||||
Reference in New Issue
Block a user