44import platform
55import signal
66import time
7- import typer
87from pathlib import Path
8+
9+ import typer
910from watchdog .observers import Observer
1011
1112from src .epu_data_intake .core_http_api_client import SmartEMAPIClient as APIClient
12- from src .epu_data_intake .model .store import InMemoryDataStore , PersistentDataStore
1313from src .epu_data_intake .fs_parser import EpuParser
1414from src .epu_data_intake .fs_watcher import (
1515 DEFAULT_PATTERNS ,
1616 RateLimitedFilesystemEventHandler ,
1717)
18+ from src .epu_data_intake .model .store import InMemoryDataStore
1819
1920
2021# Create a callback to handle the verbose flag at the root level
@@ -50,7 +51,8 @@ def logging_callback(ctx: typer.Context, param: typer.CallbackParam, value: int)
5051# Add verbose flag to root command
5152shared_verbosity_option = typer .Option (
5253 0 ,
53- "--verbose" , "-v" ,
54+ "--verbose" ,
55+ "-v" ,
5456 count = True ,
5557 help = "Verbosity level: -v for INFO, -vv for DEBUG" ,
5658 callback = logging_callback ,
@@ -67,6 +69,7 @@ def main_callback(verbose: int = shared_verbosity_option):
6769 """Main callback to enable verbose flag on root command"""
6870 pass
6971
72+
7073@parse_cli .callback ()
7174def parse_callback (verbose : int = shared_verbosity_option ):
7275 """Parse group callback to enable verbose flag on parse command"""
@@ -75,8 +78,8 @@ def parse_callback(verbose: int = shared_verbosity_option):
7578
7679@parse_cli .command ("dir" )
7780def parse_epu_output_dir (
78- epu_output_dir : str ,
79- verbose : int = shared_verbosity_option ,
81+ epu_output_dir : str ,
82+ verbose : int = shared_verbosity_option ,
8083):
8184 """Parse an entire EPU output directory structure. May contain multiple grids"""
8285 # Rationale here is that parsers don't persist data to API by design - only watch command does that
@@ -103,8 +106,10 @@ def parse_grid(
103106 logging .warning (f"- { error } " )
104107 else :
105108 # Rationale here is that parsers don't persist data to API by design - only watch command does that
106- datastore = InMemoryDataStore (grid_data_dir ) # TODO confirm this is the dir expected here - top-level watch dir or grid root dir?
107- grid_uuid = EpuParser .parse_grid_dir (grid_data_dir , datastore )
109+ datastore = InMemoryDataStore (
110+ grid_data_dir
111+ ) # TODO confirm this is the dir expected here - top-level watch dir or grid root dir?
112+ EpuParser .parse_grid_dir (grid_data_dir , datastore )
108113 False and logging .debug (datastore )
109114
110115
0 commit comments