@@ -28,6 +28,7 @@ class _Config(TypedDict):
2828 avoid_duplicate_runs : bool
2929 retry_policy : Literal ["human" , "robot" ]
3030 connection_n_retries : int
31+ show_progress : bool
3132
3233
3334def _create_log_handlers (create_file_handler : bool = True ) -> None : # noqa: FBT001, FBT002
@@ -111,6 +112,7 @@ def set_file_log_level(file_output_level: int) -> None:
111112 "avoid_duplicate_runs" : True ,
112113 "retry_policy" : "human" ,
113114 "connection_n_retries" : 5 ,
115+ "show_progress" : False ,
114116}
115117
116118# Default values are actually added here in the _setup() function which is
@@ -131,6 +133,7 @@ def get_server_base_url() -> str:
131133
132134
133135apikey : str = _defaults ["apikey" ]
136+ show_progress : bool = _defaults ["show_progress" ]
134137# The current cache directory (without the server name)
135138_root_cache_directory = Path (_defaults ["cachedir" ])
136139avoid_duplicate_runs = _defaults ["avoid_duplicate_runs" ]
@@ -238,6 +241,7 @@ def _setup(config: _Config | None = None) -> None:
238241 global server # noqa: PLW0603
239242 global _root_cache_directory # noqa: PLW0603
240243 global avoid_duplicate_runs # noqa: PLW0603
244+ global show_progress # noqa: PLW0603
241245
242246 config_file = determine_config_file_path ()
243247 config_dir = config_file .parent
@@ -255,6 +259,7 @@ def _setup(config: _Config | None = None) -> None:
255259 avoid_duplicate_runs = config ["avoid_duplicate_runs" ]
256260 apikey = config ["apikey" ]
257261 server = config ["server" ]
262+ show_progress = config ["show_progress" ]
258263 short_cache_dir = Path (config ["cachedir" ])
259264 n_retries = int (config ["connection_n_retries" ])
260265
@@ -328,11 +333,11 @@ def _parse_config(config_file: str | Path) -> _Config:
328333 logger .info ("Error opening file %s: %s" , config_file , e .args [0 ])
329334 config_file_ .seek (0 )
330335 config .read_file (config_file_ )
331- if isinstance (config [ "FAKE_SECTION" ][ "avoid_duplicate_runs" ], str ):
332- config [ "FAKE_SECTION" ][ " avoid_duplicate_runs"] = config [ "FAKE_SECTION" ]. getboolean (
333- "avoid_duplicate_runs"
334- ) # type: ignore
335- return dict ( config . items ( "FAKE_SECTION" )) # type: ignore
336+ configuration = dict (config . items ( "FAKE_SECTION" ))
337+ for boolean_field in [ " avoid_duplicate_runs", "show_progress" ]:
338+ if isinstance ( config [ "FAKE_SECTION" ][ boolean_field ], str ):
339+ configuration [ boolean_field ] = config [ "FAKE_SECTION" ]. getboolean ( boolean_field ) # type: ignore
340+ return configuration # type: ignore
336341
337342
338343def get_config_as_dict () -> _Config :
@@ -343,6 +348,7 @@ def get_config_as_dict() -> _Config:
343348 "avoid_duplicate_runs" : avoid_duplicate_runs ,
344349 "connection_n_retries" : connection_n_retries ,
345350 "retry_policy" : retry_policy ,
351+ "show_progress" : show_progress ,
346352 }
347353
348354
0 commit comments