diff options
| author | Matthew Poletiek <matthew.poletiek@gmail.com> | 2020-12-10 22:19:17 -0600 |
|---|---|---|
| committer | Matthew Poletiek <matthew.poletiek@gmail.com> | 2020-12-10 22:19:17 -0600 |
| commit | cffa8faf99be5e752dcaa6c6572c1a2b26ae7664 (patch) | |
| tree | 488916303a1b9a04ad3e80770c8064a7f2047974 | |
| parent | 84179524b1cb6a00e0595229af2560aa0b3d5fec (diff) | |
| download | chirp-cffa8faf99be5e752dcaa6c6572c1a2b26ae7664.tar.gz chirp-cffa8faf99be5e752dcaa6c6572c1a2b26ae7664.tar.xz | |
driver syntax fixes
68 files changed, 81 insertions, 81 deletions
diff --git a/chirp/drivers/__pycache__/anytone.cpython-38.pyc b/chirp/drivers/__pycache__/anytone.cpython-38.pyc Binary files differnew file mode 100644 index 0000000..9db38e5 --- /dev/null +++ b/chirp/drivers/__pycache__/anytone.cpython-38.pyc diff --git a/chirp/drivers/__pycache__/anytone_ht.cpython-38.pyc b/chirp/drivers/__pycache__/anytone_ht.cpython-38.pyc Binary files differnew file mode 100644 index 0000000..377a8bf --- /dev/null +++ b/chirp/drivers/__pycache__/anytone_ht.cpython-38.pyc diff --git a/chirp/drivers/__pycache__/baofeng_uv3r.cpython-38.pyc b/chirp/drivers/__pycache__/baofeng_uv3r.cpython-38.pyc Binary files differnew file mode 100644 index 0000000..265966e --- /dev/null +++ b/chirp/drivers/__pycache__/baofeng_uv3r.cpython-38.pyc diff --git a/chirp/drivers/__pycache__/bf-t1.cpython-38.pyc b/chirp/drivers/__pycache__/bf-t1.cpython-38.pyc Binary files differnew file mode 100644 index 0000000..99281f9 --- /dev/null +++ b/chirp/drivers/__pycache__/bf-t1.cpython-38.pyc diff --git a/chirp/drivers/__pycache__/bjuv55.cpython-38.pyc b/chirp/drivers/__pycache__/bjuv55.cpython-38.pyc Binary files differnew file mode 100644 index 0000000..1971880 --- /dev/null +++ b/chirp/drivers/__pycache__/bjuv55.cpython-38.pyc diff --git a/chirp/drivers/__pycache__/fd268.cpython-38.pyc b/chirp/drivers/__pycache__/fd268.cpython-38.pyc Binary files differnew file mode 100644 index 0000000..b06b9ab --- /dev/null +++ b/chirp/drivers/__pycache__/fd268.cpython-38.pyc diff --git a/chirp/drivers/__pycache__/ft2800.cpython-38.pyc b/chirp/drivers/__pycache__/ft2800.cpython-38.pyc Binary files differnew file mode 100644 index 0000000..0789a2d --- /dev/null +++ b/chirp/drivers/__pycache__/ft2800.cpython-38.pyc diff --git a/chirp/drivers/__pycache__/ft450d.cpython-38.pyc b/chirp/drivers/__pycache__/ft450d.cpython-38.pyc Binary files differnew file mode 100644 index 0000000..56b25b1 --- /dev/null +++ b/chirp/drivers/__pycache__/ft450d.cpython-38.pyc diff --git a/chirp/drivers/__pycache__/ft50.cpython-38.pyc b/chirp/drivers/__pycache__/ft50.cpython-38.pyc Binary files differnew file mode 100644 index 0000000..be0c33d --- /dev/null +++ b/chirp/drivers/__pycache__/ft50.cpython-38.pyc diff --git a/chirp/drivers/__pycache__/ft70.cpython-38.pyc b/chirp/drivers/__pycache__/ft70.cpython-38.pyc Binary files differnew file mode 100644 index 0000000..72fb55a --- /dev/null +++ b/chirp/drivers/__pycache__/ft70.cpython-38.pyc diff --git a/chirp/drivers/__pycache__/ft7100.cpython-38.pyc b/chirp/drivers/__pycache__/ft7100.cpython-38.pyc Binary files differnew file mode 100644 index 0000000..21dd1bf --- /dev/null +++ b/chirp/drivers/__pycache__/ft7100.cpython-38.pyc diff --git a/chirp/drivers/__pycache__/ft8100.cpython-38.pyc b/chirp/drivers/__pycache__/ft8100.cpython-38.pyc Binary files differnew file mode 100644 index 0000000..fa4d380 --- /dev/null +++ b/chirp/drivers/__pycache__/ft8100.cpython-38.pyc diff --git a/chirp/drivers/__pycache__/ft90.cpython-38.pyc b/chirp/drivers/__pycache__/ft90.cpython-38.pyc Binary files differnew file mode 100644 index 0000000..4090f1e --- /dev/null +++ b/chirp/drivers/__pycache__/ft90.cpython-38.pyc diff --git a/chirp/drivers/__pycache__/ftm350.cpython-38.pyc b/chirp/drivers/__pycache__/ftm350.cpython-38.pyc Binary files differnew file mode 100644 index 0000000..783a72d --- /dev/null +++ b/chirp/drivers/__pycache__/ftm350.cpython-38.pyc diff --git a/chirp/drivers/__pycache__/kguv8e.cpython-38.pyc b/chirp/drivers/__pycache__/kguv8e.cpython-38.pyc Binary files differnew file mode 100644 index 0000000..704130f --- /dev/null +++ b/chirp/drivers/__pycache__/kguv8e.cpython-38.pyc diff --git a/chirp/drivers/__pycache__/kyd.cpython-38.pyc b/chirp/drivers/__pycache__/kyd.cpython-38.pyc Binary files differnew file mode 100644 index 0000000..1189716 --- /dev/null +++ b/chirp/drivers/__pycache__/kyd.cpython-38.pyc diff --git a/chirp/drivers/__pycache__/kyd_IP620.cpython-38.pyc b/chirp/drivers/__pycache__/kyd_IP620.cpython-38.pyc Binary files differnew file mode 100644 index 0000000..30f539c --- /dev/null +++ b/chirp/drivers/__pycache__/kyd_IP620.cpython-38.pyc diff --git a/chirp/drivers/__pycache__/leixen.cpython-38.pyc b/chirp/drivers/__pycache__/leixen.cpython-38.pyc Binary files differnew file mode 100644 index 0000000..830e426 --- /dev/null +++ b/chirp/drivers/__pycache__/leixen.cpython-38.pyc diff --git a/chirp/drivers/__pycache__/radioddity_r2.cpython-38.pyc b/chirp/drivers/__pycache__/radioddity_r2.cpython-38.pyc Binary files differnew file mode 100644 index 0000000..0a0015a --- /dev/null +++ b/chirp/drivers/__pycache__/radioddity_r2.cpython-38.pyc diff --git a/chirp/drivers/__pycache__/retevis_rt1.cpython-38.pyc b/chirp/drivers/__pycache__/retevis_rt1.cpython-38.pyc Binary files differnew file mode 100644 index 0000000..8e1d698 --- /dev/null +++ b/chirp/drivers/__pycache__/retevis_rt1.cpython-38.pyc diff --git a/chirp/drivers/__pycache__/retevis_rt21.cpython-38.pyc b/chirp/drivers/__pycache__/retevis_rt21.cpython-38.pyc Binary files differnew file mode 100644 index 0000000..80dfe60 --- /dev/null +++ b/chirp/drivers/__pycache__/retevis_rt21.cpython-38.pyc diff --git a/chirp/drivers/__pycache__/retevis_rt22.cpython-38.pyc b/chirp/drivers/__pycache__/retevis_rt22.cpython-38.pyc Binary files differnew file mode 100644 index 0000000..563c233 --- /dev/null +++ b/chirp/drivers/__pycache__/retevis_rt22.cpython-38.pyc diff --git a/chirp/drivers/__pycache__/retevis_rt26.cpython-38.pyc b/chirp/drivers/__pycache__/retevis_rt26.cpython-38.pyc Binary files differnew file mode 100644 index 0000000..b6b3ca9 --- /dev/null +++ b/chirp/drivers/__pycache__/retevis_rt26.cpython-38.pyc diff --git a/chirp/drivers/__pycache__/rfinder.cpython-38.pyc b/chirp/drivers/__pycache__/rfinder.cpython-38.pyc Binary files differnew file mode 100644 index 0000000..430603d --- /dev/null +++ b/chirp/drivers/__pycache__/rfinder.cpython-38.pyc diff --git a/chirp/drivers/__pycache__/th7800.cpython-38.pyc b/chirp/drivers/__pycache__/th7800.cpython-38.pyc Binary files differnew file mode 100644 index 0000000..b3033a9 --- /dev/null +++ b/chirp/drivers/__pycache__/th7800.cpython-38.pyc diff --git a/chirp/drivers/__pycache__/th9000.cpython-38.pyc b/chirp/drivers/__pycache__/th9000.cpython-38.pyc Binary files differnew file mode 100644 index 0000000..bc68981 --- /dev/null +++ b/chirp/drivers/__pycache__/th9000.cpython-38.pyc diff --git a/chirp/drivers/__pycache__/th9800.cpython-38.pyc b/chirp/drivers/__pycache__/th9800.cpython-38.pyc Binary files differnew file mode 100644 index 0000000..f7585a2 --- /dev/null +++ b/chirp/drivers/__pycache__/th9800.cpython-38.pyc diff --git a/chirp/drivers/__pycache__/th_uv8000.cpython-38.pyc b/chirp/drivers/__pycache__/th_uv8000.cpython-38.pyc Binary files differnew file mode 100644 index 0000000..3f7470e --- /dev/null +++ b/chirp/drivers/__pycache__/th_uv8000.cpython-38.pyc diff --git a/chirp/drivers/__pycache__/thd72.cpython-38.pyc b/chirp/drivers/__pycache__/thd72.cpython-38.pyc Binary files differnew file mode 100644 index 0000000..9de3386 --- /dev/null +++ b/chirp/drivers/__pycache__/thd72.cpython-38.pyc diff --git a/chirp/drivers/__pycache__/thuv1f.cpython-38.pyc b/chirp/drivers/__pycache__/thuv1f.cpython-38.pyc Binary files differnew file mode 100644 index 0000000..75e9a41 --- /dev/null +++ b/chirp/drivers/__pycache__/thuv1f.cpython-38.pyc diff --git a/chirp/drivers/__pycache__/ts2000.cpython-38.pyc b/chirp/drivers/__pycache__/ts2000.cpython-38.pyc Binary files differnew file mode 100644 index 0000000..d226bbb --- /dev/null +++ b/chirp/drivers/__pycache__/ts2000.cpython-38.pyc diff --git a/chirp/drivers/__pycache__/ts480.cpython-38.pyc b/chirp/drivers/__pycache__/ts480.cpython-38.pyc Binary files differnew file mode 100644 index 0000000..fe7d47a --- /dev/null +++ b/chirp/drivers/__pycache__/ts480.cpython-38.pyc diff --git a/chirp/drivers/__pycache__/ts590.cpython-38.pyc b/chirp/drivers/__pycache__/ts590.cpython-38.pyc Binary files differnew file mode 100644 index 0000000..ed63772 --- /dev/null +++ b/chirp/drivers/__pycache__/ts590.cpython-38.pyc diff --git a/chirp/drivers/__pycache__/vgc.cpython-38.pyc b/chirp/drivers/__pycache__/vgc.cpython-38.pyc Binary files differnew file mode 100644 index 0000000..df4f798 --- /dev/null +++ b/chirp/drivers/__pycache__/vgc.cpython-38.pyc diff --git a/chirp/drivers/anytone.py b/chirp/drivers/anytone.py index e99a25d..7010750 100644 --- a/chirp/drivers/anytone.py +++ b/chirp/drivers/anytone.py @@ -177,7 +177,7 @@ def _echo_write(radio, data): try: radio.pipe.write(data) radio.pipe.read(len(data)) - except Exception, e: + except (Exception, e): LOG.error("Error writing to radio: %s" % e) raise errors.RadioError("Unable to write to radio") @@ -185,7 +185,7 @@ def _echo_write(radio, data): def _read(radio, length): try: data = radio.pipe.read(length) - except Exception, e: + except (Exception, e): LOG.error("Error reading from radio: %s" % e) raise errors.RadioError("Unable to read from radio") diff --git a/chirp/drivers/anytone_ht.py b/chirp/drivers/anytone_ht.py index faa9bb8..8bd9dec 100644 --- a/chirp/drivers/anytone_ht.py +++ b/chirp/drivers/anytone_ht.py @@ -233,7 +233,7 @@ struct memory memory[200]; def _echo_write(radio, data): try: radio.pipe.write(data) - except Exception, e: + except (Exception, e): LOG.error("Error writing to radio: %s" % e) raise errors.RadioError("Unable to write to radio") @@ -241,7 +241,7 @@ def _echo_write(radio, data): def _read(radio, length): try: data = radio.pipe.read(length) - except Exception, e: + except (Exception, e): LOG.error("Error reading from radio: %s" % e) raise errors.RadioError("Unable to read from radio") @@ -930,7 +930,7 @@ class AnyToneTERMN8RRadio(chirp_common.CloneModeRadio, else: LOG.debug("Setting %s = %s" % (setting, element.value)) setattr(obj, setting, element.value) - except Exception, e: + except (Exception, e): LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/baofeng_uv3r.py b/chirp/drivers/baofeng_uv3r.py index a68bc60..b1176e8 100644 --- a/chirp/drivers/baofeng_uv3r.py +++ b/chirp/drivers/baofeng_uv3r.py @@ -51,7 +51,7 @@ def uv3r_prep(radio): for _i in range(0, 10): try: return _uv3r_prep(radio) - except errors.RadioError, e: + except (errors.RadioError, e): time.sleep(1) raise e @@ -64,7 +64,7 @@ def uv3r_download(radio): return do_download(radio, 0x0000, 0x0E40, 0x0010) except errors.RadioError: raise - except Exception, e: + except (Exception, e): raise errors.RadioError("Failed to communicate with radio: %s" % e) @@ -75,7 +75,7 @@ def uv3r_upload(radio): return do_upload(radio, 0x0000, 0x0E40, 0x0010) except errors.RadioError: raise - except Exception, e: + except (Exception, e): raise errors.RadioError("Failed to communicate with radio: %s" % e) @@ -623,7 +623,7 @@ class UV3RRadio(chirp_common.CloneModeRadio): else: LOG.debug("Setting %s = %s" % (setting, element.value)) setattr(obj, setting, element.value) - except Exception, e: + except (Exception, e): LOG.debug(element.get_name()) raise @@ -639,7 +639,7 @@ class UV3RRadio(chirp_common.CloneModeRadio): LOG.debug("Setting fm_presets[%1i] = %s" % (index, value)) setting = self._memobj.fm_presets setting[index] = value - except Exception, e: + except (Exception, e): LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/bf-t1.py b/chirp/drivers/bf-t1.py index c5b4e04..fdbf81c 100644 --- a/chirp/drivers/bf-t1.py +++ b/chirp/drivers/bf-t1.py @@ -225,7 +225,7 @@ def _start_clone_mode(radio, status): except errors.RadioError: raise - except Exception, e: + except (Exception, e): raise errors.RadioError("Error sending Magic to radio:\n%s" % e) @@ -561,7 +561,7 @@ class BFT1(chirp_common.CloneModeRadio, chirp_common.ExperimentalRadio): _upload(self) except errors.RadioError: raise - except Exception, e: + except (Exception, e): raise errors.RadioError("Error: %s" % e) def _decode_tone(self, val, inv): @@ -894,7 +894,7 @@ class BFT1(chirp_common.CloneModeRadio, chirp_common.ExperimentalRadio): setattr(_settings, name, value) LOG.debug("Setting %s: %s" % (name, value)) - except Exception, e: + except (Exception, e): LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/bjuv55.py b/chirp/drivers/bjuv55.py index 36cb98e..225e3cd 100644 --- a/chirp/drivers/bjuv55.py +++ b/chirp/drivers/bjuv55.py @@ -647,6 +647,6 @@ class BaojieBJUV55Radio(uv5r.BaofengUV5R): value = int(val.get_value() * 10 - 870) LOG.debug("Setting fm_preset = %s" % (value)) self._memobj.fm_preset = value - except Exception, e: + except (Exception, e): LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/fd268.py b/chirp/drivers/fd268.py index 8d9128b..fc54539 100644 --- a/chirp/drivers/fd268.py +++ b/chirp/drivers/fd268.py @@ -790,11 +790,11 @@ class FeidaxinFD2x8yRadio(chirp_common.CloneModeRadio): obj = getattr(_mem, sett) setattr(obj, name, element.value) - except AttributeError, e: + except (AttributeError, e): m = "Setting %s is not in this setting block" % name LOG.debug(m) - except Exception, e: + except (Exception, e): LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/ft2800.py b/chirp/drivers/ft2800.py index 9030e96..fa35145 100644 --- a/chirp/drivers/ft2800.py +++ b/chirp/drivers/ft2800.py @@ -201,7 +201,7 @@ class FT2800Radio(YaesuCloneModeRadio): self._mmap = _download(self) except errors.RadioError: raise - except Exception, e: + except (Exception, e): raise errors.RadioError("Failed to communicate with radio: %s" % e) LOG.info("Downloaded in %.2f sec" % (time.time() - start)) self.process_mmap() @@ -214,7 +214,7 @@ class FT2800Radio(YaesuCloneModeRadio): _upload(self) except errors.RadioError: raise - except Exception, e: + except (Exception, e): raise errors.RadioError("Failed to communicate with radio: %s" % e) LOG.info("Uploaded in %.2f sec" % (time.time() - start)) diff --git a/chirp/drivers/ft450d.py b/chirp/drivers/ft450d.py index 6664f77..319feb1 100644 --- a/chirp/drivers/ft450d.py +++ b/chirp/drivers/ft450d.py @@ -499,7 +499,7 @@ class FT450DRadio(yaesu_clone.YaesuCloneModeRadio): self._mmap = self._clone_in()
except errors.RadioError:
raise
- except Exception, e:
+ except (Exception, e):
raise errors.RadioError("Failed to communicate with radio: %s"
% e)
self.process_mmap()
@@ -509,7 +509,7 @@ class FT450DRadio(yaesu_clone.YaesuCloneModeRadio): self._clone_out()
except errors.RadioError:
raise
- except Exception, e:
+ except (Exception, e):
raise errors.RadioError("Failed to communicate with radio: %s"
% e)
@@ -1489,6 +1489,6 @@ class FT450DRadio(yaesu_clone.YaesuCloneModeRadio): elif element.value.get_mutable():
LOG.debug("Setting %s = %s" % (setting, element.value))
setattr(obj, setting, element.value)
- except Exception, e:
+ except (Exception, e):
LOG.debug(element.get_name())
raise
diff --git a/chirp/drivers/ft50.py b/chirp/drivers/ft50.py index 9f28110..f083a09 100644 --- a/chirp/drivers/ft50.py +++ b/chirp/drivers/ft50.py @@ -586,7 +586,7 @@ class FT50Radio(yaesu_clone.YaesuCloneModeRadio): def _clone_out(radio): try: return __clone_out(radio) - except Exception, e: + except (Exception, e): raise errors.RadioError("Failed to communicate with the radio: %s" % e) diff --git a/chirp/drivers/ft70.py b/chirp/drivers/ft70.py index 20d1000..08e4c17 100644 --- a/chirp/drivers/ft70.py +++ b/chirp/drivers/ft70.py @@ -1162,7 +1162,7 @@ class FT70Radio(yaesu_clone.YaesuCloneModeRadio): except AttributeError as e:
LOG.error("Setting %s is not in the memory map: %s" %
(element.get_name(), e))
- except Exception, e:
+ except (Exception, e):
LOG.debug(element.get_name())
raise
diff --git a/chirp/drivers/ft7100.py b/chirp/drivers/ft7100.py index ca51367..700be65 100644 --- a/chirp/drivers/ft7100.py +++ b/chirp/drivers/ft7100.py @@ -568,7 +568,7 @@ class FT7100Radio(YaesuCloneModeRadio): self._mmap = _download(self) except errors.RadioError: raise - except Exception, e: + except (Exception, e): raise errors.RadioError("Failed to communicate with radio: %s" % e) LOG.info("Downloaded in %.2f sec", (time.time() - start)) self.process_mmap() @@ -580,7 +580,7 @@ class FT7100Radio(YaesuCloneModeRadio): _upload(self) except errors.RadioError: raise - except Exception, e: + except (Exception, e): raise errors.RadioError("Failed to communicate with radio: %s" % e) LOG.info("Uploaded in %.2f sec", (time.time() - start)) @@ -1091,7 +1091,7 @@ class FT7100Radio(YaesuCloneModeRadio): setattr(_overlay, name, value) LOG.debug("Setting %s: %s", name, value) - except Exception, e: + except (Exception, e): LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/ft8100.py b/chirp/drivers/ft8100.py index 1d238c3..74d3f25 100644 --- a/chirp/drivers/ft8100.py +++ b/chirp/drivers/ft8100.py @@ -175,7 +175,7 @@ class FT8100Radio(yaesu_clone.YaesuCloneModeRadio): if _mem.duplex == DUPLEX.index("split"): tx_freq = int(_mem.offset) * 1000 - print self.VARIANT, number, tx_freq, mem.freq + print (self.VARIANT, number, tx_freq, mem.freq) mem.offset = tx_freq - mem.freq else: mem.offset = int(_mem.offset) * 1000 @@ -189,7 +189,7 @@ class FT8100Radio(yaesu_clone.YaesuCloneModeRadio): if not self._memobj.enables[byte] & bit and number != 1: mem.empty = True - print 'R', self.VARIANT, number, _mem.baud9600 + print ('R', self.VARIANT, number, _mem.baud9600) return mem @@ -270,7 +270,7 @@ class FT8100RadioUHF(FT8100Radio): def _clone_out(radio): try: return __clone_out(radio) - except Exception, e: + except (Exception, e): raise errors.RadioError("Failed to communicate with the radio: %s" % e) @@ -291,7 +291,7 @@ def __clone_out(radio): pos = 0 for block in radio._block_lengths: if os.getenv("CHIRP_DEBUG"): - print "\nSending %i-%i" % (pos, pos + block) + print ("\nSending %i-%i" % (pos, pos + block)) out = radio.get_mmap()[pos:pos + block] # need to chew byte-by-byte here or else we lose the ACK...not sure why @@ -309,6 +309,6 @@ def __clone_out(radio): pos += block - print "Clone completed in %i seconds" % (time.time() - start) + print ("Clone completed in %i seconds" % (time.time() - start)) return True diff --git a/chirp/drivers/ft90.py b/chirp/drivers/ft90.py index cc22a14..5bd413a 100644 --- a/chirp/drivers/ft90.py +++ b/chirp/drivers/ft90.py @@ -332,7 +332,7 @@ struct { self._mmap = self._clone_in() except errors.RadioError: raise - except Exception, e: + except (Exception, e): trace = traceback.format_exc() raise errors.RadioError( "Failed to communicate with radio: %s" % trace) @@ -343,7 +343,7 @@ struct { self._clone_out() except errors.RadioError: raise - except Exception, e: + except (Exception, e): trace = traceback.format_exc() raise errors.RadioError( "Failed to communicate with radio: %s" % trace) @@ -670,6 +670,6 @@ struct { newval = self._dtmf2bbcd(newval) LOG.debug("Setting %s(%s) <= %s" % (setting, oldval, newval)) setattr(_settings, setting, newval) - except Exception, e: + except (Exception, e): LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/ftm350.py b/chirp/drivers/ftm350.py index ea5bc2f..f277bb3 100644 --- a/chirp/drivers/ftm350.py +++ b/chirp/drivers/ftm350.py @@ -278,7 +278,7 @@ class FTM350Radio(yaesu_clone.YaesuCloneModeRadio): self._mmap = _clone_in(self) except errors.RadioError: raise - except Exception, e: + except (Exception, e): raise errors.RadioError("Failed to download from radio (%s)" % e) self.process_mmap() @@ -287,7 +287,7 @@ class FTM350Radio(yaesu_clone.YaesuCloneModeRadio): _clone_out(self) except errors.RadioError: raise - except Exception, e: + except (Exception, e): raise errors.RadioError("Failed to upload to radio (%s)" % e) def process_mmap(self): diff --git a/chirp/drivers/kguv8e.py b/chirp/drivers/kguv8e.py index b76f0e5..18a1293 100644 --- a/chirp/drivers/kguv8e.py +++ b/chirp/drivers/kguv8e.py @@ -337,7 +337,7 @@ class KGUV8ERadio(chirp_common.CloneModeRadio, try: self.pipe.write(_header) - except Exception, e: + except (Exception, e): raise errors.RadioError("Failed to communicate with radio: %s" % e) def _read_record(self): @@ -423,7 +423,7 @@ class KGUV8ERadio(chirp_common.CloneModeRadio, self._mmap = self._download() except errors.RadioError: raise - except Exception, e: + except (Exception, e): raise errors.RadioError("Failed to communicate with radio: %s" % e) self.process_mmap() @@ -440,7 +440,7 @@ class KGUV8ERadio(chirp_common.CloneModeRadio, return self._do_download(0, 32768, 64) except errors.RadioError: raise - except Exception, e: + except (Exception, e): LOG.exception('Unknown error during download process') raise errors.RadioError("Failed to communicate with radio: %s" % e) @@ -472,7 +472,7 @@ class KGUV8ERadio(chirp_common.CloneModeRadio, self._do_upload(0, 32768, 64) except errors.RadioError: raise - except Exception, e: + except (Exception, e): raise errors.RadioError("Failed to communicate with radio: %s" % e) return @@ -1138,7 +1138,7 @@ class KGUV8ERadio(chirp_common.CloneModeRadio, setattr(obj, setting, int(element.value)/10) else: setattr(obj, setting, element.value) - except Exception, e: + except (Exception, e): LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/kyd.py b/chirp/drivers/kyd.py index 27ebc74..f559e74 100644 --- a/chirp/drivers/kyd.py +++ b/chirp/drivers/kyd.py @@ -500,7 +500,7 @@ class NC630aRadio(chirp_common.CloneModeRadio): LOG.debug("Setting %s = %s" % (setting, element.value)) setattr(obj, setting, element.value) - except Exception, e: + except (Exception, e): LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/kyd_IP620.py b/chirp/drivers/kyd_IP620.py index 47507b8..dcdc23e 100644 --- a/chirp/drivers/kyd_IP620.py +++ b/chirp/drivers/kyd_IP620.py @@ -181,7 +181,7 @@ class IP620Radio(chirp_common.CloneModeRadio, self.pipe.write("\x06") except errors.RadioError: raise - except Exception, e: + except (Exception, e): raise errors.RadioError("Radio refused to exit programming mode: %s" % e) def _ip620_enter_programming_mode(self): @@ -192,7 +192,7 @@ class IP620Radio(chirp_common.CloneModeRadio, _ack = self.pipe.read(1) except errors.RadioError: raise - except Exception, e: + except (Exception, e): raise errors.RadioError("Error communicating with radio: %s" % e) if not _ack: raise errors.RadioError("No response from radio") @@ -203,17 +203,17 @@ class IP620Radio(chirp_common.CloneModeRadio, _ident = self.pipe.read(8) except errors.RadioError: raise - except Exception, e: + except (Exception, e): raise errors.RadioError("Error communicating with radio: %s" % e) if not _ident.startswith("\x06\x4B\x47\x36\x37\x01\x56\xF8"): - print util.hexprint(_ident) + print (util.hexprint(_ident)) raise errors.RadioError("Radio returned unknown identification string") try: self.pipe.write(CMD_ACK) _ack = self.pipe.read(1) except errors.RadioError: raise - except Exception, e: + except (Exception, e): raise errors.RadioError("Error communicating with radio: %s" % e) if _ack != CMD_ACK: raise errors.RadioError("Radio refused to enter programming mode") @@ -316,7 +316,7 @@ class IP620Radio(chirp_common.CloneModeRadio, self._mmap = self._do_download() except errors.RadioError: raise - except Exception, e: + except (Exception, e): raise errors.RadioError("Failed to communicate with radio: %s" % e) self.process_mmap() @@ -597,7 +597,7 @@ class IP620Radio(chirp_common.CloneModeRadio, setattr(self._memobj.settings_misc, element.get_name(), element.value) - except Exception, e: + except (Exception, e): LOG.debug(element.get_name()) raise @@ -624,6 +624,6 @@ class IP620Radio(chirp_common.CloneModeRadio, setattr(_settings_misc, setting, newval) else: setattr(_settings, setting, newval) - except Exception, e: + except (Exception, e): LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/leixen.py b/chirp/drivers/leixen.py index d96c5d0..e401e1a 100644 --- a/chirp/drivers/leixen.py +++ b/chirp/drivers/leixen.py @@ -261,7 +261,7 @@ def send(radio, frame): # util.hexprint(frame).replace("\n", "\n "))) try: radio.pipe.write(frame) - except Exception, e: + except (Exception, e): raise errors.RadioError("Failed to communicate with radio: %s" % e) @@ -427,7 +427,7 @@ class LeixenVV898Radio(chirp_common.CloneModeRadio): def sync_in(self): try: self._mmap = do_download(self) - except Exception, e: + except (Exception, e): finish(self) raise errors.RadioError("Failed to download from radio: %s" % e) self.process_mmap() @@ -442,7 +442,7 @@ class LeixenVV898Radio(chirp_common.CloneModeRadio): except errors.RadioError: finish(self) raise - except Exception, e: + except (Exception, e): raise errors.RadioError("Failed to upload to radio: %s" % e) def get_raw_memory(self, number): @@ -941,7 +941,7 @@ class LeixenVV898Radio(chirp_common.CloneModeRadio): else: LOG.debug("Setting %s = %s" % (setting, element.value)) setattr(obj, setting, element.value) - except Exception, e: + except (Exception, e): LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/radioddity_r2.py b/chirp/drivers/radioddity_r2.py index ca2a13e..b3bf1b6 100644 --- a/chirp/drivers/radioddity_r2.py +++ b/chirp/drivers/radioddity_r2.py @@ -611,7 +611,7 @@ class RadioddityR2Radio(chirp_common.CloneModeRadio): LOG.debug("Setting %s = %s" % (setting, element.value)) setattr(obj, setting, element.value) - except Exception, e: + except (Exception, e): LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/retevis_rt1.py b/chirp/drivers/retevis_rt1.py index 96baa13..324e265 100644 --- a/chirp/drivers/retevis_rt1.py +++ b/chirp/drivers/retevis_rt1.py @@ -726,7 +726,7 @@ class RT1Radio(chirp_common.CloneModeRadio): elif element.value.get_mutable(): LOG.debug("Setting %s = %s" % (setting, element.value)) setattr(obj, setting, element.value) - except Exception, e: + except (Exception, e): LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/retevis_rt21.py b/chirp/drivers/retevis_rt21.py index 856b33e..f2dda87 100644 --- a/chirp/drivers/retevis_rt21.py +++ b/chirp/drivers/retevis_rt21.py @@ -561,7 +561,7 @@ class RT21Radio(chirp_common.CloneModeRadio): elif element.value.get_mutable(): LOG.debug("Setting %s = %s" % (setting, element.value)) setattr(obj, setting, element.value) - except Exception, e: + except (Exception, e): LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/retevis_rt22.py b/chirp/drivers/retevis_rt22.py index 9edb9c4..ad755d7 100644 --- a/chirp/drivers/retevis_rt22.py +++ b/chirp/drivers/retevis_rt22.py @@ -605,7 +605,7 @@ class RT22Radio(chirp_common.CloneModeRadio): LOG.debug("Setting %s = %s" % (setting, element.value)) setattr(obj, setting, element.value) - except Exception, e: + except (Exception, e): LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/retevis_rt26.py b/chirp/drivers/retevis_rt26.py index 3840575..f99fee3 100644 --- a/chirp/drivers/retevis_rt26.py +++ b/chirp/drivers/retevis_rt26.py @@ -897,7 +897,7 @@ class RT26Radio(chirp_common.CloneModeRadio): elif element.value.get_mutable(): LOG.debug("Setting %s = %s" % (setting, element.value)) setattr(obj, setting, element.value) - except Exception, e: + except (Exception, e): LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/rfinder.py b/chirp/drivers/rfinder.py index b0a77bd..09a11d9 100644 --- a/chirp/drivers/rfinder.py +++ b/chirp/drivers/rfinder.py @@ -287,7 +287,7 @@ class RFinderRadio(chirp_common.NetworkSourceRadio): self._rfp = None - def set_params(self, (lat, lon), miles, email, password): + def set_params(self, lat, lon, miles, email, password): """Sets the parameters to use for the query""" self._lat = lat self._lon = lon diff --git a/chirp/drivers/th7800.py b/chirp/drivers/th7800.py index 231030f..6257b2b 100644 --- a/chirp/drivers/th7800.py +++ b/chirp/drivers/th7800.py @@ -536,7 +536,7 @@ class TYTTH7800Base(chirp_common.Radio): LOG.debug("Setting %s(%s) <= %s" % (setting, oldval, newval)) setattr(_settings, setting, newval) - except Exception, e: + except (Exception, e): LOG.debug(element.get_name()) raise @@ -726,7 +726,7 @@ class TYTTH7800Radio(TYTTH7800Base, chirp_common.CloneModeRadio, def sync_in(self): try: self._mmap = _download(self) - except Exception, e: + except (Exception, e): raise errors.RadioError( "Failed to communicate with the radio: %s" % e) self.process_mmap() @@ -734,6 +734,6 @@ class TYTTH7800Radio(TYTTH7800Base, chirp_common.CloneModeRadio, def sync_out(self): try: _upload(self) - except Exception, e: + except (Exception, e): raise errors.RadioError( "Failed to communicate with the radio: %s" % e) diff --git a/chirp/drivers/th9000.py b/chirp/drivers/th9000.py index ad2d7eb..e73e6df 100644 --- a/chirp/drivers/th9000.py +++ b/chirp/drivers/th9000.py @@ -352,7 +352,7 @@ def _echo_write(radio, data): try: radio.pipe.write(data) radio.pipe.read(len(data)) - except Exception, e: + except (Exception, e): LOG.error("Error writing to radio: %s" % e) raise errors.RadioError("Unable to write to radio") @@ -366,7 +366,7 @@ def _checksum(data): def _read(radio, length): try: data = radio.pipe.read(length) - except Exception, e: + except (Exception, e): LOG.error( "Error reading from radio: %s" % e) raise errors.RadioError("Unable to read from radio") @@ -793,7 +793,7 @@ class Th9000Radio(chirp_common.CloneModeRadio, else: LOG.debug( "Setting %s = %s" % (setting, element.value)) setattr(obj, setting, element.value) - except Exception, e: + except (Exception, e): LOG.debug( element.get_name()) raise diff --git a/chirp/drivers/th9800.py b/chirp/drivers/th9800.py index 2dba301..628dc09 100644 --- a/chirp/drivers/th9800.py +++ b/chirp/drivers/th9800.py @@ -598,7 +598,7 @@ class TYTTH9800Base(chirp_common.Radio): LOG.debug("Setting %s(%s) <= %s" % (setting, oldval, newval)) setattr(_settings, setting, newval) - except Exception, e: + except (Exception, e): LOG.debug(element.get_name()) raise @@ -785,7 +785,7 @@ class TYTTH9800Radio(TYTTH9800Base, chirp_common.CloneModeRadio, def sync_in(self): try: self._mmap = _download(self) - except Exception, e: + except (Exception, e): raise errors.RadioError( "Failed to communicate with the radio: %s" % e) self.process_mmap() @@ -793,6 +793,6 @@ class TYTTH9800Radio(TYTTH9800Base, chirp_common.CloneModeRadio, def sync_out(self): try: _upload(self) - except Exception, e: + except (Exception, e): raise errors.RadioError( "Failed to communicate with the radio: %s" % e) diff --git a/chirp/drivers/th_uv8000.py b/chirp/drivers/th_uv8000.py index 3897d54..6c60e0e 100644 --- a/chirp/drivers/th_uv8000.py +++ b/chirp/drivers/th_uv8000.py @@ -1486,6 +1486,6 @@ class THUV8000Radio(chirp_common.CloneModeRadio): elif element.value.get_mutable(): LOG.debug("Setting %s = %s" % (setting, element.value)) setattr(obj, setting, element.value) - except Exception, e: + except (Exception, e): LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/thd72.py b/chirp/drivers/thd72.py index 59984e8..9e2491e 100644 --- a/chirp/drivers/thd72.py +++ b/chirp/drivers/thd72.py @@ -581,7 +581,7 @@ class THD72Radio(chirp_common.CloneModeRadio): except AttributeError as e: LOG.error("Setting %s is not in the memory map: %s" % (element.get_name(), e)) - except Exception, e: + except (Exception, e): LOG.debug(element.get_name()) raise @@ -738,9 +738,9 @@ if __name__ == "__main__": return r def usage(): - print "Usage: %s <-i input.img>|<-o output.img> -p port " \ + print ("Usage: %s <-i input.img>|<-o output.img> -p port " \ "[[-f first-addr] [-l last-addr] | [-b list,of,blocks]]" % \ - sys.argv[0] + sys.argv[0]) sys.exit(1) opts, args = getopt.getopt(sys.argv[1:], "i:o:p:f:l:b:") @@ -793,4 +793,4 @@ if __name__ == "__main__": else: r._mmap = file(fname, "rb").read(r._memsize) r.upload(blocks) - print "\nDone" + print ("\nDone") diff --git a/chirp/drivers/thuv1f.py b/chirp/drivers/thuv1f.py index c39f17a..af7181a 100644 --- a/chirp/drivers/thuv1f.py +++ b/chirp/drivers/thuv1f.py @@ -214,7 +214,7 @@ class TYTTHUVF1Radio(chirp_common.CloneModeRadio): self._mmap = uvf1_download(self) except errors.RadioError: raise - except Exception, e: + except (Exception, e): raise errors.RadioError("Failed to communicate with radio: %s" % e) self.process_mmap() @@ -223,7 +223,7 @@ class TYTTHUVF1Radio(chirp_common.CloneModeRadio): uvf1_upload(self) except errors.RadioError: raise - except Exception, e: + except (Exception, e): raise errors.RadioError("Failed to communicate with radio: %s" % e) @classmethod diff --git a/chirp/drivers/ts2000.py b/chirp/drivers/ts2000.py index f2160ad..c842a5f 100644 --- a/chirp/drivers/ts2000.py +++ b/chirp/drivers/ts2000.py @@ -217,7 +217,7 @@ class TS2000Radio(KenwoodLiveRadio): duplex = 0 offset = 0 else: - print "Bug: unsupported duplex `%s'" % mem.duplex + print ("Bug: unsupported duplex `%s'" % mem.duplex) if mem.mode in ["AM", "FM"]: step = TS2000_FM_STEPS.index(mem.tuning_step) else: @@ -259,7 +259,7 @@ class TS2000Radio(KenwoodLiveRadio): elif mem.duplex == "split": duplex = 0 else: - print "Bug: unsupported duplex `%s'" % mem.duplex + print ("Bug: unsupported duplex `%s'" % mem.duplex) if mem.mode in ["AM", "FM"]: step = TS2000_FM_STEPS.index(mem.tuning_step) else: diff --git a/chirp/drivers/ts480.py b/chirp/drivers/ts480.py index 47b1757..4f34006 100644 --- a/chirp/drivers/ts480.py +++ b/chirp/drivers/ts480.py @@ -1138,7 +1138,7 @@ class TS480Radio(chirp_common.CloneModeRadio): elif element.value.get_mutable(): LOG.debug("Setting %s = %s" % (setting, element.value)) setattr(obj, setting, element.value) - except Exception, e: + except (Exception, e): LOG.debug(element.get_name()) raise return diff --git a/chirp/drivers/ts590.py b/chirp/drivers/ts590.py index 497aac3..edbc71d 100644 --- a/chirp/drivers/ts590.py +++ b/chirp/drivers/ts590.py @@ -1644,7 +1644,7 @@ class TS590Radio(chirp_common.CloneModeRadio): elif element.value.get_mutable(): LOG.debug("Setting %s = %s" % (setting, element.value)) setattr(obj, setting, element.value) - except Exception, e: + except (Exception, e): LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/vgc.py b/chirp/drivers/vgc.py index f5da899..6574bd1 100644 --- a/chirp/drivers/vgc.py +++ b/chirp/drivers/vgc.py @@ -1410,7 +1410,7 @@ class VGCStyleRadio(chirp_common.CloneModeRadio, elif element.value.get_mutable(): LOG.debug("Setting %s = %s" % (setting, element.value)) setattr(obj, setting, element.value) - except Exception, e: + except (Exception, e): LOG.debug(element.get_name()) raise |
