@@ -68,7 +68,6 @@ def __init__(self, args: Namespace) -> None:
68
68
self .log .debug ('Received json config file path (%s)' , self .args .cfg )
69
69
if not os .path .isfile (self .args .cfg ):
70
70
self .log .critical ('Invalid json config file path supplied (%s)' , self .args .cfg )
71
- sys .exit (1 )
72
71
73
72
__bar = bar_factory ('\u2501 ' , borders = (' ' , ' ' ), background = ' ' )
74
73
__spinner = frame_spinner_factory ([colored (p , 'cyan' ) if supports_color else p for p in '⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏' ])
@@ -144,7 +143,6 @@ def __get_json_config_path(self) -> str:
144
143
145
144
if len (found ) == 0 :
146
145
self .log .critical ('No json config file found in file tree' )
147
- sys .exit (1 )
148
146
return found .pop ()
149
147
150
148
def __on_end (self , sig : int , _ : Any , / ) -> None :
@@ -207,14 +205,12 @@ def __load_points(self, cfg: Config) -> None:
207
205
208
206
self .log .critical ('Failed to parse line: %s (%s:%d)\n %s' , line , cfg .file_path ,
209
207
len (self .points ) + int (cfg .skip_first_line ) - index , e )
210
- sys .exit (1 )
211
208
212
209
except FileNotFoundError as e :
213
210
self .log .error ('Skipping unknown file: %s' , e )
214
211
return
215
212
except Exception as e : # pylint: disable=broad-except
216
213
self .log .critical ('Failed to read file: %s\n %s' , cfg .file_path , e )
217
- sys .exit (1 )
218
214
self .log .debug ('Loaded %s points from file: \u2026 /%s' ,
219
215
format (len (self .points ) + int (cfg .skip_first_line ) - index , '_' ), basename )
220
216
@@ -277,25 +273,21 @@ def __setup(self) -> None:
277
273
self .log .critical (
278
274
'Failed to parse json config file : '
279
275
'maximum nesting level could be reached, please check your file\n %s' , e )
280
- sys .exit (1 )
281
276
if not raw_data :
282
277
self .log .critical ('Failed to parse %s : empty file' , self .args .cfg )
283
- sys .exit (1 )
284
278
default : dict [str , Any ] = None
285
279
configs : list [dict [str , Any ]] = None
286
280
try :
287
281
default = raw_data ['default' ]
288
282
configs = raw_data ['configs' ]
289
283
except KeyError as e :
290
284
self .log .critical ('Failed to parse %s : %s' , self .args .cfg , e )
291
- sys .exit (1 )
292
285
cfgs : list [Config ] = []
293
286
try :
294
287
for cfg in configs :
295
288
cfgs .append (Config .from_json (json = cfg , ** default ))
296
289
except ValueError as e :
297
290
self .log .critical ('Failed to parse config n°%d : %s' , len (cfgs ), e )
298
- sys .exit (1 )
299
291
300
292
fset : list [int ] = None
301
293
if self .args .only and any (map (lambda x : x > len (cfgs ), self .args .only )): # pylint: disable=bad-builtin
0 commit comments