mbridak / not1mm

Not1MM != N1MM, An amateur radio contest logger for Linux.
GNU General Public License v3.0
103 stars 24 forks source link

Getting Traceback from a QRZ lookup. #210

Closed mbridak closed 4 hours ago

mbridak commented 4 hours ago

Not sure why yet. But it shouldn't be happening.

Traceback (most recent call last):
  File "/home/mbridak/Nextcloud/dev/not1mm/not1mm/__main__.py", line 3238, in callsign_changed
    self.lookup_service.msg_from_main(cmd)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^
  File "/home/mbridak/Nextcloud/dev/not1mm/not1mm/lookupservice.py", line 65, in msg_from_main
    result = self.look_up.lookup(call)
  File "/home/mbridak/Nextcloud/dev/not1mm/not1mm/lib/lookup.py", line 212, in lookup
    return root.get("Callsign")
           ^^^^
UnboundLocalError: cannot access local variable 'root' where it is not associated with a value
mbridak commented 4 hours ago
    def lookup(self, call: str) -> dict:
        """
        Lookup a call on QRZ
        """
        logger.info("%s", call)
        if self.session:
            ...
            # insert brilliant code here.
        return root.get("Callsign")

If there is no session root never gets defined.

mbridak commented 4 hours ago

fixed with PR #211