-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
36 lines (27 loc) · 1.05 KB
/
Copy pathapp.py
File metadata and controls
36 lines (27 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# src/app.py
import argparse
import os
from dotenv import load_dotenv
from core.adapters.file_adapter_interface import get_loop_config_base_path_by_user_and_loop
from core.controllers.loop_controller import LoopController
import config
from core.databus import global_vars
from core.services.logger_service import LoggerService
def main():
parser = argparse.ArgumentParser(description='Run the application with the specified command.')
parser.add_argument('--loop', type=str, help='Path to the loop file.')
parser.add_argument('--user', type=str, help='Web User ID')
parser.add_argument('--loopId', type=str, help='Web Loop ID')
args = parser.parse_args()
if args.user:
config.GLOBAL_USER_ID = args.user
if args.loopId:
config.GLOBAL_LOOP_ID = args.loopId
if args.loop:
controller = LoopController(args.loop)
controller.run()
else:
logger_service = LoggerService()
logger_service.error("No loop file provided. Use --help for more information.")
if __name__ == "__main__":
main()