MorseKOB / PyKOB

Python implementation of a library for Morse and MorseKOB functionality
https://sites.google.com/site/morsekob/morsekob40
MIT License
4 stars 2 forks source link

MKOB Crash on Start-Up due to null KobMain object... #290

Closed AESilky closed 8 months ago

AESilky commented 8 months ago

Console output of crash:

PyKOB 1.2.18
MKOB 4.1.1
Tcl/Tk 8.6/8.6
2023-12-25 07:23:41 INFO:       Interface for key and/or sounder on serial port 'COM7' not available. Key and sounder will not function.
2023-12-25 07:23:41 INFO:       Record to 'Session-20231225-0723.json'
Traceback (most recent call last):
  File "C:\Users\Kevin\Downloads\PyKOB-master(1)\PyKOB-master\MKOB.pyw", line 47, in <module>
    mkobwindow = MKOBWindow(root, MKOB_VERSION_TEXT)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Kevin\Downloads\PyKOB-master(1)\PyKOB-master\mkobwindow.py", line 256, in __init__
    [self.km](http://self.km/) = MKOBMain(self.ka, self.ksl, self)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Kevin\Downloads\PyKOB-master(1)\PyKOB-master\mkobmain.py", line 87, in __init__
    self.__ka.doConnect() # Suggest a connect.
    ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Kevin\Downloads\PyKOB-master(1)\PyKOB-master\mkobactions.py", line 140, in doConnect
    if self.km.Recorder and not self.km.Recorder.playback_state == recorder.PlaybackState.idle:
       ^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'Recorder'

Reported via email by Kevin Jepson

AESilky commented 8 months ago

Fixed. The issue was due to the refactoring/reorganization of the MKOB modules into true classes. The problem was that all the MKOB classes were not completely initialized at the point that KOBMain attempted to connect if the 'auto-connect at start-up' option was enabled.