ncssar / radiolog

SAR radio log program
Other
13 stars 3 forks source link

crash on restore #709

Closed caver456 closed 7 months ago

caver456 commented 7 months ago

PS C:\Users\caver\Documents\GitHub\radiolog> python radiolog.py C:\Users\caver\Documents\GitHub\radiolog\radiolog.py:509: SyntaxWarning: invalid escape sequence '\d' firstNum=re.search("\d",name) C:\Users\caver\Documents\GitHub\radiolog\radiolog.py:553: SyntaxWarning: invalid escape sequence '\d' firstNum=re.search("\d",extTeamName) C:\Users\caver\Documents\GitHub\radiolog\radiolog.py:2363: SyntaxWarning: invalid escape sequence '\d' match=re.findall('\x02gI0-1\x03',line) C:\Users\caver\Documents\GitHub\radiolog\radiolog.py:3910: SyntaxWarning: invalid escape sequence '\d' if re.match("\d",key): C:\Users\caver\Documents\GitHub\radiolog\radiolog.py:7557: SyntaxWarning: invalid escape sequence '\D' if re.match(".\D.",cs): # if there are any characters that are not numbers C:\Users\caver\Documents\GitHub\radiolog\radiolog.py:509: SyntaxWarning: invalid escape sequence '\d' firstNum=re.search("\d",name) C:\Users\caver\Documents\GitHub\radiolog\radiolog.py:553: SyntaxWarning: invalid escape sequence '\d' firstNum=re.search("\d",extTeamName) C:\Users\caver\Documents\GitHub\radiolog\radiolog.py:2363: SyntaxWarning: invalid escape sequence '\d' match=re.findall('\x02gI0-1\x03',line) C:\Users\caver\Documents\GitHub\radiolog\radiolog.py:3910: SyntaxWarning: invalid escape sequence '\d' if re.match("\d",key): C:\Users\caver\Documents\GitHub\radiolog\radiolog.py:7557: SyntaxWarning: invalid escape sequence '\D' if re.match(".\D.",cs): # if there are any characters that are not numbers 145520:RadioLog 3.10.2 Working directory found at "C:\Users\caver\RadioLog". Initial session directory created at "C:\Users\caver\RadioLog\NewSession_2023_12_03_145520". 145520:RadioLog 3.10.2dev 145520:opening findDialog 145520:Operating system is Windows. 145520:PowerShell.exe is in the path. 145520:updating options dialog: datum=WGS84 145520:Incident name changed to "New Incident". 145520:Renamed session directory to "C:\Users\caver\RadioLog\New_Incident_2023_12_03_145520" 145520:useOperatorLogin after readConfigFile:True 145520:updating options dialog: datum=WGS84 145520:Incident name changed to "New Incident". 145523:Initial entry: Restored after crash: Sun Dec 03, 2023 145523:Renamed session directory to "C:\Users\caver\RadioLog\New_Incident_2023_12_03_145523" 145523:loadOperators called 145523:Loading operator data from file C:\Users\caver\RadioLog.config\radiolog_operators.json 145523: loaded these operators:['Grundy,Tom'] 145523:fsLoadLookup called: startupFlag=True fsFileName=None hideWarnings=False 145523:Loading FleetSync Lookup Table from file C:\Users\caver\RadioLog.config\radiolog_fleetsync.csv 145523:Writing file C:\Users\caver\RadioLog\New_Incident_2023_12_03_145523\radiolog_fleetsync.csv 145523:Restoring previous session after unclean shutdown: 145523:Loading: C:\Users\caver\RadioLog\New_Incident_2023_12_03_145307\New_Incident_2023_12_03_145307.csv 145523:loaded incident name: 'New Incident' 145523:normalized loaded incident name: 'New_Incident' 145523: t1 - done reading file 145523:newEntry called with these values: 145523:['1453', '', '', 'Radio Log Begins: Sun Dec 03, 2023', '', '', 1701643987.37199, '', '', '', ''] 145523:newEntry called with these values: 145523:['1453', 'FROM', 'Team 1', 'AT IC', '', 'At IC', 1701643990.3938544, '', '', '', '??'] 145523:new team: newTeamName=Team 1 extTeamName=z_Team00001 niceTeamName=Team 1 shortNiceTeamName=1 145523:extTeamNameList before sort:['dummy', 'z_Team00001'] Traceback (most recent call last): File "C:\Users\caver\Documents\GitHub\radiolog\radiolog.py", line 9888, in main() File "C:\Users\caver\Documents\GitHub\radiolog\radiolog.py", line 9881, in main w = MyWindow(app) ^^^^^^^^^^^^^ File "C:\Users\caver\Documents\GitHub\radiolog\radiolog.py", line 1319, in init self.restore() File "C:\Users\caver\Documents\GitHub\radiolog\radiolog.py", line 6000, in restore self.load(fileToLoad) # loads the radio log and the clue log ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\caver\Documents\GitHub\radiolog\radiolog.py", line 4397, in load self.newEntry(row) File "C:\Users\caver\Documents\GitHub\radiolog\radiolog.py", line 4757, in newEntry self.newEntryProcessTeam(niceTeamName,status,values[1],values[3],amend) File "C:\Users\caver\Documents\GitHub\radiolog\radiolog.py", line 4772, in newEntryProcessTeam self.newTeam(niceTeamName) File "C:\Users\caver\Documents\GitHub\radiolog\radiolog.py", line 4963, in newTeam prevGroupCount=self.nonEmptyTabGroupCount ^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'MyWindow' object has no attribute 'nonEmptyTabGroupCount'

Looks like the fix may be as simple as moving 'self.nonEmptyTabGroupCout=0' earlier in MainWindow.init, before restore()

caver456 commented 7 months ago

moved self.nonEmptyTabGroupCount=0 earlier in the code, before restore and before checkForContinuedIncident. This resolved the tracebacks above, but showed some other tracebacks:

Traceback (most recent call last): File "C:\Users\caver\Documents\GitHub\radiolog\radiolog.py", line 3756, in updateTeamTimers for new in self.newEntryWidget.instances: ^^^^^^^^^^^^^^^^^^^ AttributeError: 'MyWindow' object has no attribute 'newEntryWidget'. Did you mean: 'newEntryWindow'?

Looks like self. was added inadvertently - we want to check the class instances, not the instances of the current object. Removing self. (in two places) fixed it.

These tracebacks only show up on restore, because self.newEntryWidget is actually an object after the first call to openNewEntry which happens at the start of every non-restored session.