remove inconsistent dryrun messaging

When dryrun is defined in config, it is not reflected correctly in run
This commit is contained in:
bobokun 2022-08-21 17:08:13 -04:00
parent 2e15e35ef5
commit 312c65a7e0
No known key found for this signature in database
GPG key ID: 9665BA6CF5DC2671

View file

@ -202,11 +202,7 @@ def start():
args["time"] = start_time.strftime("%H:%M")
args["time_obj"] = start_time
stats_summary = []
if dry_run:
start_type = "Dry-"
else:
start_type = ""
logger.separator(f"Starting {start_type}Run")
logger.separator("Starting Run")
cfg = None
body = ''
run_time = ''
@ -231,13 +227,13 @@ def start():
}
def FinishedRun():
nonlocal end_time, start_time, start_type, stats_summary, run_time, next_run, body
nonlocal end_time, start_time, stats_summary, run_time, next_run, body
end_time = datetime.now()
run_time = str(end_time - start_time).split('.')[0]
_, nr = calc_next_run(sch, True)
next_run_str = nr['next_run_str']
next_run = nr['next_run']
body = logger.separator(f"Finished {start_type}Run\n{os.linesep.join(stats_summary) if len(stats_summary)>0 else ''}\nRun Time: {run_time}\n{next_run_str if len(next_run_str)>0 else ''}"
body = logger.separator(f"Finished Run\n{os.linesep.join(stats_summary) if len(stats_summary)>0 else ''}\nRun Time: {run_time}\n{next_run_str if len(next_run_str)>0 else ''}"
.replace('\n\n', '\n').rstrip())[0]
return next_run, body
try: