File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -145,11 +145,17 @@ def main():
145145 if os .path .isdir (options ['logs' ]['dir_logs' ]):
146146 if click .confirm ('Logs directory already exists in {}. Erase?'
147147 .format (options ['logs' ]['dir_logs' ], default = False )):
148- os .system ('rm -r ' + options ['logs' ]['dir_logs' ])
148+ os .system ('rm -r ' + options ['logs' ]['dir_logs' ])
149149 else :
150150 return
151- os .system ('mkdir -p ' + options ['logs' ]['dir_logs' ])
152- os .system ('cp {} {}' .format (args .path_opt , options ['logs' ]['dir_logs' ]))
151+ os .system ('mkdir -p ' + options ['logs' ]['dir_logs' ])
152+ path_new_opt = os .path .join (options ['logs' ]['dir_logs' ],
153+ os .path .basename (args .path_opt ))
154+ path_args = os .path .join (options ['logs' ]['dir_logs' ], 'args.yaml' )
155+ with open (path_new_opt , 'w' ) as f :
156+ yaml .dump (options , f , default_flow_style = False )
157+ with open (path_args , 'w' ) as f :
158+ yaml .dump (vars (args ), f , default_flow_style = False )
153159
154160 if exp_logger is None :
155161 # Set loggers
You can’t perform that action at this time.
0 commit comments