From efd4a6bed2c331ccf4790d355b1cce31f27f1505 Mon Sep 17 00:00:00 2001 From: Tom Grundy Date: Thu, 28 Dec 2023 20:19:15 -0800 Subject: [PATCH] fix #724 --- radiolog.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/radiolog.py b/radiolog.py index 2000573..b94f6cf 100644 --- a/radiolog.py +++ b/radiolog.py @@ -1085,7 +1085,9 @@ def __init__(self,parent): self.teamNotesFileName='team_notes.json' # 662 added for debugging - copy the operator file into the run dir on startup and on shutdown - shutil.copy(os.path.join(self.configDir,self.operatorsFileName),os.path.join(self.sessionDir,'operators_at_startup.json')) + # (#724: only if the file exists!) + if os.path.isfile(os.path.join(self.configDir,self.operatorsFileName)): + shutil.copy(os.path.join(self.configDir,self.operatorsFileName),os.path.join(self.sessionDir,'operators_at_startup.json')) # self.operatorsDict: dictionary with one key ('operators') whose value is a list of dictionaries # Why not just a list of dictionaries? Why wrap in a single-item dictionary? @@ -4062,7 +4064,9 @@ def closeEvent(self,event): win32gui.SystemParametersInfo(win32con.SPI_SETACTIVEWINDOWTRACKING,self.initialWindowTracking) # 662 added for debugging - copy the operator file into the run dir on startup and on shutdown - shutil.copy(os.path.join(self.configDir,self.operatorsFileName),os.path.join(self.sessionDir,'operators_at_shutdown.json')) + # (#724: only if the file exists!) + if os.path.isfile(os.path.join(self.configDir,self.operatorsFileName)): + shutil.copy(os.path.join(self.configDir,self.operatorsFileName),os.path.join(self.sessionDir,'operators_at_shutdown.json')) qApp.quit() # needed to make sure all windows area closed