From b1aa941d2665163f7f7f782794cd59a0e16af269 Mon Sep 17 00:00:00 2001 From: Daniele Forsi Date: Sun, 4 Jun 2023 14:45:00 +0200 Subject: [PATCH 01/13] Ignore false positive "F821 undefined name '_'" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The function _() is installed in Python’s builtins namespace by chirp/wxui/__init__.py --- tox.ini | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tox.ini b/tox.ini index 936a92058..2ecedbfe7 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,10 @@ [tox] envlist = style,unit,driver +[flake8] +builtins = + _, + [testenv] basepython = python3 sitepackages = True From 34131e8bb4eb6769853cb921e3ca0a5b9936d797 Mon Sep 17 00:00:00 2001 From: Daniele Forsi Date: Sun, 4 Jun 2023 15:20:43 +0200 Subject: [PATCH 02/13] Fix undefined names Fixes: ./chirp/drivers/lt725uv.py:269:9: F821 undefined name 'Log' ./chirp/drivers/vgc.py:354:9: F821 undefined name 'Log' ./chirp/drivers/ap510.py:407:19: F821 undefined name 'file' ./chirp/drivers/btech.py:811:62: F821 undefined name 'value' ./chirp/drivers/ic2730.py:1309:29: F821 undefined name 'sstx' ./chirp/drivers/thd72.py:839:9: F821 undefined name 'file' ./chirp/drivers/thd72.py:841:19: F821 undefined name 'file' ./chirp/drivers/tk760.py:229:19: F821 undefined name 'hexprint' ./chirp/drivers/retevis_rt98.py:591:17: F821 undefined name 'radio' --- chirp/drivers/ap510.py | 2 +- chirp/drivers/btech.py | 2 +- chirp/drivers/ic2730.py | 2 +- chirp/drivers/lt725uv.py | 2 +- chirp/drivers/retevis_rt98.py | 2 +- chirp/drivers/thd72.py | 4 ++-- chirp/drivers/tk760.py | 2 +- chirp/drivers/vgc.py | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/chirp/drivers/ap510.py b/chirp/drivers/ap510.py index f9cf1f777..c9ff8e083 100644 --- a/chirp/drivers/ap510.py +++ b/chirp/drivers/ap510.py @@ -404,7 +404,7 @@ def sync_out(self): def load_mmap(self, filename): """Load the radio's memory map from @filename""" - mapfile = file(filename, "rb") + mapfile = open(filename, "rb") data = mapfile.read() if data.startswith('\r\n00=%s 20141215' % self._model): self._mmap = AP510Memory20141215(data) diff --git a/chirp/drivers/btech.py b/chirp/drivers/btech.py index 0ee87c9a9..aaadbffd5 100644 --- a/chirp/drivers/btech.py +++ b/chirp/drivers/btech.py @@ -808,7 +808,7 @@ def _encode_tone(self, memval, mode, val, pol): index += 0x6A memval.set_value(index) except: - msg = "Digital Tone '%d' is not supported" % value + msg = "Digital Tone '%d' is not supported" % val LOG.error(msg) raise errors.RadioError(msg) else: diff --git a/chirp/drivers/ic2730.py b/chirp/drivers/ic2730.py index e29aa2ed5..24bc9d1ab 100644 --- a/chirp/drivers/ic2730.py +++ b/chirp/drivers/ic2730.py @@ -1306,7 +1306,7 @@ def myset_bitmask(setting, obj, ndx, atrb, knt): stx += "%0d, " % nx elif (nx >= 8) and (nx < 16): if (_pslg[kx].msk[1] & (1 << (nx - 8))): - sstx += "%0d, " % nx + stx += "%0d, " % nx elif (nx >= 16) and (nx < 24): if (_pslg[kx].msk[2] & (1 << (nx - 16))): stx += "%0d, " % nx diff --git a/chirp/drivers/lt725uv.py b/chirp/drivers/lt725uv.py index 69f461a8a..050da8286 100644 --- a/chirp/drivers/lt725uv.py +++ b/chirp/drivers/lt725uv.py @@ -266,7 +266,7 @@ def _clean_buffer(radio): junk = radio.pipe.read(256) radio.pipe.timeout = STIMEOUT if junk: - Log.debug("Got %i bytes of junk before starting" % len(junk)) + LOG.debug("Got %i bytes of junk before starting" % len(junk)) def _rawrecv(radio, amount): diff --git a/chirp/drivers/retevis_rt98.py b/chirp/drivers/retevis_rt98.py index 6604ea8f0..7a960be96 100644 --- a/chirp/drivers/retevis_rt98.py +++ b/chirp/drivers/retevis_rt98.py @@ -606,7 +606,7 @@ def _ident(radio): ver_response = radio.pipe.read(16) LOG.debug(util.hexprint(ver_response)) - verok, model, bandlimit = check_ver(ver_response, + verok, model, bandlimit = check_ver(radio, ver_response, radio.ALLOWED_RADIO_TYPES) if not verok: _finish(radio) diff --git a/chirp/drivers/thd72.py b/chirp/drivers/thd72.py index 1556cc9dc..aac72ab82 100644 --- a/chirp/drivers/thd72.py +++ b/chirp/drivers/thd72.py @@ -836,8 +836,8 @@ def usage(): if download: data = r.download(True, blocks) - file(fname, "wb").write(data) + open(fname, "wb").write(data) else: - r._mmap = file(fname, "rb").read(r._memsize) + r._mmap = open(fname, "rb").read(r._memsize) r.upload(blocks) print("\nDone") diff --git a/chirp/drivers/tk760.py b/chirp/drivers/tk760.py index a9b6382d0..5193360c0 100644 --- a/chirp/drivers/tk760.py +++ b/chirp/drivers/tk760.py @@ -226,7 +226,7 @@ def open_radio(radio): # validate the input if len(ident) != 8: LOG.debug("Wrong ID, get only %s bytes, we expect 8" % len(ident)) - LOG.debug(hexprint(ident)) + LOG.debug(util.hexprint(ident)) msg = "Bad ID received, just %s bytes, we want 8" % len(ident) raise errors.RadioError(msg) diff --git a/chirp/drivers/vgc.py b/chirp/drivers/vgc.py index 135ce125e..9803e2160 100644 --- a/chirp/drivers/vgc.py +++ b/chirp/drivers/vgc.py @@ -351,7 +351,7 @@ def _clean_buffer(radio): junk = radio.pipe.read(256) radio.pipe.timeout = STIMEOUT if junk: - Log.debug("Got %i bytes of junk before starting" % len(junk)) + LOG.debug("Got %i bytes of junk before starting" % len(junk)) def _check_for_double_ack(radio): From 0eda256f7505eea6c6661ac02866d8639c86736c Mon Sep 17 00:00:00 2001 From: Daniele Forsi Date: Sun, 4 Jun 2023 19:24:02 +0200 Subject: [PATCH 03/13] Fix W605 invalid escape sequence Fixes: ./chirp/drivers/kguv920pa.py:39:13: W605 invalid escape sequence '\]' ./chirp/drivers/retevis_rt87.py:199:47: W605 invalid escape sequence '\]' ./chirp/drivers/vx3.py:941:34: W605 invalid escape sequence '\d' ./chirp/drivers/ft90.py:674:34: W605 invalid escape sequence '\d' ./chirp/drivers/vx2.py:715:34: W605 invalid escape sequence '\d' ./chirp/drivers/ft1d.py:586:33: W605 invalid escape sequence '\d' ./chirp/drivers/ft1d.py:586:39: W605 invalid escape sequence '\s' ./chirp/drivers/ft1d.py:586:52: W605 invalid escape sequence '\d' ./chirp/drivers/vgc.py:1429:40: W605 invalid escape sequence '\d' ./chirp/drivers/vx8.py:525:33: W605 invalid escape sequence '\d' ./chirp/drivers/vx8.py:525:39: W605 invalid escape sequence '\s' ./chirp/drivers/vx8.py:525:52: W605 invalid escape sequence '\d' ./chirp/drivers/tk760g.py:88:71: W605 invalid escape sequence '\F' ./chirp/drivers/tk760g.py:277:59: W605 invalid escape sequence '\-' ./chirp/drivers/ic9x.py:51:30: W605 invalid escape sequence '\]' ./chirp/drivers/vx6.py:874:44: W605 invalid escape sequence '\d' ./chirp/drivers/vx6.py:887:37: W605 invalid escape sequence '\d' ./chirp/drivers/ap510.py:330:11: W605 invalid escape sequence '\#' ./chirp/drivers/ft7800.py:746:34: W605 invalid escape sequence '\d' ./chirp/drivers/retevis_rt26.py:885:40: W605 invalid escape sequence '\d' --- chirp/drivers/ap510.py | 2 +- chirp/drivers/ft1d.py | 2 +- chirp/drivers/ft7800.py | 2 +- chirp/drivers/ft90.py | 2 +- chirp/drivers/ic9x.py | 2 +- chirp/drivers/kguv920pa.py | 2 +- chirp/drivers/retevis_rt26.py | 2 +- chirp/drivers/retevis_rt87.py | 2 +- chirp/drivers/rh5r_v2.py | 2 +- chirp/drivers/tk760g.py | 4 ++-- chirp/drivers/vgc.py | 2 +- chirp/drivers/vx2.py | 2 +- chirp/drivers/vx3.py | 2 +- chirp/drivers/vx6.py | 4 ++-- chirp/drivers/vx8.py | 2 +- 15 files changed, 17 insertions(+), 17 deletions(-) diff --git a/chirp/drivers/ap510.py b/chirp/drivers/ap510.py index c9ff8e083..3b8d39b5c 100644 --- a/chirp/drivers/ap510.py +++ b/chirp/drivers/ap510.py @@ -327,7 +327,7 @@ def set_smartbeacon(self, d): 'TEMP1-1,WIDE 2-1', 'WIDE2-1', ] -TABLE = "/\#&0>AW^_acnsuvz" +TABLE = r"/\#&0>AW^_acnsuvz" SYMBOL = "".join(map(chr, range(ord("!"), ord("~")+1))) BEACON = ['manual', 'auto', 'auto + manual', 'smart', 'smart + manual'] ALIAS = ['WIDE1-N', 'WIDE2-N', 'WIDE1-N + WIDE2-N'] diff --git a/chirp/drivers/ft1d.py b/chirp/drivers/ft1d.py index a7c2b57e0..ea14d1be3 100644 --- a/chirp/drivers/ft1d.py +++ b/chirp/drivers/ft1d.py @@ -730,7 +730,7 @@ class FT1Radio(yaesu_clone.YaesuCloneModeRadio): _adms_ext = '.ft1d' _SG_RE = re.compile(r"(?P[-+NESW]?)(?P[\d]+)[\s\.,]*" - "(?P[\d]*)[\s\']*(?P[\d]*)") + r"(?P[\d]*)[\s\']*(?P[\d]*)") _RX_BAUD = ("off", "1200 baud", "9600 baud") _TX_DELAY = ("100ms", "150ms", "200ms", "250ms", "300ms", diff --git a/chirp/drivers/ft7800.py b/chirp/drivers/ft7800.py index a5a03f451..da6361bee 100644 --- a/chirp/drivers/ft7800.py +++ b/chirp/drivers/ft7800.py @@ -743,7 +743,7 @@ def set_settings(self, uisettings): try: _settings = self._memobj.settings setting = element.get_name() - if re.match('dtmf\d', setting): + if re.match(r'dtmf\d', setting): # set dtmf fields dtmfstr = str(element.value).strip() newval = [] diff --git a/chirp/drivers/ft90.py b/chirp/drivers/ft90.py index da7733e37..b2f5216e9 100644 --- a/chirp/drivers/ft90.py +++ b/chirp/drivers/ft90.py @@ -671,7 +671,7 @@ def set_settings(self, uisettings): newval = element.value if setting == "cwid": newval = self._encode_cwid(newval) - if re.match('dtmf\d', setting): + if re.match(r'dtmf\d', setting): # set dtmf length field and then get bcd dtmf dtmfstrlen = len(str(newval).strip()) setattr(_settings, setting + "_len", dtmfstrlen) diff --git a/chirp/drivers/ic9x.py b/chirp/drivers/ic9x.py index 002a7c4ca..362df75a6 100644 --- a/chirp/drivers/ic9x.py +++ b/chirp/drivers/ic9x.py @@ -49,7 +49,7 @@ } CHARSET = chirp_common.CHARSET_ALPHANUMERIC + \ - "!\"#$%&'()*+,-./:;<=>?@[\]^_`{|}~" + "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~" class Lock: diff --git a/chirp/drivers/kguv920pa.py b/chirp/drivers/kguv920pa.py index 231908f69..b1ed296ea 100644 --- a/chirp/drivers/kguv920pa.py +++ b/chirp/drivers/kguv920pa.py @@ -36,7 +36,7 @@ CHARSET = "0123456789" + \ ":;<=>?@" + \ "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + \ - "[\]^_`" + \ + "[\\]^_`" + \ "abcdefghijklmnopqrstuvwxyz" + \ "{|}~\x4E" + \ " !\"#$%&'()*+,-./" diff --git a/chirp/drivers/retevis_rt26.py b/chirp/drivers/retevis_rt26.py index 6dbd17720..a1ca09dd5 100644 --- a/chirp/drivers/retevis_rt26.py +++ b/chirp/drivers/retevis_rt26.py @@ -882,7 +882,7 @@ def set_settings(self, settings): setattr(obj, setting, int(element.value) + 3) elif setting == "dtmfspd": setattr(obj, setting, int(element.value) - 4) - elif re.match('code\d', setting): + elif re.match(r'code\d', setting): # set dtmf length field and then get bcd dtmf if setting == "code3": strlen = 10 diff --git a/chirp/drivers/retevis_rt87.py b/chirp/drivers/retevis_rt87.py index eabb66f2d..7c31376c6 100644 --- a/chirp/drivers/retevis_rt87.py +++ b/chirp/drivers/retevis_rt87.py @@ -196,7 +196,7 @@ # Radio supports UPPER/lower case and symbols CHARSET_ASCII_PLUS = chirp_common.CHARSET_ALPHANUMERIC + \ - "!\"#$%&'()*+,-./:;<=>?@[\]^_`" + "!\"#$%&'()*+,-./:;<=>?@[\\]^_`" POWER_LEVELS = [chirp_common.PowerLevel('Low', watts=1), chirp_common.PowerLevel('High', watts=4)] diff --git a/chirp/drivers/rh5r_v2.py b/chirp/drivers/rh5r_v2.py index 235bd52f1..bb7e5e3ae 100644 --- a/chirp/drivers/rh5r_v2.py +++ b/chirp/drivers/rh5r_v2.py @@ -129,7 +129,7 @@ class TYTTHUVF8_V2(chirp_common.CloneModeRadio): VENDOR = "TYT" MODEL = "TH-UVF8F" BAUD_RATE = 9600 - _FILEID = b'OEMOEM \XFF' + _FILEID = b'OEMOEM \\XFF' def get_features(self): rf = chirp_common.RadioFeatures() diff --git a/chirp/drivers/tk760g.py b/chirp/drivers/tk760g.py index a9859accd..93deb50f8 100644 --- a/chirp/drivers/tk760g.py +++ b/chirp/drivers/tk760g.py @@ -85,7 +85,7 @@ u8 unknown20[4]; // x8c-x8f // -- u8 unknown21[4]; // x90-x93 - char poweronmesg[8]; // x94-x9b power on mesg 8 bytes, off is "\FF" * 8 + char poweronmesg[8]; // x94-x9b power on mesg 8 bytes, off is "\xFF" * 8 u8 unknown22[4]; // x9c-x9f // -- u8 unknown23[7]; // xa0-xa6 @@ -274,7 +274,7 @@ chirp_common.PowerLevel("High", watts=5)] MODES = ["NFM", "FM"] # 12.5 / 25 KHz -VALID_CHARS = chirp_common.CHARSET_UPPER_NUMERIC + "_-*()/\-+=)" +VALID_CHARS = chirp_common.CHARSET_UPPER_NUMERIC + r"_-*()/\-+=)" SKIP_VALUES = ["", "S"] TONES = chirp_common.TONES diff --git a/chirp/drivers/vgc.py b/chirp/drivers/vgc.py index 9803e2160..9d185aca5 100644 --- a/chirp/drivers/vgc.py +++ b/chirp/drivers/vgc.py @@ -1426,7 +1426,7 @@ def set_settings(self, settings): setattr(obj, setting, int(element.value) + 5) elif setting in ["tt1stdly", "ttdlyqt"]: setattr(obj, setting, int(element.value) + 2) - elif re.match('code\d', setting): + elif re.match(r'code\d', setting): # set dtmf length field and then get bcd dtmf dtmfstrlen = len(str(element.value).strip()) setattr(_mem.dtmfcode, setting + "_len", dtmfstrlen) diff --git a/chirp/drivers/vx2.py b/chirp/drivers/vx2.py index d6ce7a75a..71be286dd 100644 --- a/chirp/drivers/vx2.py +++ b/chirp/drivers/vx2.py @@ -712,7 +712,7 @@ def set_settings(self, uisettings): try: setting = element.get_name() _settings = self._memobj.settings - if re.match('dtmf\d', setting): + if re.match(r'dtmf\d', setting): # set dtmf fields dtmfstr = str(element.value).strip() newval = [] diff --git a/chirp/drivers/vx3.py b/chirp/drivers/vx3.py index c9a2a9c4e..3e81a0058 100644 --- a/chirp/drivers/vx3.py +++ b/chirp/drivers/vx3.py @@ -938,7 +938,7 @@ def set_settings(self, uisettings): try: setting = element.get_name() _settings = self._memobj.settings - if re.match('dtmf\d', setting): + if re.match(r'dtmf\d', setting): # set dtmf fields dtmfstr = str(element.value).strip() newval = [] diff --git a/chirp/drivers/vx6.py b/chirp/drivers/vx6.py index 0ea371c61..16edc3eea 100644 --- a/chirp/drivers/vx6.py +++ b/chirp/drivers/vx6.py @@ -871,7 +871,7 @@ def set_settings(self, uisettings): try: setting = element.get_name() _settings = self._memobj.settings - if re.match('internet_dtmf_\d', setting): + if re.match(r'internet_dtmf_\d', setting): # set dtmf fields dtmfstr = str(element.value).strip() newval = [] @@ -884,7 +884,7 @@ def set_settings(self, uisettings): _settings = self._memobj.internet_dtmf[idx] _settings.memory = newval continue - elif re.match('dtmf_\d', setting): + elif re.match(r'dtmf_\d', setting): # set dtmf fields dtmfstr = str(element.value).strip() newval = [] diff --git a/chirp/drivers/vx8.py b/chirp/drivers/vx8.py index 384956fab..0e10a9cea 100644 --- a/chirp/drivers/vx8.py +++ b/chirp/drivers/vx8.py @@ -522,7 +522,7 @@ class VX8Radio(yaesu_clone.YaesuCloneModeRadio): _has_af_dual = True _SG_RE = re.compile(r"(?P[-+NESW]?)(?P[\d]+)[\s\.,]*" - "(?P[\d]*)[\s\']*(?P[\d]*)") + r"(?P[\d]*)[\s\']*(?P[\d]*)") _RX_BAUD = ("off", "1200 baud", "9600 baud") _TX_DELAY = ("100ms", "200ms", "300ms", From fa205c1a208473d58092ce983e003de71a2f9c91 Mon Sep 17 00:00:00 2001 From: Daniele Forsi Date: Wed, 7 Jun 2023 22:48:06 +0200 Subject: [PATCH 04/13] Remove unused dictionary SETTING_LISTS --- chirp/drivers/bf_t8.py | 14 -------------- chirp/drivers/h777.py | 4 ---- chirp/drivers/kyd.py | 9 --------- chirp/drivers/lt725uv.py | 25 ------------------------- chirp/drivers/mml_jc8810.py | 34 ---------------------------------- chirp/drivers/radioddity_r2.py | 9 --------- chirp/drivers/radtel_t18.py | 18 ------------------ chirp/drivers/retevis_rb17p.py | 12 ------------ chirp/drivers/retevis_rb28.py | 13 ------------- chirp/drivers/retevis_rt1.py | 17 ----------------- chirp/drivers/retevis_rt21.py | 29 ----------------------------- chirp/drivers/retevis_rt22.py | 8 -------- chirp/drivers/retevis_rt26.py | 22 ---------------------- chirp/drivers/retevis_rt76p.py | 24 ------------------------ chirp/drivers/retevis_rt98.py | 19 ------------------- chirp/drivers/tdh8.py | 34 ---------------------------------- chirp/drivers/th9000.py | 11 ----------- chirp/drivers/th_uv8000.py | 8 -------- chirp/drivers/uv5r.py | 34 ---------------------------------- 19 files changed, 344 deletions(-) diff --git a/chirp/drivers/bf_t8.py b/chirp/drivers/bf_t8.py index 2abd3d96f..ec2dbd49f 100644 --- a/chirp/drivers/bf_t8.py +++ b/chirp/drivers/bf_t8.py @@ -114,20 +114,6 @@ "CH11 - 162.000" ] -SETTING_LISTS = { - "ab": AB_LIST, - "abr": ABR_LIST, - "area": AREA_LIST, - "mdf": MDF_LIST, - "ring": RING_LIST, - "tot": TOT_LIST, - "tot": TOT2_LIST, - "voice": VOICE_LIST, - "vox": VOX_LIST, - "workmode": WORKMODE_LIST, - "wx": WX_LIST, - } - FRS_FREQS1 = [462562500, 462587500, 462612500, 462637500, 462662500, 462687500, 462712500] FRS_FREQS2 = [467562500, 467587500, 467612500, 467637500, 467662500, diff --git a/chirp/drivers/h777.py b/chirp/drivers/h777.py index 344ef28ae..ebdb069e3 100644 --- a/chirp/drivers/h777.py +++ b/chirp/drivers/h777.py @@ -87,10 +87,6 @@ "300 seconds"] SCANMODE_LIST = ["Carrier", "Time"] -SETTING_LISTS = { - "voice": VOICE_LIST, -} - def _h777_enter_programming_mode(radio): serial = radio.pipe diff --git a/chirp/drivers/kyd.py b/chirp/drivers/kyd.py index 1894b6dd6..f559b3343 100644 --- a/chirp/drivers/kyd.py +++ b/chirp/drivers/kyd.py @@ -74,15 +74,6 @@ VOX_LIST = ["OFF"] + ["%s" % x for x in range(1, 17)] VOXDELAY_LIST = ["0.3", "0.5", "1.0", "1.5", "2.0", "3.0"] -SETTING_LISTS = { - "bcl": BCL_LIST, - "tot": TIMEOUTTIMER_LIST, - "totalert": TOTALERT_LIST, - "voice": VOICE_LIST, - "vox": VOX_LIST, - "voxdelay": VOXDELAY_LIST, - } - def _nc630a_enter_programming_mode(radio): serial = radio.pipe diff --git a/chirp/drivers/lt725uv.py b/chirp/drivers/lt725uv.py index 050da8286..e4ed6f7e0 100644 --- a/chirp/drivers/lt725uv.py +++ b/chirp/drivers/lt725uv.py @@ -235,31 +235,6 @@ LIST_SSF = ["1000", "1450", "1750", "2100"] LIST_DTMFTX = ["50", "100", "150", "200", "300", "500"] -SETTING_LISTS = { - "init_bank": LIST_TDR_DEF, - "tot": LIST_TIMEOUT, - "wtled": LIST_COLOR, # not used in BJ-318, other radios use - "rxled": LIST_COLOR, # not used in BJ-318, other radios use - "txled": LIST_COLOR, # not used in BJ-318, other radios use - "sig_freq": LIST_SSF, - "dtmf_txms": LIST_DTMFTX, - "ledsw": LIST_LEDSW, - "frq_chn_mode": LIST_VFOMODE, - "rx_tone": LIST_CTCSS, - "tx_tone": LIST_CTCSS, - "rx_mode": LIST_RECVMODE, - "launch_sig": LIST_SIGNAL, - "tx_end_sig": LIST_SIGNAL, - "bpower": LIST_BPOWER, - "fm_bw": LIST_BW, - "shift": LIST_SHIFT, - "step": LIST_STEPS, - "ring": LIST_RING, - "state_now": LIST_STATE, - "up_scr_color": LIST_COLOR318, # unique to BJ-318 - "dn_scr_color": LIST_COLOR318, # unique to BJ-318 -} - def _clean_buffer(radio): radio.pipe.timeout = 0.005 diff --git a/chirp/drivers/mml_jc8810.py b/chirp/drivers/mml_jc8810.py index faa03aa14..60d376abc 100644 --- a/chirp/drivers/mml_jc8810.py +++ b/chirp/drivers/mml_jc8810.py @@ -249,40 +249,6 @@ 0x23] -SETTING_LISTS = { - "abr": ABR_LIST, - "almod": ALMODE_LIST, - "autolk": AUTOLK_LIST, - "dtmfoff": DTMFSPEED_LIST, - "dtmfon": DTMFSPEED_LIST, - "dtmfst": DTMFST_LIST, - "dualtx": DUALTX_LIST, - "encrypt": ENCRYPT_LIST, - "language": LANGUAGE_LIST, - "mdfa": MDF_LIST, - "mdfb": MDF_LIST, - "menuquit": MENUQUIT_LIST, - "ponmsg": PONMSG_LIST, - "pttid": PTTID_LIST, - "pttlt": PTTLT_LIST, - "qtsave": QTSAVE_LIST, - "roger": ROGER_LIST, - "rpste": RPSTE_LIST, - "rptrl": RPSTE_LIST, - "rxendtail": TONERXEND_LIST, - "save": SAVE_LIST, - "scode": PTTIDCODE_LIST, - "screv": SCREV_LIST, - "skey3_lp": TONERXEND_LIST, - "tailcode": TAILCODE_LIST, - "tone": TONE_LIST, - "tot": TOT_LIST, - "vox": OFF1TO9_LIST, - "voxd": VOXD_LIST, - "workmode": WORKMODE_LIST - } - - def _enter_programming_mode(radio): serial = radio.pipe diff --git a/chirp/drivers/radioddity_r2.py b/chirp/drivers/radioddity_r2.py index 64681c5d2..f278a6619 100644 --- a/chirp/drivers/radioddity_r2.py +++ b/chirp/drivers/radioddity_r2.py @@ -105,15 +105,6 @@ TONES = chirp_common.TONES DTCS_CODES = chirp_common.DTCS_CODES -SETTING_LISTS = { - "tot": TIMEOUT_LIST, - "scanmode": SCANMODE_LIST, - "voice": VOICE_LIST, - "vox": VOX_LIST, - "voxdelay": VOXDELAY_LIST, - "mode": MODE_LIST, - } - FRS16_FREQS = [462562500, 462587500, 462612500, 462637500, 462662500, 462625000, 462725000, 462687500, 462712500, 462550000, 462575000, 462600000, diff --git a/chirp/drivers/radtel_t18.py b/chirp/drivers/radtel_t18.py index daf8ccc40..039488579 100644 --- a/chirp/drivers/radtel_t18.py +++ b/chirp/drivers/radtel_t18.py @@ -185,24 +185,6 @@ "Alarm"] SIDEKEY87_LIST = ["Scan", "Emergency Alarm"] -SETTING_LISTS = { - "voiceprompt": VOICE_LIST, - "language": VOICE_LIST2, - "timeouttimer": TIMEOUTTIMER_LIST, - "scanmode": SCANMODE_LIST, - "voxlevel": VOXLEVEL_LIST, - "voxdelay": VOXDELAY_LIST, - "sidekey2": SIDEKEY2_LIST, - "sidekey2": SIDEKEY19_LIST, - "sidekey2": SIDEKEY85SHORT_LIST, - "sidekey2": SIDEKEYV8A_LIST, - "sidekey1L": SIDEKEY85LONG_LIST, - "sidekey2S": SIDEKEY29_LIST, - "sidekey2S": SIDEKEY85SHORT_LIST, - "sidekey2L": SIDEKEY85LONG_LIST, - "speccode": SPECCODE_LIST -} - FRS_FREQS1 = [462562500, 462587500, 462612500, 462637500, 462662500, 462687500, 462712500] FRS_FREQS2 = [467562500, 467587500, 467612500, 467637500, 467662500, diff --git a/chirp/drivers/retevis_rb17p.py b/chirp/drivers/retevis_rb17p.py index 07245b334..6efdb04d2 100644 --- a/chirp/drivers/retevis_rb17p.py +++ b/chirp/drivers/retevis_rb17p.py @@ -95,18 +95,6 @@ VOXLEVEL_LIST = ["Off", "1", "2", "3", "4", "5", "6", "7", "8", "9"] WORKMODE_LIST = ["Frequencies", "Channel Numbers", "Names"] -SETTING_LISTS = { - "alarmtype": ALARMTYPE_LIST, - "backlight": BACKLIGHT_LIST, - "batterysave": BATTERYSAVE_LIST, - "scanmode": SCANMODE_LIST, - "sidekey": SIDEKEY_LIST, - "timeouttimer": TIMEOUTTIMER_LIST, - "voxdelay": VOXDELAY_LIST, - "voxlevel": VOXLEVEL_LIST, - "workmode": WORKMODE_LIST -} - BCL = ["Off", "Carrier", "QT/DCS"] GMRS_FREQS1 = [462562500, 462587500, 462612500, 462637500, 462662500, diff --git a/chirp/drivers/retevis_rb28.py b/chirp/drivers/retevis_rb28.py index e3434a907..529b391ee 100644 --- a/chirp/drivers/retevis_rb28.py +++ b/chirp/drivers/retevis_rb28.py @@ -141,19 +141,6 @@ VOXD_LIST = ["0.5", "1.0", "1.5", "2.0", "2.5", "3.0"] VOXL_LIST = ["OFF"] + ["%s" % x for x in range(1, 10)] -SETTING_LISTS = { - "backlight": BACKLIGHT_LIST, - "pfkey_gt": PFKEY_EU_LIST, - "pfkey_gt": PFKEY_US_LIST, - "pfkey_lt": PFKEY_EU_LIST, - "pfkey_lt": PFKEY_US_LIST, - "save": SAVE_LIST, - "tot": TIMEOUTTIMER_LIST, - "voice": VOICE_LIST, - "voxd": VOXD_LIST, - "voxl": VOXL_LIST, - } - PMR_TONES = list(chirp_common.TONES) [PMR_TONES.remove(x) for x in [69.3, 159.8, 165.5, 171.3, 177.3, 183.5, 189.9, 196.6, 199.5, 206.5, 229.1, 254.1]] diff --git a/chirp/drivers/retevis_rt1.py b/chirp/drivers/retevis_rt1.py index 134692c77..0877f2209 100644 --- a/chirp/drivers/retevis_rt1.py +++ b/chirp/drivers/retevis_rt1.py @@ -104,23 +104,6 @@ LIST_SCANDELAY = ["%s" % x for x in range(3, 31)] LIST_TXTONE = ["Off", "BOT", "EOT", "Both"] -SETTING_LISTS = { - "lpt": LIST_LPT, - "k1shortp": LIST_SHORT_PRESS, - "k1longp": LIST_LONG_PRESS, - "k2shortp": LIST_SHORT_PRESS, - "k2longp": LIST_LONG_PRESS, - "voxd": LIST_VOXDELAY, - "voice": LIST_VOICE, - "tot": LIST_TIMEOUTTIMER, - "save": LIST_SAVE, - "ssave": LIST_SSAVE, - "prioritych": LIST_PRIORITYCH, - "scanspeed": LIST_SCANSPEED, - "scandelay": LIST_SCANDELAY, - "txtone": LIST_TXTONE, - } - # Retevis RT1 fingerprints RT1_VHF_fp = b"PXT8K" + b"\xF0\x00\x00" # RT1 VHF model RT1_UHF_fp = b"PXT8K" + b"\xF3\x00\x00" # RT1 UHF model diff --git a/chirp/drivers/retevis_rt21.py b/chirp/drivers/retevis_rt21.py index d9911ba83..72fe683c6 100644 --- a/chirp/drivers/retevis_rt21.py +++ b/chirp/drivers/retevis_rt21.py @@ -555,35 +555,6 @@ TOPKEY_CHOICES = ["None", "Alarming"] TOPKEY_VALUES = [0xFF, 0x0C] -SETTING_LISTS = { - "alarm": ALARM_LIST, - "bcl": BCL_LIST, - "bootsel": BOOTSEL_LIST, - "cdcss": CDCSS_LIST, - "cdcss": CDCSS2_LIST, - "freqhop": FREQHOP_LIST, - "function": FUNCTION_LIST, - "gain": GAIN_LIST, - "hop": HOP_LIST, - "key_gt": PFKEY28B_LIST, - "key_lt": PFKEY28B_LIST, - "pfkey": PFKEY_LIST, - "pwrontype": POT_LIST, - "save": SAVE_LIST, - "savem": SAVEM_LIST, - "scramble": SCRAMBLE_LIST, - "tail": TAIL_LIST, - "tot": TIMEOUTTIMER_LIST, - "totalert": TOTALERT_LIST, - "voice": VOICE_LIST, - "voice": VOICE_LIST2, - "voice": VOICE_LIST3, - "vox": VOX_LIST, - "voxd": VOXD_LIST, - "voxl": VOXL_LIST, - "warn": WARN_LIST, - } - GMRS_FREQS1 = [462562500, 462587500, 462612500, 462637500, 462662500, 462687500, 462712500] GMRS_FREQS2 = [467562500, 467587500, 467612500, 467637500, 467662500, diff --git a/chirp/drivers/retevis_rt22.py b/chirp/drivers/retevis_rt22.py index c13028c1d..9f29d6907 100644 --- a/chirp/drivers/retevis_rt22.py +++ b/chirp/drivers/retevis_rt22.py @@ -93,14 +93,6 @@ "3.0 | 4", "--- | 5"] -SETTING_LISTS = { - "pf2key": PF2KEY_LIST, - "tot": TIMEOUTTIMER_LIST, - "voice": VOICE_LIST, - "vox": VOX_LIST, - "voxdelay": VOXDELAY_LIST, - } - VALID_CHARS = chirp_common.CHARSET_ALPHANUMERIC + \ "`{|}!\"#$%&'()*+,-./:;<=>?@[]^_" diff --git a/chirp/drivers/retevis_rt26.py b/chirp/drivers/retevis_rt26.py index a1ca09dd5..895dc6c25 100644 --- a/chirp/drivers/retevis_rt26.py +++ b/chirp/drivers/retevis_rt26.py @@ -144,28 +144,6 @@ ["%s" % x for x in range(1000, 1600, 100)] LIST_STUNTYPE = ["TX/RX Inhibit", "TX Inhibit"] -SETTING_LISTS = { - "k1shortp": LIST_SHORT_PRESS, - "k1longp": LIST_LONG_PRESS, - "k2shortp": LIST_SHORT_PRESS, - "k2longp": LIST_LONG_PRESS, - "voxd": LIST_VOXDELAY, - "voice": LIST_VOICE, - "tot": LIST_TIMEOUTTIMER, - "save": LIST_SAVE, - "ssave": LIST_SSAVE, - "scanspeed": LIST_SCANSPEED, - "scandelay": LIST_SCANDELAY, - "digtime": LIST_DIGTIME, - "digdelay": LIST_DIGDELAY, - "starhash": LIST_STARHASH, - "codespace": LIST_CODESPACE, - "groupcode": LIST_GROUPCODE, - "resettime": LIST_RESETTIME, - "decodeto": LIST_DECODETO, - "stuntype": LIST_STUNTYPE, - } - # Retevis RT26 fingerprints RT26_UHF_fp = b"PDK80" + b"\xF3\x00\x00" # RT26 UHF model diff --git a/chirp/drivers/retevis_rt76p.py b/chirp/drivers/retevis_rt76p.py index f45cab2d3..e06e6c6d6 100644 --- a/chirp/drivers/retevis_rt76p.py +++ b/chirp/drivers/retevis_rt76p.py @@ -194,30 +194,6 @@ SKEY_CHOICES = ["FM", "Tx Power", "Moni", "Scan", "Offline", "Weather"] SKEY_VALUES = [0x07, 0x0A, 0x05, 0x1C, 0x0B, 0x0C] - -SETTING_LISTS = { - "abr": OFF1TO10_LIST, - "almod": ALMOD_LIST, - "dtmfspeed": DTMFSPEED_LIST, - "language": LANGUAGE_LIST, - "mdfa": MDF_LIST, - "mdfb": MDF_LIST, - "pttid": PTTID_LIST, - "rpste": RPSTE_LIST, - "rptrl": RPSTE_LIST, - "rxled": BACKLIGHT_LIST, - "scode": PTTIDCODE_LIST, - "scmode": SCMODE_LIST, - "tdrab": TDRAB_LIST, - "tot": TIMEOUTTIMER_LIST, - "tone": TONE_LIST, - "txled": BACKLIGHT_LIST, - "voice": VOICE_LIST, - "vox": OFF1TO10_LIST, - "workmode": WORKMODE_LIST, - "wtled": BACKLIGHT_LIST, - } - GMRS_FREQS1 = [462562500, 462587500, 462612500, 462637500, 462662500, 462687500, 462712500] GMRS_FREQS2 = [467562500, 467587500, 467612500, 467637500, 467662500, diff --git a/chirp/drivers/retevis_rt98.py b/chirp/drivers/retevis_rt98.py index 7a960be96..edfa2c795 100644 --- a/chirp/drivers/retevis_rt98.py +++ b/chirp/drivers/retevis_rt98.py @@ -116,25 +116,6 @@ "Rx(400 - 470 MHz) Tx(400 - 470 MHz)", "Rx(450 - 470 MHz) Tx(450 - 470 MHz)"] -SETTING_LISTS = { - "tuning_step": LIST_STEP, - "timeout_timer": LIST_TIMEOUT, - "auto_power_off": LIST_APO, - "squelch": LIST_SQUELCH, - "display_mode": LIST_DISPLAY_MODE, - "auto_power_on": LIST_AOP, - "ste_type": LIST_STE_TYPE, - "ste_frequency": LIST_STE_FREQ, - "priority_ch": LIST_PRIORITY_CH, - "revert_ch": LIST_REVERT_CH, - "settings2.dropout_delay_time": LIST_TIME50, - "settings2.dwell_time": LIST_TIME50, - "settings2.look_back_time_a": LIST_TIME46, - "settings2.look_back_time_b": LIST_TIME46, - "settings3.vfomr": LIST_VFOMR, - "settings.scan": LIST_SCAN -} - # RT98 memory map # section: 1 Channel Bank # description of channel bank (199 channels , range 1-199) diff --git a/chirp/drivers/tdh8.py b/chirp/drivers/tdh8.py index 680bc284b..319d31d58 100644 --- a/chirp/drivers/tdh8.py +++ b/chirp/drivers/tdh8.py @@ -396,40 +396,6 @@ VOX_LIST = ["OFF"] + ["%s" % x for x in range(1, 11)] WORKMODE_LIST = ["Frequency", "Channel"] -SETTING_LISTS = { - "almod": ALMOD_LIST, - "aniid": PTTID_LIST, - "displayab": AB_LIST, - "dtmfst": DTMFST_LIST, - "dtmfspeed": DTMFSPEED_LIST, - "mdfa": MODE_LIST, - "mdfb": MODE_LIST, - "ponmsg": PONMSG_LIST, - "pttid": PTTID_LIST, - "rtone": RTONE_LIST, - "rogerrx": ROGERRX_LIST, - "rpste": RPSTE_LIST, - "rxled": COLOR_LIST, - "save": SAVE_LIST, - "scode": PTTIDCODE_LIST, - "screv": RESUME_LIST, - "sftd": SHIFTD_LIST, - "stedelay": STEDELAY_LIST, - "step": STEP_LIST, - "step291": STEP291_LIST, - "tdrab": TDRAB_LIST, - "tdrch": TDRCH_LIST, - "timeout": TIMEOUT_LIST, - "txled": COLOR_LIST, - "txpower": TXPOWER_LIST, - "txpower3": TXPOWER3_LIST, - "voice": VOICE_LIST, - "vox": VOX_LIST, - "widenarr": BANDWIDTH_LIST, - "workmode": WORKMODE_LIST, - "wtled": COLOR_LIST -} - GMRS_FREQS = bandplan_na.GMRS_HIRPT NOAA_FREQS = [162550000, 162400000, 162475000, 162425000, 162450000, diff --git a/chirp/drivers/th9000.py b/chirp/drivers/th9000.py index a2a0dd7a0..ebd2c65b5 100644 --- a/chirp/drivers/th9000.py +++ b/chirp/drivers/th9000.py @@ -61,17 +61,6 @@ TBSTFREQ_LIST = ["1750Hz", "2100Hz", "1000Hz", "1450Hz"] BEEP_LIST = ["Off", "On"] -SETTING_LISTS = { - "auto_power_off": APO_LIST, - "bg_color": BGCOLOR_LIST, - "bg_brightness": BGBRIGHT_LIST, - "squelch": SQUELCH_LIST, - "timeout_timer": TIMEOUT_LIST, - "choose_tx_power": TXPWR_LIST, - "tbst_freq": TBSTFREQ_LIST, - "voice_prompt": BEEP_LIST -} - MEM_FORMAT = """ #seekto 0x0000; struct { diff --git a/chirp/drivers/th_uv8000.py b/chirp/drivers/th_uv8000.py index 50aae3e3d..1e7b69ceb 100644 --- a/chirp/drivers/th_uv8000.py +++ b/chirp/drivers/th_uv8000.py @@ -255,14 +255,6 @@ LIST_VOXDLY = ["0.5", "1.0", "2.0", "3.0"] # LISTS must be strings LIST_PTT = ["Both", "EoT", "BoT", "Off"] -SETTING_LISTS = {"tot": LIST_TIMEOUT, "wtled": LIST_COLOR, - "rxled": LIST_COLOR, "txled": LIST_COLOR, - "ledsw": LIST_LEDSW, "frq_chn_mode": LIST_VFOMODE, - "rx_tone": LIST_CTCSS, "tx_tone": LIST_CTCSS, - "rx_mode": LIST_RECVMODE, "fm_bw": LIST_BW, - "shift": LIST_SHIFT, "step": LIST_STEPS, - "vox_dly": LIST_VOXDLY, "ptt": LIST_PTT} - def _clean_buffer(radio): radio.pipe.timeout = 0.005 diff --git a/chirp/drivers/uv5r.py b/chirp/drivers/uv5r.py index b948e4121..d3df79bbb 100644 --- a/chirp/drivers/uv5r.py +++ b/chirp/drivers/uv5r.py @@ -322,40 +322,6 @@ VOX_LIST = ["OFF"] + ["%s" % x for x in range(1, 11)] WORKMODE_LIST = ["Frequency", "Channel"] -SETTING_LISTS = { - "almod": ALMOD_LIST, - "aniid": PTTID_LIST, - "displayab": AB_LIST, - "dtmfst": DTMFST_LIST, - "dtmfspeed": DTMFSPEED_LIST, - "mdfa": MODE_LIST, - "mdfb": MODE_LIST, - "ponmsg": PONMSG_LIST, - "pttid": PTTID_LIST, - "rtone": RTONE_LIST, - "rogerrx": ROGERRX_LIST, - "rpste": RPSTE_LIST, - "rxled": COLOR_LIST, - "save": SAVE_LIST, - "scode": PTTIDCODE_LIST, - "screv": RESUME_LIST, - "sftd": SHIFTD_LIST, - "stedelay": STEDELAY_LIST, - "step": STEP_LIST, - "step291": STEP291_LIST, - "tdrab": TDRAB_LIST, - "tdrch": TDRCH_LIST, - "timeout": TIMEOUT_LIST, - "txled": COLOR_LIST, - "txpower": TXPOWER_LIST, - "txpower3": TXPOWER3_LIST, - "voice": VOICE_LIST, - "vox": VOX_LIST, - "widenarr": BANDWIDTH_LIST, - "workmode": WORKMODE_LIST, - "wtled": COLOR_LIST -} - GMRS_FREQS1 = [462562500, 462587500, 462612500, 462637500, 462662500, 462687500, 462712500] GMRS_FREQS2 = [467562500, 467587500, 467612500, 467637500, 467662500, From 2193ab3b9a10cc269c0fd8c1a75c372f6987cc8d Mon Sep 17 00:00:00 2001 From: Daniele Forsi Date: Sun, 18 Jun 2023 23:37:59 +0200 Subject: [PATCH 05/13] Remove unused imports Removed with: autoflake --in-place --recursive --ignore-pass-after-docstring --remove-all-unused-imports . and non committing the removal of "pass" statements. --- chirp/drivers/alinco.py | 2 +- chirp/drivers/anytone778uv.py | 3 +-- chirp/drivers/anytone_ht.py | 2 +- chirp/drivers/anytone_iii.py | 2 +- chirp/drivers/baofeng_common.py | 4 ++-- chirp/drivers/baofeng_wp970i.py | 4 ++-- chirp/drivers/bf_t1.py | 4 ++-- chirp/drivers/bf_t8.py | 1 - chirp/drivers/bj9900.py | 4 ---- chirp/drivers/bjuv55.py | 2 +- chirp/drivers/ft2d.py | 6 +++--- chirp/drivers/ft450d.py | 2 +- chirp/drivers/ft60.py | 5 ++--- chirp/drivers/ft70.py | 3 +-- chirp/drivers/ft7800.py | 5 ++--- chirp/drivers/ft818.py | 6 +----- chirp/drivers/ft90.py | 5 ++--- chirp/drivers/ftlx011.py | 5 ++--- chirp/drivers/generic_csv.py | 1 - chirp/drivers/gmrsuv1.py | 4 ++-- chirp/drivers/gmrsv2.py | 4 ++-- chirp/drivers/hg_uv98.py | 2 +- chirp/drivers/hobbypcb.py | 3 +-- chirp/drivers/ic2100.py | 4 +--- chirp/drivers/ic2730.py | 5 ++--- chirp/drivers/icf.py | 3 +-- chirp/drivers/icomciv.py | 1 - chirp/drivers/icq7.py | 3 +-- chirp/drivers/icv80.py | 7 +++---- chirp/drivers/icv86.py | 5 ++--- chirp/drivers/icx90.py | 3 +-- chirp/drivers/iradio_uv_5118.py | 4 ++-- chirp/drivers/kguv920pa.py | 3 +-- chirp/drivers/kguv9dplus.py | 12 ++++++------ chirp/drivers/kyd_IP620.py | 4 +--- chirp/drivers/leixen.py | 2 +- chirp/drivers/mursv1.py | 7 +++---- chirp/drivers/radioddity_r2.py | 3 +-- chirp/drivers/retevis_rb15.py | 3 +-- chirp/drivers/retevis_rb28.py | 1 - chirp/drivers/retevis_rt1.py | 3 +-- chirp/drivers/retevis_rt21.py | 1 - chirp/drivers/retevis_rt26.py | 2 +- chirp/drivers/retevis_rt76p.py | 1 - chirp/drivers/retevis_rt98.py | 3 +-- chirp/drivers/rh5r_v2.py | 6 +----- chirp/drivers/tdxone_tdq8a.py | 3 +-- chirp/drivers/tg_uv2p.py | 4 ++-- chirp/drivers/th7800.py | 5 ++--- chirp/drivers/th9000.py | 5 ++--- chirp/drivers/th9800.py | 2 +- chirp/drivers/th_uv3r25.py | 3 +-- chirp/drivers/th_uv8000.py | 2 +- chirp/drivers/th_uv88.py | 2 +- chirp/drivers/thd72.py | 7 +++---- chirp/drivers/tk270.py | 3 +-- chirp/drivers/tk760.py | 3 +-- chirp/drivers/tmd710.py | 2 +- chirp/drivers/ts480.py | 4 ++-- chirp/drivers/ts590.py | 4 ++-- chirp/drivers/uv5x3.py | 4 ++-- chirp/drivers/uv6r.py | 4 ++-- chirp/drivers/vx170.py | 2 +- chirp/drivers/vx2.py | 5 ++--- chirp/drivers/vx3.py | 5 ++--- 65 files changed, 92 insertions(+), 142 deletions(-) diff --git a/chirp/drivers/alinco.py b/chirp/drivers/alinco.py index c9a3b9976..5313b7d50 100644 --- a/chirp/drivers/alinco.py +++ b/chirp/drivers/alinco.py @@ -16,7 +16,7 @@ from chirp import chirp_common, bitwise, memmap, errors, directory, util from chirp.settings import RadioSettingGroup, RadioSetting -from chirp.settings import RadioSettingValueBoolean, RadioSettings +from chirp.settings import RadioSettingValueBoolean import time diff --git a/chirp/drivers/anytone778uv.py b/chirp/drivers/anytone778uv.py index 1b250ee41..a320be3d3 100644 --- a/chirp/drivers/anytone778uv.py +++ b/chirp/drivers/anytone778uv.py @@ -43,8 +43,7 @@ from chirp import bitwise from chirp.settings import RadioSettingGroup, RadioSetting, \ RadioSettingValueBoolean, RadioSettingValueList, \ - RadioSettingValueString, RadioSettingValueInteger, \ - RadioSettingValueFloat, RadioSettings, InvalidValueError + RadioSettingValueString, RadioSettings import struct import time diff --git a/chirp/drivers/anytone_ht.py b/chirp/drivers/anytone_ht.py index 132ce4306..dcd4a9116 100644 --- a/chirp/drivers/anytone_ht.py +++ b/chirp/drivers/anytone_ht.py @@ -25,7 +25,7 @@ from chirp.settings import RadioSetting, RadioSettingGroup, \ RadioSettingValueInteger, RadioSettingValueList, \ RadioSettingValueBoolean, RadioSettingValueString, \ - RadioSettingValueFloat, InvalidValueError, RadioSettings + RadioSettings LOG = logging.getLogger(__name__) diff --git a/chirp/drivers/anytone_iii.py b/chirp/drivers/anytone_iii.py index 3a1a89df0..43ce900e4 100644 --- a/chirp/drivers/anytone_iii.py +++ b/chirp/drivers/anytone_iii.py @@ -26,7 +26,7 @@ from chirp.settings import RadioSetting, RadioSettingGroup, \ RadioSettingValueInteger, RadioSettingValueList, \ RadioSettingValueBoolean, RadioSettingValueString, \ - RadioSettingValueFloat, InvalidValueError, RadioSettings + RadioSettingValueFloat, RadioSettings class ATBankModel(chirp_common.BankModel): diff --git a/chirp/drivers/baofeng_common.py b/chirp/drivers/baofeng_common.py index 454c2b234..b66314351 100644 --- a/chirp/drivers/baofeng_common.py +++ b/chirp/drivers/baofeng_common.py @@ -19,8 +19,8 @@ import time import struct import logging -from chirp import chirp_common, directory, memmap -from chirp import bitwise, errors, util +from chirp import chirp_common, memmap +from chirp import errors, util from chirp import bandplan_na from chirp.settings import RadioSettingGroup, RadioSetting, \ RadioSettingValueBoolean, RadioSettingValueList diff --git a/chirp/drivers/baofeng_wp970i.py b/chirp/drivers/baofeng_wp970i.py index 034618abc..84d7b36b6 100644 --- a/chirp/drivers/baofeng_wp970i.py +++ b/chirp/drivers/baofeng_wp970i.py @@ -17,8 +17,8 @@ import logging from chirp.drivers import baofeng_common -from chirp import chirp_common, directory, memmap -from chirp import bitwise, errors, util +from chirp import chirp_common, directory +from chirp import bitwise from chirp import bandplan_na from chirp.settings import RadioSettingGroup, RadioSetting, \ RadioSettingValueBoolean, RadioSettingValueList, \ diff --git a/chirp/drivers/bf_t1.py b/chirp/drivers/bf_t1.py index c151edb64..b278fe4fd 100644 --- a/chirp/drivers/bf_t1.py +++ b/chirp/drivers/bf_t1.py @@ -29,8 +29,8 @@ from chirp import bitwise, errors, util from chirp.settings import RadioSetting, RadioSettingGroup, \ RadioSettingValueBoolean, RadioSettingValueList, \ - RadioSettingValueInteger, RadioSettingValueString, \ - RadioSettingValueFloat, RadioSettings + RadioSettingValueInteger, RadioSettingValueFloat, \ + RadioSettings import struct import logging diff --git a/chirp/drivers/bf_t8.py b/chirp/drivers/bf_t8.py index ec2dbd49f..4f8045004 100644 --- a/chirp/drivers/bf_t8.py +++ b/chirp/drivers/bf_t8.py @@ -32,7 +32,6 @@ RadioSettingValueFloat, RadioSettingValueInteger, RadioSettingValueList, - RadioSettingValueString, ) LOG = logging.getLogger(__name__) diff --git a/chirp/drivers/bj9900.py b/chirp/drivers/bj9900.py index 42468544a..4c278e4c5 100644 --- a/chirp/drivers/bj9900.py +++ b/chirp/drivers/bj9900.py @@ -17,10 +17,6 @@ """Baojie BJ-9900 management module""" from chirp import chirp_common, util, memmap, errors, directory, bitwise -from chirp.settings import RadioSetting, RadioSettingGroup, \ - RadioSettingValueInteger, RadioSettingValueList, \ - RadioSettingValueBoolean, RadioSettingValueString, \ - RadioSettings import struct import time import logging diff --git a/chirp/drivers/bjuv55.py b/chirp/drivers/bjuv55.py index 1a308b1b1..eb3191610 100644 --- a/chirp/drivers/bjuv55.py +++ b/chirp/drivers/bjuv55.py @@ -18,7 +18,7 @@ import logging from chirp.drivers import uv5r -from chirp import chirp_common, errors, util, directory, memmap +from chirp import chirp_common, directory from chirp import bitwise from chirp.settings import RadioSetting, RadioSettingGroup, \ RadioSettingValueInteger, RadioSettingValueList, \ diff --git a/chirp/drivers/ft2d.py b/chirp/drivers/ft2d.py index 8f6d1a408..6e0b8c903 100644 --- a/chirp/drivers/ft2d.py +++ b/chirp/drivers/ft2d.py @@ -17,11 +17,11 @@ import logging -from chirp.drivers import yaesu_clone, ft1d -from chirp import chirp_common, directory, bitwise +from chirp.drivers import ft1d +from chirp import chirp_common, directory from chirp import errors from chirp import memmap -from chirp.settings import RadioSetting, RadioSettings +from chirp.settings import RadioSetting from chirp.settings import RadioSettingValueString from chirp import util diff --git a/chirp/drivers/ft450d.py b/chirp/drivers/ft450d.py index a2fd5097a..9700b5a96 100644 --- a/chirp/drivers/ft450d.py +++ b/chirp/drivers/ft450d.py @@ -22,7 +22,7 @@ from chirp.settings import RadioSetting, RadioSettingGroup, \ RadioSettingValueInteger, RadioSettingValueList, \ RadioSettingValueBoolean, RadioSettingValueString, \ - RadioSettingValueFloat, RadioSettings + RadioSettings import time import struct import logging diff --git a/chirp/drivers/ft60.py b/chirp/drivers/ft60.py index 49c26efd6..0289684b2 100644 --- a/chirp/drivers/ft60.py +++ b/chirp/drivers/ft60.py @@ -19,9 +19,8 @@ from chirp.drivers import yaesu_clone from chirp import chirp_common, memmap, bitwise, directory, errors from chirp.settings import RadioSetting, RadioSettingGroup, \ - RadioSettingValueInteger, RadioSettingValueList, \ - RadioSettingValueBoolean, RadioSettingValueString, \ - RadioSettingValueFloat, RadioSettings + RadioSettingValueList, RadioSettingValueString, \ + RadioSettings LOG = logging.getLogger(__name__) diff --git a/chirp/drivers/ft70.py b/chirp/drivers/ft70.py index f63014d03..10d0d3ef2 100644 --- a/chirp/drivers/ft70.py +++ b/chirp/drivers/ft70.py @@ -21,8 +21,7 @@ from chirp import errors from chirp import memmap from chirp.settings import RadioSettingGroup, RadioSetting, RadioSettings, \ - RadioSettingValueInteger, RadioSettingValueString, \ - RadioSettingValueList, RadioSettingValueBoolean, \ + RadioSettingValueString, RadioSettingValueList, \ InvalidValueError from chirp import util diff --git a/chirp/drivers/ft7800.py b/chirp/drivers/ft7800.py index da6361bee..d5e107c0d 100644 --- a/chirp/drivers/ft7800.py +++ b/chirp/drivers/ft7800.py @@ -20,9 +20,8 @@ from chirp.drivers import yaesu_clone from chirp import chirp_common, memmap, directory, bitwise, errors from chirp.settings import RadioSetting, RadioSettingGroup, \ - RadioSettingValueInteger, RadioSettingValueList, \ - RadioSettingValueBoolean, RadioSettingValueString, \ - RadioSettings + RadioSettingValueList, RadioSettingValueBoolean, \ + RadioSettingValueString, RadioSettings from collections import defaultdict diff --git a/chirp/drivers/ft818.py b/chirp/drivers/ft818.py index a05d8a400..9447e197c 100755 --- a/chirp/drivers/ft818.py +++ b/chirp/drivers/ft818.py @@ -19,12 +19,8 @@ from chirp.drivers import ft817 from chirp import chirp_common, errors, directory -from chirp.settings import RadioSetting, RadioSettingGroup, \ - RadioSettingValueInteger, RadioSettingValueList, \ - RadioSettingValueBoolean, RadioSettingValueString, \ - RadioSettings +from chirp.settings import RadioSetting, RadioSettingValueBoolean import logging -from chirp.util import safe_charset_string LOG = logging.getLogger(__name__) diff --git a/chirp/drivers/ft90.py b/chirp/drivers/ft90.py index b2f5216e9..6a196c33d 100644 --- a/chirp/drivers/ft90.py +++ b/chirp/drivers/ft90.py @@ -17,9 +17,8 @@ from chirp.drivers import yaesu_clone from chirp import chirp_common, bitwise, memmap, directory, errors, util from chirp.settings import RadioSetting, RadioSettingGroup, \ - RadioSettingValueInteger, RadioSettingValueList, \ - RadioSettingValueBoolean, RadioSettingValueString, \ - RadioSettings + RadioSettingValueList, RadioSettingValueBoolean, \ + RadioSettingValueString, RadioSettings import time import traceback diff --git a/chirp/drivers/ftlx011.py b/chirp/drivers/ftlx011.py index a3ebdc47f..a7a9c7f3b 100644 --- a/chirp/drivers/ftlx011.py +++ b/chirp/drivers/ftlx011.py @@ -16,11 +16,10 @@ import logging import time -from chirp import chirp_common, directory, memmap, errors, util, bitwise +from chirp import chirp_common, directory, memmap, errors, bitwise from chirp.settings import RadioSettingGroup, RadioSetting, \ RadioSettingValueBoolean, RadioSettingValueList, \ - RadioSettingValueString, RadioSettingValueInteger, \ - RadioSettingValueFloat, RadioSettings, InvalidValueError + RadioSettings LOG = logging.getLogger(__name__) diff --git a/chirp/drivers/generic_csv.py b/chirp/drivers/generic_csv.py index 14c2bd2b9..c655b6d9c 100644 --- a/chirp/drivers/generic_csv.py +++ b/chirp/drivers/generic_csv.py @@ -18,7 +18,6 @@ import logging from chirp import chirp_common, errors, directory -from chirp import import_logic LOG = logging.getLogger(__name__) DEFAULT_POWER_LEVEL = chirp_common.AutoNamedPowerLevel(50) diff --git a/chirp/drivers/gmrsuv1.py b/chirp/drivers/gmrsuv1.py index e6c59c29b..32f72feff 100644 --- a/chirp/drivers/gmrsuv1.py +++ b/chirp/drivers/gmrsuv1.py @@ -17,8 +17,8 @@ import logging from chirp.drivers import baofeng_common -from chirp import chirp_common, directory, memmap -from chirp import bitwise, errors, util +from chirp import chirp_common, directory +from chirp import bitwise from chirp.settings import RadioSettingGroup, RadioSetting, \ RadioSettingValueBoolean, RadioSettingValueList, \ RadioSettingValueString, RadioSettingValueInteger, \ diff --git a/chirp/drivers/gmrsv2.py b/chirp/drivers/gmrsv2.py index c272214cb..58da38b14 100644 --- a/chirp/drivers/gmrsv2.py +++ b/chirp/drivers/gmrsv2.py @@ -17,8 +17,8 @@ import logging from chirp.drivers import baofeng_common -from chirp import chirp_common, directory, memmap -from chirp import bitwise, errors, util +from chirp import chirp_common, directory +from chirp import bitwise from chirp import bandplan_na from chirp.settings import RadioSettingGroup, RadioSetting, \ RadioSettingValueBoolean, RadioSettingValueList, \ diff --git a/chirp/drivers/hg_uv98.py b/chirp/drivers/hg_uv98.py index fdaf0050a..7b14ce150 100644 --- a/chirp/drivers/hg_uv98.py +++ b/chirp/drivers/hg_uv98.py @@ -27,7 +27,7 @@ from chirp import bitwise from chirp.settings import RadioSettingGroup, RadioSetting from chirp.settings import RadioSettingValueBoolean, RadioSettingValueList -from chirp.settings import RadioSettingValueString, RadioSettings +from chirp.settings import RadioSettings LOG = logging.getLogger(__name__) diff --git a/chirp/drivers/hobbypcb.py b/chirp/drivers/hobbypcb.py index c28cfe3b1..128f19ef0 100644 --- a/chirp/drivers/hobbypcb.py +++ b/chirp/drivers/hobbypcb.py @@ -16,8 +16,7 @@ import logging import time -from chirp import chirp_common, directory, memmap, errors -from chirp import bitwise +from chirp import chirp_common, directory, errors from chirp.settings import RadioSetting, RadioSettingGroup, \ RadioSettingValueInteger, RadioSettingValueList, \ RadioSettingValueBoolean, RadioSettingValueString, \ diff --git a/chirp/drivers/ic2100.py b/chirp/drivers/ic2100.py index e17f5a2a6..ed0b0163c 100644 --- a/chirp/drivers/ic2100.py +++ b/chirp/drivers/ic2100.py @@ -16,9 +16,7 @@ from chirp.drivers import icf from chirp import chirp_common, util, directory, bitwise, memmap from chirp.settings import RadioSetting, RadioSettingGroup, \ - RadioSettingValueInteger, RadioSettingValueList, \ - RadioSettingValueBoolean, RadioSettingValueString, \ - RadioSettingValueFloat, InvalidValueError, RadioSettings + RadioSettingValueBoolean MEM_FORMAT = """ struct { diff --git a/chirp/drivers/ic2730.py b/chirp/drivers/ic2730.py index 24bc9d1ab..7d7634450 100644 --- a/chirp/drivers/ic2730.py +++ b/chirp/drivers/ic2730.py @@ -19,12 +19,11 @@ import logging from chirp.drivers import icf -from chirp import chirp_common, util, directory, bitwise, memmap -from chirp import errors +from chirp import chirp_common, directory, bitwise from chirp.settings import RadioSettingGroup, RadioSetting, \ RadioSettingValueBoolean, RadioSettingValueList, \ RadioSettingValueString, RadioSettingValueInteger, \ - RadioSettingValueFloat, RadioSettings, InvalidValueError + RadioSettingValueFloat, RadioSettings LOG = logging.getLogger(__name__) diff --git a/chirp/drivers/icf.py b/chirp/drivers/icf.py index 8fac46032..133737bb0 100644 --- a/chirp/drivers/icf.py +++ b/chirp/drivers/icf.py @@ -24,11 +24,10 @@ import logging import struct -from chirp import bitwise from chirp import chirp_common, errors, util, memmap from chirp import directory from chirp.settings import RadioSetting, RadioSettingGroup, \ - RadioSettingValueBoolean, RadioSettingValueString, RadioSettings + RadioSettingValueString, RadioSettings from chirp import util LOG = logging.getLogger(__name__) diff --git a/chirp/drivers/icomciv.py b/chirp/drivers/icomciv.py index 985f11090..31359635e 100644 --- a/chirp/drivers/icomciv.py +++ b/chirp/drivers/icomciv.py @@ -1,5 +1,4 @@ # Latest update: April, 2021 Add hasattr test at line 564 -import serial import struct import logging from chirp.drivers import icf diff --git a/chirp/drivers/icq7.py b/chirp/drivers/icq7.py index d90b42405..c5dd8070b 100644 --- a/chirp/drivers/icq7.py +++ b/chirp/drivers/icq7.py @@ -20,8 +20,7 @@ from chirp.chirp_common import to_GHz, from_GHz from chirp.settings import RadioSetting, RadioSettingGroup, \ RadioSettingValueBoolean, RadioSettingValueList, \ - RadioSettingValueInteger, RadioSettingValueString, \ - RadioSettingValueFloat, RadioSettings + RadioSettingValueInteger, RadioSettings LOG = logging.getLogger(__name__) diff --git a/chirp/drivers/icv80.py b/chirp/drivers/icv80.py index 884685a59..f43ea1187 100644 --- a/chirp/drivers/icv80.py +++ b/chirp/drivers/icv80.py @@ -16,11 +16,10 @@ import logging from chirp.drivers import icf -from chirp import chirp_common, memmap, bitwise, errors, directory +from chirp import chirp_common, bitwise, errors, directory from chirp.settings import RadioSetting, RadioSettingGroup, \ - RadioSettingValueInteger, RadioSettingValueList, \ - RadioSettingValueBoolean, RadioSettingValueString, \ - RadioSettingValueFloat, RadioSettings + RadioSettingValueList, RadioSettingValueBoolean, \ + RadioSettings LOG = logging.getLogger(__name__) diff --git a/chirp/drivers/icv86.py b/chirp/drivers/icv86.py index ad696268a..2558d6528 100644 --- a/chirp/drivers/icv86.py +++ b/chirp/drivers/icv86.py @@ -16,11 +16,10 @@ import logging from chirp.drivers import icf -from chirp import chirp_common, memmap, bitwise, errors, directory +from chirp import chirp_common, bitwise, errors, directory from chirp.settings import RadioSetting, RadioSettingGroup, \ RadioSettingValueInteger, RadioSettingValueList, \ - RadioSettingValueBoolean, RadioSettingValueString, \ - RadioSettingValueFloat, RadioSettings + RadioSettingValueBoolean, RadioSettings LOG = logging.getLogger(__name__) diff --git a/chirp/drivers/icx90.py b/chirp/drivers/icx90.py index c403d3c41..4d1f1a86a 100644 --- a/chirp/drivers/icx90.py +++ b/chirp/drivers/icx90.py @@ -19,11 +19,10 @@ from chirp.drivers import icf from chirp import chirp_common, bitwise, errors, directory -from chirp.memmap import MemoryMap from chirp.settings import RadioSetting, RadioSettingGroup, \ RadioSettingValueInteger, RadioSettingValueList, \ RadioSettingValueBoolean, RadioSettingValueString, \ - RadioSettingValueFloat, InvalidValueError, RadioSettings + RadioSettings import argparse ICX90_MEM_FORMAT = """ diff --git a/chirp/drivers/iradio_uv_5118.py b/chirp/drivers/iradio_uv_5118.py index f15ceba3f..a78840756 100644 --- a/chirp/drivers/iradio_uv_5118.py +++ b/chirp/drivers/iradio_uv_5118.py @@ -20,8 +20,8 @@ from chirp import bitwise, errors, util from chirp.settings import RadioSetting, RadioSettingGroup, \ RadioSettingValueInteger, RadioSettingValueList, \ - RadioSettingValueBoolean, RadioSettingValueString, \ - RadioSettingValueFloat, RadioSettings + RadioSettingValueBoolean, RadioSettingValueFloat, \ + RadioSettings LOG = logging.getLogger(__name__) diff --git a/chirp/drivers/kguv920pa.py b/chirp/drivers/kguv920pa.py index b1ed296ea..903ec1761 100644 --- a/chirp/drivers/kguv920pa.py +++ b/chirp/drivers/kguv920pa.py @@ -21,8 +21,7 @@ from chirp.settings import RadioSetting, RadioSettingGroup, \ RadioSettingValueBoolean, RadioSettingValueList, \ RadioSettingValueInteger, RadioSettingValueString, \ - RadioSettingValueMap, RadioSettingValueFloat, RadioSettings, \ - InvalidValueError + RadioSettingValueMap, RadioSettingValueFloat, RadioSettings import struct LOG = logging.getLogger(__name__) diff --git a/chirp/drivers/kguv9dplus.py b/chirp/drivers/kguv9dplus.py index 3dc0e9210..2c89e8d77 100644 --- a/chirp/drivers/kguv9dplus.py +++ b/chirp/drivers/kguv9dplus.py @@ -24,12 +24,12 @@ import time import logging import struct -from chirp import util, chirp_common, bitwise, memmap, errors, directory -from chirp.settings import RadioSetting, RadioSettingValue, \ - RadioSettingGroup, \ - RadioSettingValueBoolean, RadioSettingValueList, \ - RadioSettingValueInteger, RadioSettingValueString, \ - RadioSettings, InvalidValueError +from chirp import chirp_common, bitwise, memmap, errors, directory +from chirp.settings import RadioSetting, RadioSettingGroup, \ + RadioSettingValueBoolean, \ + RadioSettingValueList, RadioSettingValueInteger, \ + RadioSettingValueString, RadioSettings, \ + InvalidValueError LOG = logging.getLogger(__name__) diff --git a/chirp/drivers/kyd_IP620.py b/chirp/drivers/kyd_IP620.py index 157083959..8e19eb700 100644 --- a/chirp/drivers/kyd_IP620.py +++ b/chirp/drivers/kyd_IP620.py @@ -25,9 +25,7 @@ import logging from chirp import util, chirp_common, bitwise, memmap, errors, directory from chirp.settings import RadioSetting, RadioSettingGroup, \ - RadioSettingValueBoolean, RadioSettingValueList, \ - RadioSettingValueInteger, RadioSettingValueString, \ - RadioSettings + RadioSettingValueList, RadioSettings LOG = logging.getLogger(__name__) diff --git a/chirp/drivers/leixen.py b/chirp/drivers/leixen.py index 9d6037c42..6450fc536 100644 --- a/chirp/drivers/leixen.py +++ b/chirp/drivers/leixen.py @@ -21,7 +21,7 @@ from chirp.settings import RadioSetting, RadioSettingGroup, \ RadioSettingValueInteger, RadioSettingValueList, \ RadioSettingValueBoolean, RadioSettingValueString, \ - RadioSettingValueFloat, InvalidValueError, RadioSettings + RadioSettings LOG = logging.getLogger(__name__) diff --git a/chirp/drivers/mursv1.py b/chirp/drivers/mursv1.py index 51dd4a740..f53345a16 100644 --- a/chirp/drivers/mursv1.py +++ b/chirp/drivers/mursv1.py @@ -17,14 +17,13 @@ import logging from chirp.drivers import baofeng_common -from chirp import chirp_common, directory, memmap -from chirp import bitwise, errors, util +from chirp import chirp_common, directory +from chirp import bitwise from chirp import bandplan_na from chirp.settings import RadioSettingGroup, RadioSetting, \ RadioSettingValueBoolean, RadioSettingValueList, \ RadioSettingValueString, RadioSettingValueInteger, \ - RadioSettingValueFloat, RadioSettings, \ - InvalidValueError + RadioSettingValueFloat, RadioSettings LOG = logging.getLogger(__name__) diff --git a/chirp/drivers/radioddity_r2.py b/chirp/drivers/radioddity_r2.py index f278a6619..a1c358e90 100644 --- a/chirp/drivers/radioddity_r2.py +++ b/chirp/drivers/radioddity_r2.py @@ -21,8 +21,7 @@ from chirp import bitwise, errors, util from chirp.settings import RadioSetting, RadioSettingGroup, \ RadioSettingValueInteger, RadioSettingValueList, \ - RadioSettingValueBoolean, RadioSettings, \ - RadioSettingValueString + RadioSettingValueBoolean, RadioSettings LOG = logging.getLogger(__name__) diff --git a/chirp/drivers/retevis_rb15.py b/chirp/drivers/retevis_rb15.py index eaf28d1e4..1bf83f9c6 100644 --- a/chirp/drivers/retevis_rb15.py +++ b/chirp/drivers/retevis_rb15.py @@ -21,8 +21,7 @@ from chirp import bandplan_na from chirp.settings import RadioSetting, RadioSettingGroup, \ RadioSettingValueInteger, RadioSettingValueList, \ - RadioSettingValueBoolean, RadioSettingValueString, \ - RadioSettings + RadioSettingValueBoolean, RadioSettings LOG = logging.getLogger(__name__) diff --git a/chirp/drivers/retevis_rb28.py b/chirp/drivers/retevis_rb28.py index 529b391ee..bdca7ef79 100644 --- a/chirp/drivers/retevis_rb28.py +++ b/chirp/drivers/retevis_rb28.py @@ -33,7 +33,6 @@ RadioSettingValueBoolean, RadioSettingValueInteger, RadioSettingValueList, - RadioSettingValueString, ) LOG = logging.getLogger(__name__) diff --git a/chirp/drivers/retevis_rt1.py b/chirp/drivers/retevis_rt1.py index 0877f2209..ca95d1e2c 100644 --- a/chirp/drivers/retevis_rt1.py +++ b/chirp/drivers/retevis_rt1.py @@ -20,8 +20,7 @@ from chirp import bitwise, errors, util from chirp.settings import RadioSetting, RadioSettingGroup, \ RadioSettingValueInteger, RadioSettingValueList, \ - RadioSettingValueBoolean, RadioSettingValueString, \ - InvalidValueError, RadioSettings + RadioSettingValueBoolean, RadioSettings LOG = logging.getLogger(__name__) diff --git a/chirp/drivers/retevis_rt21.py b/chirp/drivers/retevis_rt21.py index 72fe683c6..1f11169b4 100644 --- a/chirp/drivers/retevis_rt21.py +++ b/chirp/drivers/retevis_rt21.py @@ -31,7 +31,6 @@ RadioSettingValueBoolean, RadioSettingValueInteger, RadioSettingValueList, - RadioSettingValueString, ) LOG = logging.getLogger(__name__) diff --git a/chirp/drivers/retevis_rt26.py b/chirp/drivers/retevis_rt26.py index 895dc6c25..a993c4afc 100644 --- a/chirp/drivers/retevis_rt26.py +++ b/chirp/drivers/retevis_rt26.py @@ -22,7 +22,7 @@ from chirp.settings import RadioSetting, RadioSettingGroup, \ RadioSettingValueInteger, RadioSettingValueList, \ RadioSettingValueBoolean, RadioSettingValueString, \ - InvalidValueError, RadioSettings + RadioSettings LOG = logging.getLogger(__name__) diff --git a/chirp/drivers/retevis_rt76p.py b/chirp/drivers/retevis_rt76p.py index e06e6c6d6..72c981e80 100644 --- a/chirp/drivers/retevis_rt76p.py +++ b/chirp/drivers/retevis_rt76p.py @@ -29,7 +29,6 @@ RadioSettingGroup, RadioSettings, RadioSettingValueBoolean, - RadioSettingValueFloat, RadioSettingValueInteger, RadioSettingValueList, RadioSettingValueString, diff --git a/chirp/drivers/retevis_rt98.py b/chirp/drivers/retevis_rt98.py index edfa2c795..e5c667a2d 100644 --- a/chirp/drivers/retevis_rt98.py +++ b/chirp/drivers/retevis_rt98.py @@ -24,8 +24,7 @@ from chirp import util from chirp.settings import RadioSettingGroup, RadioSetting, RadioSettings, \ RadioSettingValueList, RadioSettingValueString, RadioSettingValueBoolean, \ - RadioSettingValueInteger, RadioSettingValueString, \ - RadioSettingValueFloat, InvalidValueError + RadioSettingValueInteger, RadioSettingValueString LOG = logging.getLogger(__name__) diff --git a/chirp/drivers/rh5r_v2.py b/chirp/drivers/rh5r_v2.py index bb7e5e3ae..b29758447 100644 --- a/chirp/drivers/rh5r_v2.py +++ b/chirp/drivers/rh5r_v2.py @@ -18,11 +18,7 @@ import struct import logging -from chirp import chirp_common, bitwise, errors, directory, memmap, util -from chirp.settings import RadioSetting, RadioSettingGroup, \ - RadioSettingValueInteger, RadioSettingValueList, \ - RadioSettingValueBoolean, RadioSettingValueString, \ - RadioSettings +from chirp import chirp_common, bitwise, errors, directory, memmap LOG = logging.getLogger(__name__) diff --git a/chirp/drivers/tdxone_tdq8a.py b/chirp/drivers/tdxone_tdq8a.py index d35d2aca8..57044e5d7 100644 --- a/chirp/drivers/tdxone_tdq8a.py +++ b/chirp/drivers/tdxone_tdq8a.py @@ -23,8 +23,7 @@ from chirp.settings import RadioSettingGroup, RadioSetting, \ RadioSettingValueBoolean, RadioSettingValueList, \ RadioSettingValueString, RadioSettingValueInteger, \ - RadioSettingValueFloat, RadioSettings, \ - InvalidValueError + RadioSettings LOG = logging.getLogger(__name__) diff --git a/chirp/drivers/tg_uv2p.py b/chirp/drivers/tg_uv2p.py index cf59d8cab..44494ed5f 100644 --- a/chirp/drivers/tg_uv2p.py +++ b/chirp/drivers/tg_uv2p.py @@ -23,8 +23,8 @@ from chirp import chirp_common, directory, bitwise, memmap, errors, util from chirp.settings import RadioSetting, RadioSettingGroup, \ RadioSettingValueBoolean, RadioSettingValueList, \ - RadioSettingValueInteger, RadioSettingValueString, \ - RadioSettingValueFloat, RadioSettingValueMap, RadioSettings + RadioSettingValueInteger, RadioSettingValueFloat, \ + RadioSettingValueMap, RadioSettings LOG = logging.getLogger(__name__) diff --git a/chirp/drivers/th7800.py b/chirp/drivers/th7800.py index d765f6e14..1d8abd92c 100644 --- a/chirp/drivers/th7800.py +++ b/chirp/drivers/th7800.py @@ -19,9 +19,8 @@ from chirp import bitwise, chirp_common, directory, errors, util, memmap import struct from chirp.settings import RadioSetting, RadioSettingGroup, \ - RadioSettingValueInteger, RadioSettingValueList, \ - RadioSettingValueBoolean, RadioSettingValueString, \ - RadioSettingValueFloat, InvalidValueError, RadioSettings, \ + RadioSettingValueInteger, RadioSettingValueBoolean, \ + RadioSettingValueString, RadioSettings, \ RadioSettingValueMap, zero_indexed_seq_map from chirp.chirp_common import format_freq import logging diff --git a/chirp/drivers/th9000.py b/chirp/drivers/th9000.py index ebd2c65b5..fef716e05 100644 --- a/chirp/drivers/th9000.py +++ b/chirp/drivers/th9000.py @@ -23,9 +23,8 @@ from chirp import memmap from chirp import util from chirp.settings import RadioSettingGroup, RadioSetting, RadioSettings, \ - RadioSettingValueList, RadioSettingValueString, RadioSettingValueBoolean, \ - RadioSettingValueInteger, RadioSettingValueString, \ - RadioSettingValueFloat, InvalidValueError + RadioSettingValueList, RadioSettingValueString, RadioSettingValueInteger, \ + RadioSettingValueString LOG = logging.getLogger(__name__) diff --git a/chirp/drivers/th9800.py b/chirp/drivers/th9800.py index cf3a05d78..1fe3e8ffc 100644 --- a/chirp/drivers/th9800.py +++ b/chirp/drivers/th9800.py @@ -20,7 +20,7 @@ from chirp.settings import RadioSetting, RadioSettingGroup, \ RadioSettingValueInteger, RadioSettingValueList, \ RadioSettingValueBoolean, RadioSettingValueString, \ - RadioSettingValueFloat, InvalidValueError, RadioSettings + RadioSettings from chirp.chirp_common import format_freq import logging from datetime import date diff --git a/chirp/drivers/th_uv3r25.py b/chirp/drivers/th_uv3r25.py index 756d3f5a2..0bd5a2bff 100644 --- a/chirp/drivers/th_uv3r25.py +++ b/chirp/drivers/th_uv3r25.py @@ -19,8 +19,7 @@ from chirp.drivers.wouxun import do_download, do_upload from chirp.settings import RadioSetting, RadioSettingGroup, \ - RadioSettingValueInteger, RadioSettingValueList, \ - RadioSettingValueBoolean, RadioSettingValueString + RadioSettingValueList, RadioSettingValueBoolean from chirp.drivers.th_uv3r import TYTUV3RRadio, tyt_uv3r_prep, THUV3R_CHARSET diff --git a/chirp/drivers/th_uv8000.py b/chirp/drivers/th_uv8000.py index 1e7b69ceb..ed254fe14 100644 --- a/chirp/drivers/th_uv8000.py +++ b/chirp/drivers/th_uv8000.py @@ -26,7 +26,7 @@ from chirp.settings import RadioSettingGroup, RadioSetting, \ RadioSettingValueBoolean, RadioSettingValueList, \ RadioSettingValueString, RadioSettingValueInteger, \ - RadioSettingValueFloat, RadioSettings, InvalidValueError + RadioSettingValueFloat, RadioSettings LOG = logging.getLogger(__name__) diff --git a/chirp/drivers/th_uv88.py b/chirp/drivers/th_uv88.py index 2b9ce65fb..5a6eba1b2 100644 --- a/chirp/drivers/th_uv88.py +++ b/chirp/drivers/th_uv88.py @@ -24,7 +24,7 @@ from chirp.settings import RadioSettingGroup, RadioSetting, \ RadioSettingValueBoolean, RadioSettingValueList, \ RadioSettingValueString, RadioSettingValueInteger, \ - RadioSettingValueFloat, RadioSettings, InvalidValueError + RadioSettingValueFloat, RadioSettings LOG = logging.getLogger(__name__) diff --git a/chirp/drivers/thd72.py b/chirp/drivers/thd72.py index aac72ab82..44daacd13 100644 --- a/chirp/drivers/thd72.py +++ b/chirp/drivers/thd72.py @@ -14,12 +14,12 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -from chirp import chirp_common, errors, util, directory +from chirp import chirp_common, errors, directory from chirp import bitwise, memmap from chirp.drivers import kenwood_live from chirp.settings import RadioSettingGroup, RadioSetting, RadioSettings -from chirp.settings import RadioSettingValueInteger, RadioSettingValueString -from chirp.settings import RadioSettingValueList, RadioSettingValueBoolean +from chirp.settings import RadioSettingValueString +from chirp.settings import RadioSettingValueList import time import struct import sys @@ -774,7 +774,6 @@ def match_model(cls, filedata, filename): if __name__ == "__main__": import sys import serial - import detect import getopt def fixopts(opts): diff --git a/chirp/drivers/tk270.py b/chirp/drivers/tk270.py index e81e2fe17..d23f71064 100644 --- a/chirp/drivers/tk270.py +++ b/chirp/drivers/tk270.py @@ -23,8 +23,7 @@ from chirp import bitwise, errors, util from chirp.settings import RadioSettingGroup, RadioSetting, \ RadioSettingValueBoolean, RadioSettingValueList, \ - RadioSettingValueString, RadioSettingValueInteger, \ - RadioSettings + RadioSettingValueString, RadioSettings MEM_FORMAT = """ #seekto 0x0010; diff --git a/chirp/drivers/tk760.py b/chirp/drivers/tk760.py index 5193360c0..d906e14b2 100644 --- a/chirp/drivers/tk760.py +++ b/chirp/drivers/tk760.py @@ -17,8 +17,7 @@ from chirp import bitwise, errors, util from chirp.settings import RadioSettingGroup, RadioSetting, \ RadioSettingValueBoolean, RadioSettingValueList, \ - RadioSettingValueString, RadioSettingValueInteger, \ - RadioSettings + RadioSettingValueString, RadioSettings import time import struct diff --git a/chirp/drivers/tmd710.py b/chirp/drivers/tmd710.py index 493179dba..cd3fe40ff 100644 --- a/chirp/drivers/tmd710.py +++ b/chirp/drivers/tmd710.py @@ -23,7 +23,7 @@ from chirp.settings import RadioSettingGroup, RadioSetting, \ RadioSettingValueBoolean, RadioSettingValueList, \ RadioSettingValueString, RadioSettingValueInteger, \ - RadioSettingValueFloat, RadioSettings, InvalidValueError + RadioSettingValueFloat, RadioSettings from chirp.drivers import kenwood_live LOG = logging.getLogger(__name__) diff --git a/chirp/drivers/ts480.py b/chirp/drivers/ts480.py index d41b19814..731e49cb9 100644 --- a/chirp/drivers/ts480.py +++ b/chirp/drivers/ts480.py @@ -18,11 +18,11 @@ import time import logging from chirp import chirp_common, directory, memmap -from chirp import bitwise, errors, util +from chirp import bitwise, errors from chirp.settings import RadioSettingGroup, RadioSetting, \ RadioSettingValueBoolean, RadioSettingValueList, \ RadioSettingValueString, RadioSettingValueInteger, \ - RadioSettingValueFloat, RadioSettings, InvalidValueError + RadioSettingValueFloat, RadioSettings LOG = logging.getLogger(__name__) diff --git a/chirp/drivers/ts590.py b/chirp/drivers/ts590.py index 495d288cf..dc926f909 100644 --- a/chirp/drivers/ts590.py +++ b/chirp/drivers/ts590.py @@ -20,11 +20,11 @@ import logging import threading from chirp import chirp_common, directory, memmap -from chirp import bitwise, errors, util +from chirp import bitwise, errors from chirp.settings import RadioSettingGroup, RadioSetting, \ RadioSettingValueBoolean, RadioSettingValueList, \ RadioSettingValueString, RadioSettingValueInteger, \ - RadioSettingValueFloat, RadioSettings, InvalidValueError + RadioSettingValueFloat, RadioSettings LOG = logging.getLogger(__name__) diff --git a/chirp/drivers/uv5x3.py b/chirp/drivers/uv5x3.py index 01212aded..3f633e97d 100644 --- a/chirp/drivers/uv5x3.py +++ b/chirp/drivers/uv5x3.py @@ -17,8 +17,8 @@ import logging from chirp.drivers import baofeng_common -from chirp import chirp_common, directory, memmap -from chirp import bitwise, errors, util +from chirp import chirp_common, directory +from chirp import bitwise from chirp.settings import RadioSettingGroup, RadioSetting, \ RadioSettingValueBoolean, RadioSettingValueList, \ RadioSettingValueString, RadioSettingValueInteger, \ diff --git a/chirp/drivers/uv6r.py b/chirp/drivers/uv6r.py index e5e2d1412..0acca29fb 100644 --- a/chirp/drivers/uv6r.py +++ b/chirp/drivers/uv6r.py @@ -17,8 +17,8 @@ import logging from chirp.drivers import baofeng_common -from chirp import chirp_common, directory, memmap -from chirp import bitwise, errors, util +from chirp import chirp_common, directory +from chirp import bitwise from chirp.settings import RadioSettingGroup, RadioSetting, \ RadioSettingValueBoolean, RadioSettingValueList, \ RadioSettingValueString, RadioSettingValueInteger, \ diff --git a/chirp/drivers/vx170.py b/chirp/drivers/vx170.py index 9260f3fad..0f81c8b7d 100644 --- a/chirp/drivers/vx170.py +++ b/chirp/drivers/vx170.py @@ -14,7 +14,7 @@ # along with this program. If not, see . from chirp.drivers import yaesu_clone, ft7800 -from chirp import chirp_common, directory, memmap, bitwise, errors +from chirp import chirp_common, directory, bitwise MEM_FORMAT = """ #seekto 0x018A; diff --git a/chirp/drivers/vx2.py b/chirp/drivers/vx2.py index 71be286dd..5e272f869 100644 --- a/chirp/drivers/vx2.py +++ b/chirp/drivers/vx2.py @@ -17,9 +17,8 @@ from chirp.drivers import yaesu_clone from chirp import chirp_common, directory, bitwise from chirp.settings import RadioSetting, RadioSettingGroup, \ - RadioSettingValueInteger, RadioSettingValueList, \ - RadioSettingValueBoolean, RadioSettingValueString, \ - RadioSettings + RadioSettingValueList, RadioSettingValueBoolean, \ + RadioSettingValueString, RadioSettings import re import logging diff --git a/chirp/drivers/vx3.py b/chirp/drivers/vx3.py index 3e81a0058..1a52ebb9c 100644 --- a/chirp/drivers/vx3.py +++ b/chirp/drivers/vx3.py @@ -17,9 +17,8 @@ from chirp.drivers import yaesu_clone from chirp import chirp_common, directory, bitwise from chirp.settings import RadioSetting, RadioSettingGroup, \ - RadioSettingValueInteger, RadioSettingValueList, \ - RadioSettingValueBoolean, RadioSettingValueString, \ - RadioSettings + RadioSettingValueList, RadioSettingValueBoolean, \ + RadioSettingValueString, RadioSettings import re import logging From 9e9d2875ccbd05407887181dcf1dcc40def12884 Mon Sep 17 00:00:00 2001 From: Daniele Forsi Date: Mon, 19 Jun 2023 22:37:21 +0200 Subject: [PATCH 06/13] Remove unused variable in except clauses Fixes: F841 local variable 'e' is assigned to but never used --- chirp/drivers/anytone778uv.py | 4 ++-- chirp/drivers/anytone_ht.py | 2 +- chirp/drivers/baofeng_common.py | 6 +++--- chirp/drivers/baofeng_uv3r.py | 6 +++--- chirp/drivers/bf_t1.py | 2 +- chirp/drivers/bf_t8.py | 2 +- chirp/drivers/bjuv55.py | 2 +- chirp/drivers/btech.py | 2 +- chirp/drivers/fd268.py | 6 +++--- chirp/drivers/ft1d.py | 2 +- chirp/drivers/ft2900.py | 2 +- chirp/drivers/ft450d.py | 2 +- chirp/drivers/ft60.py | 2 +- chirp/drivers/ft70.py | 2 +- chirp/drivers/ft7800.py | 2 +- chirp/drivers/ft90.py | 6 +++--- chirp/drivers/ftlx011.py | 4 ++-- chirp/drivers/generic_csv.py | 2 +- chirp/drivers/h777.py | 2 +- chirp/drivers/ic2730.py | 2 +- chirp/drivers/icf.py | 4 ++-- chirp/drivers/icq7.py | 2 +- chirp/drivers/icv80.py | 2 +- chirp/drivers/icv86.py | 2 +- chirp/drivers/icx90.py | 2 +- chirp/drivers/iradio_uv_5118.py | 2 +- chirp/drivers/kg935g.py | 2 +- chirp/drivers/kguv8e.py | 2 +- chirp/drivers/kguv9dplus.py | 2 +- chirp/drivers/kyd.py | 2 +- chirp/drivers/kyd_IP620.py | 4 ++-- chirp/drivers/leixen.py | 2 +- chirp/drivers/lt725uv.py | 2 +- chirp/drivers/radioddity_r2.py | 2 +- chirp/drivers/radtel_t18.py | 2 +- chirp/drivers/retevis_rb15.py | 2 +- chirp/drivers/retevis_rb17p.py | 2 +- chirp/drivers/retevis_rb28.py | 2 +- chirp/drivers/retevis_rt1.py | 2 +- chirp/drivers/retevis_rt21.py | 2 +- chirp/drivers/retevis_rt22.py | 2 +- chirp/drivers/retevis_rt23.py | 2 +- chirp/drivers/retevis_rt26.py | 2 +- chirp/drivers/retevis_rt76p.py | 2 +- chirp/drivers/retevis_rt87.py | 2 +- chirp/drivers/retevis_rt98.py | 4 ++-- chirp/drivers/tdxone_tdq8a.py | 4 ++-- chirp/drivers/tg_uv2p.py | 2 +- chirp/drivers/th7800.py | 2 +- chirp/drivers/th9000.py | 2 +- chirp/drivers/th9800.py | 2 +- chirp/drivers/th_uv8000.py | 2 +- chirp/drivers/th_uv88.py | 2 +- chirp/drivers/thd72.py | 2 +- chirp/drivers/tmd710.py | 2 +- chirp/drivers/ts480.py | 2 +- chirp/drivers/ts590.py | 2 +- chirp/drivers/uv5r.py | 6 +++--- chirp/drivers/uvb5.py | 4 ++-- chirp/drivers/vgc.py | 2 +- chirp/drivers/vx2.py | 2 +- chirp/drivers/vx3.py | 2 +- chirp/drivers/vx6.py | 2 +- chirp/drivers/vx8.py | 2 +- chirp/drivers/wouxun.py | 10 +++++----- 65 files changed, 86 insertions(+), 86 deletions(-) diff --git a/chirp/drivers/anytone778uv.py b/chirp/drivers/anytone778uv.py index a320be3d3..8ba5d8422 100644 --- a/chirp/drivers/anytone778uv.py +++ b/chirp/drivers/anytone778uv.py @@ -690,7 +690,7 @@ def get_features(self): try: rf.valid_bands = get_band_limits_Hz( int(self._memobj.radio_settings.bandlimit)) - except AttributeError as e: + except AttributeError: # If we're asked without memory loaded, assume the most permissive rf.valid_bands = get_band_limits_Hz(1) except Exception as e: @@ -1724,7 +1724,7 @@ def set_settings(self, settings): elif element.value.get_mutable(): LOG.debug("Setting %s = %s" % (setting, element.value)) setattr(obj, setting, element.value) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/anytone_ht.py b/chirp/drivers/anytone_ht.py index dcd4a9116..e396232dd 100644 --- a/chirp/drivers/anytone_ht.py +++ b/chirp/drivers/anytone_ht.py @@ -938,7 +938,7 @@ def set_settings(self, settings): else: LOG.debug("Setting %s = %s" % (setting, element.value)) setattr(obj, setting, element.value) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/baofeng_common.py b/chirp/drivers/baofeng_common.py index b66314351..f5b09d123 100644 --- a/chirp/drivers/baofeng_common.py +++ b/chirp/drivers/baofeng_common.py @@ -366,7 +366,7 @@ def sync_out(self): _upload(self) except errors.RadioError: raise - except Exception as e: + except Exception: # If anything unexpected happens, make sure we raise # a RadioError and log the problem LOG.exception('Unexpected error during upload') @@ -734,7 +734,7 @@ def set_settings(self, settings): elif element.value.get_mutable(): LOG.debug("Setting %s = %s" % (setting, element.value)) setattr(obj, setting, element.value) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise @@ -750,6 +750,6 @@ def _set_fm_preset(self, settings): if self._bw_shift: value = ((value & 0x00FF) << 8) | ((value & 0xFF00) >> 8) self._memobj.fm_presets = value - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/baofeng_uv3r.py b/chirp/drivers/baofeng_uv3r.py index 7d9df38c1..4ea476d95 100644 --- a/chirp/drivers/baofeng_uv3r.py +++ b/chirp/drivers/baofeng_uv3r.py @@ -50,7 +50,7 @@ def uv3r_prep(radio): for _i in range(0, 10): try: return _uv3r_prep(radio) - except errors.RadioError as e: + except errors.RadioError: time.sleep(1) raise e @@ -623,7 +623,7 @@ def set_settings(self, settings): else: LOG.debug("Setting %s = %s" % (setting, element.value)) setattr(obj, setting, element.value) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise @@ -639,7 +639,7 @@ def _set_fm_preset(self, settings): LOG.debug("Setting fm_presets[%1i] = %s" % (index, value)) setting = self._memobj.fm_presets setting[index] = value - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/bf_t1.py b/chirp/drivers/bf_t1.py index b278fe4fd..496af8d0f 100644 --- a/chirp/drivers/bf_t1.py +++ b/chirp/drivers/bf_t1.py @@ -904,7 +904,7 @@ def set_settings(self, uisettings): setattr(_settings, name, value) LOG.debug("Setting %s: %s" % (name, value)) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/bf_t8.py b/chirp/drivers/bf_t8.py index 4f8045004..0b969b5c5 100644 --- a/chirp/drivers/bf_t8.py +++ b/chirp/drivers/bf_t8.py @@ -811,7 +811,7 @@ def set_settings(self, settings): elif element.value.get_mutable(): LOG.debug("Setting %s = %s" % (setting, element.value)) setattr(obj, setting, element.value) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/bjuv55.py b/chirp/drivers/bjuv55.py index eb3191610..5be6cd6e8 100644 --- a/chirp/drivers/bjuv55.py +++ b/chirp/drivers/bjuv55.py @@ -643,6 +643,6 @@ def _set_fm_preset(self, settings): value = int(val.get_value() * 10 - 870) LOG.debug("Setting fm_preset = %s" % (value)) self._memobj.fm_preset = value - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/btech.py b/chirp/drivers/btech.py index aaadbffd5..fff15e698 100644 --- a/chirp/drivers/btech.py +++ b/chirp/drivers/btech.py @@ -3120,7 +3120,7 @@ def set_settings(self, settings): elif element.value.get_mutable(): LOG.debug("Setting %s = %s" % (setting, element.value)) setattr(obj, setting, element.value) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/fd268.py b/chirp/drivers/fd268.py index 317e32c9d..5d73d5f29 100644 --- a/chirp/drivers/fd268.py +++ b/chirp/drivers/fd268.py @@ -758,7 +758,7 @@ def handle_warning(_settings, settings): try: element.run_apply_callback() continue - except NotImplementedError as e: + except NotImplementedError: raise elif sett == "none": @@ -776,11 +776,11 @@ def handle_warning(_settings, settings): obj = getattr(_mem, sett) setattr(obj, name, element.value) - except AttributeError as e: + except AttributeError: m = "Setting %s is not in this setting block" % name LOG.debug(m) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/ft1d.py b/chirp/drivers/ft1d.py index ea14d1be3..211edc332 100644 --- a/chirp/drivers/ft1d.py +++ b/chirp/drivers/ft1d.py @@ -2471,7 +2471,7 @@ def set_settings(self, settings): except AttributeError as e: LOG.error("Setting %s is not in the memory map: %s" % (element.get_name(), e)) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/ft2900.py b/chirp/drivers/ft2900.py index f28daa332..47b76b726 100644 --- a/chirp/drivers/ft2900.py +++ b/chirp/drivers/ft2900.py @@ -1210,7 +1210,7 @@ def set_settings(self, uisettings): setattr(_settings, name, value) LOG.debug("Setting %s: %s" % (name, value)) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/ft450d.py b/chirp/drivers/ft450d.py index 9700b5a96..192e4d22d 100644 --- a/chirp/drivers/ft450d.py +++ b/chirp/drivers/ft450d.py @@ -1486,6 +1486,6 @@ def set_settings(self, settings): elif element.value.get_mutable(): LOG.debug("Setting %s = %s" % (setting, element.value)) setattr(obj, setting, element.value) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/ft60.py b/chirp/drivers/ft60.py index 0289684b2..dd6ba612a 100644 --- a/chirp/drivers/ft60.py +++ b/chirp/drivers/ft60.py @@ -716,7 +716,7 @@ def set_settings(self, uisettings): setattr(_settings, name, value) LOG.debug("Setting %s: %s" % (name, value)) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/ft70.py b/chirp/drivers/ft70.py index 10d0d3ef2..f668a74df 100644 --- a/chirp/drivers/ft70.py +++ b/chirp/drivers/ft70.py @@ -1186,7 +1186,7 @@ def set_settings(self, settings): except AttributeError as e: LOG.error("Setting %s is not in the memory map: %s" % (element.get_name(), e)) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/ft7800.py b/chirp/drivers/ft7800.py index d5e107c0d..87db2784e 100644 --- a/chirp/drivers/ft7800.py +++ b/chirp/drivers/ft7800.py @@ -766,7 +766,7 @@ def set_settings(self, uisettings): oldval = getattr(_settings, setting) LOG.debug("Setting %s(%s) <= %s" % (setting, oldval, newval)) setattr(_settings, setting, newval) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/ft90.py b/chirp/drivers/ft90.py index 6a196c33d..fe0362cab 100644 --- a/chirp/drivers/ft90.py +++ b/chirp/drivers/ft90.py @@ -334,7 +334,7 @@ def sync_in(self): self._mmap = self._clone_in() except errors.RadioError: raise - except Exception as e: + except Exception: trace = traceback.format_exc() raise errors.RadioError( "Failed to communicate with radio: %s" % trace) @@ -345,7 +345,7 @@ def sync_out(self): self._clone_out() except errors.RadioError: raise - except Exception as e: + except Exception: trace = traceback.format_exc() raise errors.RadioError( "Failed to communicate with radio: %s" % trace) @@ -677,6 +677,6 @@ def set_settings(self, uisettings): newval = self._dtmf2bbcd(newval) LOG.debug("Setting %s(%s) <= %s" % (setting, oldval, newval)) setattr(_settings, setting, newval) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/ftlx011.py b/chirp/drivers/ftlx011.py index a7a9c7f3b..bb2d50b96 100644 --- a/chirp/drivers/ftlx011.py +++ b/chirp/drivers/ftlx011.py @@ -714,7 +714,7 @@ def set_settings(self, uisettings): setattr(_settings, name, value) LOG.debug("Setting %s: %s" % (name, value)) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise @@ -730,7 +730,7 @@ def match_model(cls, filedata, filename): # testing the firmware fingerprint, this experimental try: match_model = _model_match(cls, filedata) - except Exception as e: + except Exception: match_model = False return match_size and match_model diff --git a/chirp/drivers/generic_csv.py b/chirp/drivers/generic_csv.py index c655b6d9c..49a2adb24 100644 --- a/chirp/drivers/generic_csv.py +++ b/chirp/drivers/generic_csv.py @@ -175,7 +175,7 @@ def _parse_csv_data_line(self, headers, line): val = typ(val) if hasattr(mem, attr): setattr(mem, attr, val) - except OmittedHeaderError as e: + except OmittedHeaderError: pass except Exception as e: raise Exception("[%s] %s" % (attr, e)) diff --git a/chirp/drivers/h777.py b/chirp/drivers/h777.py index ebdb069e3..2fe9a482f 100644 --- a/chirp/drivers/h777.py +++ b/chirp/drivers/h777.py @@ -573,7 +573,7 @@ def set_settings(self, settings): else: LOG.debug("Setting %s = %s" % (setting, element.value)) setattr(obj, setting, element.value) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/ic2730.py b/chirp/drivers/ic2730.py index 7d7634450..16036c3c4 100644 --- a/chirp/drivers/ic2730.py +++ b/chirp/drivers/ic2730.py @@ -1356,6 +1356,6 @@ def set_settings(self, settings): elif element.value.get_mutable(): LOG.debug("Setting %s = %s" % (setting, element.value)) setattr(obj, setting, element.value) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/icf.py b/chirp/drivers/icf.py index 133737bb0..253a13515 100644 --- a/chirp/drivers/icf.py +++ b/chirp/drivers/icf.py @@ -337,7 +337,7 @@ def _clone_from_radio(radio): try: radio_rev = decode_model(md) - except Exception as e: + except Exception: LOG.error('Failed to decode model data') radio_rev = None @@ -466,7 +466,7 @@ def _clone_to_radio(radio): try: radio_rev = decode_model(md) - except Exception as e: + except Exception: LOG.error('Failed to decode model data') radio_rev = None diff --git a/chirp/drivers/icq7.py b/chirp/drivers/icq7.py index c5dd8070b..fd55c83a3 100644 --- a/chirp/drivers/icq7.py +++ b/chirp/drivers/icq7.py @@ -342,6 +342,6 @@ def set_settings(self, settings): else: LOG.debug("Setting %s = %s" % (setting, element.value)) setattr(obj, setting, element.value) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/icv80.py b/chirp/drivers/icv80.py index f43ea1187..d12024751 100644 --- a/chirp/drivers/icv80.py +++ b/chirp/drivers/icv80.py @@ -371,7 +371,7 @@ def set_settings(self, settings): # This appears to need to be mirrored? if element.get_name() == 'mem_display1': _settings.mem_display2 = _settings.mem_display1 - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/icv86.py b/chirp/drivers/icv86.py index 2558d6528..a0bd8a886 100644 --- a/chirp/drivers/icv86.py +++ b/chirp/drivers/icv86.py @@ -206,7 +206,7 @@ def set_settings(self, settings): setting = element.get_name() LOG.debug("Setting %s = %s" % (setting, element.value)) setattr(_settings, setting, element.value) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/icx90.py b/chirp/drivers/icx90.py index 4d1f1a86a..ce8066ca7 100644 --- a/chirp/drivers/icx90.py +++ b/chirp/drivers/icx90.py @@ -595,7 +595,7 @@ def set_settings(self, settings): except AttributeError as e: LOG.error("Setting %s is not in the memory map: %s" % (element.get_name(), e)) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/iradio_uv_5118.py b/chirp/drivers/iradio_uv_5118.py index a78840756..accce0449 100644 --- a/chirp/drivers/iradio_uv_5118.py +++ b/chirp/drivers/iradio_uv_5118.py @@ -1099,7 +1099,7 @@ def set_settings(self, settings): elif element.value.get_mutable(): LOG.debug("Setting %s = %s" % (setting, element.value)) setattr(obj, setting, element.value) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/kg935g.py b/chirp/drivers/kg935g.py index 3f11057a8..afec16764 100644 --- a/chirp/drivers/kg935g.py +++ b/chirp/drivers/kg935g.py @@ -2167,7 +2167,7 @@ def set_settings(self, settings): int(element.values()[0]._current * 10.0)) else: setattr(obj, setting, element.value) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/kguv8e.py b/chirp/drivers/kguv8e.py index 48af2cf2c..f3851f37c 100644 --- a/chirp/drivers/kguv8e.py +++ b/chirp/drivers/kguv8e.py @@ -1126,7 +1126,7 @@ def set_settings(self, settings): setattr(obj, setting, int(element.value)/10) else: setattr(obj, setting, element.value) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/kguv9dplus.py b/chirp/drivers/kguv9dplus.py index 2c89e8d77..2974164e8 100644 --- a/chirp/drivers/kguv9dplus.py +++ b/chirp/drivers/kguv9dplus.py @@ -2442,7 +2442,7 @@ def set_settings(self, settings): setattr(obj, setting, int(element.value)*10) else: setattr(obj, setting, element.value) - except Exception as e: + except Exception: LOG.debug("set_settings: Exception with %s" % element.get_name()) raise diff --git a/chirp/drivers/kyd.py b/chirp/drivers/kyd.py index f559b3343..9a6974953 100644 --- a/chirp/drivers/kyd.py +++ b/chirp/drivers/kyd.py @@ -490,7 +490,7 @@ def set_settings(self, settings): LOG.debug("Setting %s = %s" % (setting, element.value)) setattr(obj, setting, element.value) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/kyd_IP620.py b/chirp/drivers/kyd_IP620.py index 8e19eb700..c78d46d92 100644 --- a/chirp/drivers/kyd_IP620.py +++ b/chirp/drivers/kyd_IP620.py @@ -595,7 +595,7 @@ def _set_misc_settings(self, settings): setattr(self._memobj.settings_misc, element.get_name(), element.value) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise @@ -622,6 +622,6 @@ def set_settings(self, settings): setattr(_settings_misc, setting, newval) else: setattr(_settings, setting, newval) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/leixen.py b/chirp/drivers/leixen.py index 6450fc536..84900f9c3 100644 --- a/chirp/drivers/leixen.py +++ b/chirp/drivers/leixen.py @@ -940,7 +940,7 @@ def set_settings(self, settings): else: LOG.debug("Setting %s = %s" % (setting, element.value)) setattr(obj, setting, element.value) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/lt725uv.py b/chirp/drivers/lt725uv.py index e4ed6f7e0..16e341dd5 100644 --- a/chirp/drivers/lt725uv.py +++ b/chirp/drivers/lt725uv.py @@ -1528,7 +1528,7 @@ def set_settings(self, settings): elif element.value.get_mutable(): LOG.debug("Setting %s = %s" % (setting, element.value)) setattr(obj, setting, element.value) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/radioddity_r2.py b/chirp/drivers/radioddity_r2.py index a1c358e90..7b779db15 100644 --- a/chirp/drivers/radioddity_r2.py +++ b/chirp/drivers/radioddity_r2.py @@ -651,7 +651,7 @@ def set_settings(self, settings): LOG.debug("Setting %s = %s" % (setting, element.value)) setattr(obj, setting, element.value) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/radtel_t18.py b/chirp/drivers/radtel_t18.py index 039488579..c2e885770 100644 --- a/chirp/drivers/radtel_t18.py +++ b/chirp/drivers/radtel_t18.py @@ -997,7 +997,7 @@ def set_settings(self, settings): else: LOG.debug("Setting %s = %s" % (setting, element.value)) setattr(obj, setting, element.value) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/retevis_rb15.py b/chirp/drivers/retevis_rb15.py index 1bf83f9c6..6f4e31fab 100644 --- a/chirp/drivers/retevis_rb15.py +++ b/chirp/drivers/retevis_rb15.py @@ -754,7 +754,7 @@ def set_settings(self, settings): elif element.value.get_mutable(): LOG.debug("Setting %s = %s" % (setting, element.value)) setattr(obj, setting, element.value) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/retevis_rb17p.py b/chirp/drivers/retevis_rb17p.py index 6efdb04d2..4dfbc0806 100644 --- a/chirp/drivers/retevis_rb17p.py +++ b/chirp/drivers/retevis_rb17p.py @@ -583,7 +583,7 @@ def set_settings(self, settings): else: LOG.debug("Setting %s = %s" % (setting, element.value)) setattr(obj, setting, element.value) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/retevis_rb28.py b/chirp/drivers/retevis_rb28.py index bdca7ef79..e6b8c9319 100644 --- a/chirp/drivers/retevis_rb28.py +++ b/chirp/drivers/retevis_rb28.py @@ -702,7 +702,7 @@ def set_settings(self, settings): elif element.value.get_mutable(): LOG.debug("Setting %s = %s" % (setting, element.value)) setattr(obj, setting, element.value) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/retevis_rt1.py b/chirp/drivers/retevis_rt1.py index ca95d1e2c..3fc81f0a2 100644 --- a/chirp/drivers/retevis_rt1.py +++ b/chirp/drivers/retevis_rt1.py @@ -718,7 +718,7 @@ def set_settings(self, settings): elif element.value.get_mutable(): LOG.debug("Setting %s = %s" % (setting, element.value)) setattr(obj, setting, element.value) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/retevis_rt21.py b/chirp/drivers/retevis_rt21.py index 1f11169b4..eaf4550e2 100644 --- a/chirp/drivers/retevis_rt21.py +++ b/chirp/drivers/retevis_rt21.py @@ -1798,7 +1798,7 @@ def set_settings(self, settings): elif element.value.get_mutable(): LOG.debug("Setting %s = %s" % (setting, element.value)) setattr(obj, setting, element.value) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/retevis_rt22.py b/chirp/drivers/retevis_rt22.py index 9f29d6907..99e89d614 100644 --- a/chirp/drivers/retevis_rt22.py +++ b/chirp/drivers/retevis_rt22.py @@ -667,7 +667,7 @@ def set_settings(self, settings): LOG.debug("Setting %s = %s" % (setting, element.value)) setattr(obj, setting, element.value) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/retevis_rt23.py b/chirp/drivers/retevis_rt23.py index ae854c440..4fbd751a1 100644 --- a/chirp/drivers/retevis_rt23.py +++ b/chirp/drivers/retevis_rt23.py @@ -848,7 +848,7 @@ def set_settings(self, settings): elif element.value.get_mutable(): LOG.debug("Setting %s = %s" % (setting, element.value)) setattr(obj, setting, element.value) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/retevis_rt26.py b/chirp/drivers/retevis_rt26.py index a993c4afc..ac818f971 100644 --- a/chirp/drivers/retevis_rt26.py +++ b/chirp/drivers/retevis_rt26.py @@ -876,7 +876,7 @@ def set_settings(self, settings): elif element.value.get_mutable(): LOG.debug("Setting %s = %s" % (setting, element.value)) setattr(obj, setting, element.value) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/retevis_rt76p.py b/chirp/drivers/retevis_rt76p.py index 72c981e80..a649ea456 100644 --- a/chirp/drivers/retevis_rt76p.py +++ b/chirp/drivers/retevis_rt76p.py @@ -972,7 +972,7 @@ def set_settings(self, settings): elif element.value.get_mutable(): LOG.debug("Setting %s = %s" % (setting, element.value)) setattr(obj, setting, element.value) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/retevis_rt87.py b/chirp/drivers/retevis_rt87.py index 7c31376c6..a6c4bb3ab 100644 --- a/chirp/drivers/retevis_rt87.py +++ b/chirp/drivers/retevis_rt87.py @@ -1025,7 +1025,7 @@ def set_settings(self, settings): elif element.value.get_mutable(): LOG.debug("Setting %s = %s" % (setting, element.value)) setattr(obj, setting, element.value) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/retevis_rt98.py b/chirp/drivers/retevis_rt98.py index e5c667a2d..75edcbd82 100644 --- a/chirp/drivers/retevis_rt98.py +++ b/chirp/drivers/retevis_rt98.py @@ -795,7 +795,7 @@ class FakeEmbedded(object): rf.valid_bands = get_band_limits_Hz( str(_embedded.radio_type), int(_embedded.mode)) - except TypeError as e: + except TypeError: # If we're asked without memory loaded, assume the most permissive rf.valid_bands = get_band_limits_Hz(str(_embedded.radio_type), 1) except Exception as e: @@ -1364,7 +1364,7 @@ def set_settings(self, settings): elif element.value.get_mutable(): LOG.debug("Setting %s = %s" % (setting, element.value)) setattr(obj, setting, element.value) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/tdxone_tdq8a.py b/chirp/drivers/tdxone_tdq8a.py index 57044e5d7..56a57efa4 100644 --- a/chirp/drivers/tdxone_tdq8a.py +++ b/chirp/drivers/tdxone_tdq8a.py @@ -944,7 +944,7 @@ def set_settings(self, settings): elif element.value.get_mutable(): LOG.debug("Setting %s = %s" % (setting, element.value)) setattr(obj, setting, element.value) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise @@ -958,7 +958,7 @@ def _set_fm_preset(self, settings): value = int(val.get_value() * 10) LOG.debug("Setting fm_presets = %s" % (value)) self._memobj.fm_presets = value - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/tg_uv2p.py b/chirp/drivers/tg_uv2p.py index 44494ed5f..32749217b 100644 --- a/chirp/drivers/tg_uv2p.py +++ b/chirp/drivers/tg_uv2p.py @@ -767,7 +767,7 @@ def set_settings(self, settings): elif element.value.get_mutable(): LOG.debug("Setting %s = %s" % (setting, element.value)) setattr(obj, setting, element.value) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/th7800.py b/chirp/drivers/th7800.py index 1d8abd92c..608c717d6 100644 --- a/chirp/drivers/th7800.py +++ b/chirp/drivers/th7800.py @@ -533,7 +533,7 @@ def set_settings(self, settings): LOG.debug("Setting %s(%s) <= %s" % (setting, oldval, newval)) setattr(_settings, setting, newval) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/th9000.py b/chirp/drivers/th9000.py index fef716e05..44360b01a 100644 --- a/chirp/drivers/th9000.py +++ b/chirp/drivers/th9000.py @@ -843,7 +843,7 @@ def set_settings(self, settings): LOG.debug("Setting %s = %s" % (setting, element.value)) setattr(obj, setting, element.value) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/th9800.py b/chirp/drivers/th9800.py index 1fe3e8ffc..31536a385 100644 --- a/chirp/drivers/th9800.py +++ b/chirp/drivers/th9800.py @@ -633,7 +633,7 @@ def set_settings(self, settings): LOG.debug("Setting %s(%s) <= %s" % (setting, oldval, newval)) setattr(_settings, setting, newval) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/th_uv8000.py b/chirp/drivers/th_uv8000.py index ed254fe14..0319d96ac 100644 --- a/chirp/drivers/th_uv8000.py +++ b/chirp/drivers/th_uv8000.py @@ -1471,6 +1471,6 @@ def set_settings(self, settings): elif element.value.get_mutable(): LOG.debug("Setting %s = %s" % (setting, element.value)) setattr(obj, setting, element.value) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/th_uv88.py b/chirp/drivers/th_uv88.py index 5a6eba1b2..f58849b1b 100644 --- a/chirp/drivers/th_uv88.py +++ b/chirp/drivers/th_uv88.py @@ -1092,7 +1092,7 @@ def set_settings(self, settings): elif element.value.get_mutable(): LOG.debug("Setting %s = %s" % (setting, element.value)) setattr(obj, setting, element.value) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/thd72.py b/chirp/drivers/thd72.py index 44daacd13..ef39ec452 100644 --- a/chirp/drivers/thd72.py +++ b/chirp/drivers/thd72.py @@ -601,7 +601,7 @@ def set_settings(self, settings): except AttributeError as e: LOG.error("Setting %s is not in the memory map: %s" % (element.get_name(), e)) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/tmd710.py b/chirp/drivers/tmd710.py index cd3fe40ff..d6f46d8ef 100644 --- a/chirp/drivers/tmd710.py +++ b/chirp/drivers/tmd710.py @@ -1240,7 +1240,7 @@ def set_settings(self, settings): LOG.debug("Setting %s = %s" % (setting, element.value)) setattr(obj, setting, element.value) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise return diff --git a/chirp/drivers/ts480.py b/chirp/drivers/ts480.py index 731e49cb9..58e83026d 100644 --- a/chirp/drivers/ts480.py +++ b/chirp/drivers/ts480.py @@ -1140,7 +1140,7 @@ def set_settings(self, settings): elif element.value.get_mutable(): LOG.debug("Setting %s = %s" % (setting, element.value)) setattr(obj, setting, element.value) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise return diff --git a/chirp/drivers/ts590.py b/chirp/drivers/ts590.py index dc926f909..fe2cd4532 100644 --- a/chirp/drivers/ts590.py +++ b/chirp/drivers/ts590.py @@ -1634,7 +1634,7 @@ def set_settings(self, settings): elif element.value.get_mutable(): LOG.debug("Setting %s = %s" % (setting, element.value)) setattr(obj, setting, element.value) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/uv5r.py b/chirp/drivers/uv5r.py index d3df79bbb..8c27dc7ed 100644 --- a/chirp/drivers/uv5r.py +++ b/chirp/drivers/uv5r.py @@ -498,7 +498,7 @@ def _ident_radio(radio): for magic, reason in list(IDENT_BLACKLIST.items()): try: _do_ident(radio, magic, secondack=False) - except errors.RadioError as e: + except errors.RadioError: # No match, try the next one continue @@ -1758,7 +1758,7 @@ def set_settings(self, settings): elif element.value.get_mutable(): LOG.debug("Setting %s = %s" % (setting, element.value)) setattr(obj, setting, element.value) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise @@ -1774,7 +1774,7 @@ def _set_fm_preset(self, settings): if self._bw_shift: value = ((value & 0x00FF) << 8) | ((value & 0xFF00) >> 8) self._memobj.fm_presets = value - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/uvb5.py b/chirp/drivers/uvb5.py index a5e629b6c..d0ec2c495 100644 --- a/chirp/drivers/uvb5.py +++ b/chirp/drivers/uvb5.py @@ -775,7 +775,7 @@ def set_settings(self, settings): else: LOG.debug("Setting %s = %s" % (setting, element.value)) setattr(obj, setting, element.value) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise @@ -791,7 +791,7 @@ def _set_fm_preset(self, settings): LOG.debug("Setting fm_presets[%1i] = %s" % (index, value)) setting = self._memobj.fm_presets setting[index] = value - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/vgc.py b/chirp/drivers/vgc.py index 9d185aca5..95f544238 100644 --- a/chirp/drivers/vgc.py +++ b/chirp/drivers/vgc.py @@ -1435,7 +1435,7 @@ def set_settings(self, settings): elif element.value.get_mutable(): LOG.debug("Setting %s = %s" % (setting, element.value)) setattr(obj, setting, element.value) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/vx2.py b/chirp/drivers/vx2.py index 5e272f869..41ee3f4a9 100644 --- a/chirp/drivers/vx2.py +++ b/chirp/drivers/vx2.py @@ -743,6 +743,6 @@ def set_settings(self, uisettings): newval = self._encode_chars(newval, 6) LOG.debug("Setting %s(%s) <= %s" % (setting, oldval, newval)) setattr(_settings, setting, newval) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/vx3.py b/chirp/drivers/vx3.py index 1a52ebb9c..13e0a1768 100644 --- a/chirp/drivers/vx3.py +++ b/chirp/drivers/vx3.py @@ -971,6 +971,6 @@ def set_settings(self, uisettings): newval = self._encode_chars(newval, 6) LOG.debug("Setting %s(%s) <= %s" % (setting, oldval, newval)) setattr(_settings, setting, newval) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/vx6.py b/chirp/drivers/vx6.py index 16edc3eea..d9cda0869 100644 --- a/chirp/drivers/vx6.py +++ b/chirp/drivers/vx6.py @@ -906,5 +906,5 @@ def set_settings(self, uisettings): elif setting == "password": newval = self._encode_chars(newval, 4) setattr(_settings, setting, newval) - except Exception as e: + except Exception: raise diff --git a/chirp/drivers/vx8.py b/chirp/drivers/vx8.py index 0e10a9cea..2f6e571cf 100644 --- a/chirp/drivers/vx8.py +++ b/chirp/drivers/vx8.py @@ -1433,7 +1433,7 @@ def set_settings(self, settings): except AttributeError as e: LOG.error("Setting %s is not in the memory map: %s" % (element.get_name(), e)) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise diff --git a/chirp/drivers/wouxun.py b/chirp/drivers/wouxun.py index b923befff..fb3e1f12c 100644 --- a/chirp/drivers/wouxun.py +++ b/chirp/drivers/wouxun.py @@ -659,7 +659,7 @@ def set_settings(self, settings): else: LOG.debug("Setting %s = %s" % (setting, element.value)) setattr(obj, setting, element.value) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise @@ -681,7 +681,7 @@ def _set_fm_preset(self, settings): else: setting = self._memobj.fm_presets_1 setting[index] = value - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise @@ -691,7 +691,7 @@ def _set_freq_settings(self, settings): setattr(self._memobj.freq_ranges, element.get_name(), encode_freq(int(element.value))) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise @@ -1399,7 +1399,7 @@ def set_settings(self, settings): else: LOG.debug("Setting %s = %s" % (setting, element.value)) setattr(obj, setting, element.value) - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise @@ -1421,7 +1421,7 @@ def _set_fm_preset(self, settings): else: setting = self._memobj.fm_presets_1 setting[index] = value - except Exception as e: + except Exception: LOG.debug(element.get_name()) raise From 1a9f12b1c8073b8ead89bb458f253cda91e05dc5 Mon Sep 17 00:00:00 2001 From: Daniele Forsi Date: Mon, 19 Jun 2023 23:38:40 +0200 Subject: [PATCH 07/13] Remove duplicate imports Fixes: ./chirp/drivers/retevis_rt98.py:25:1: F811 redefinition of unused 'RadioSettingValueString' from line 25 ./chirp/drivers/th9000.py:25:1: F811 redefinition of unused 'RadioSettingValueString' from line 25 ./chirp/drivers/icf.py:25:1: F811 redefinition of unused 'struct' from line 21 ./chirp/drivers/icf.py:31:1: F811 redefinition of unused 'util' from line 27 --- chirp/drivers/icf.py | 2 -- chirp/drivers/retevis_rt98.py | 2 +- chirp/drivers/th9000.py | 3 +-- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/chirp/drivers/icf.py b/chirp/drivers/icf.py index 253a13515..5f43d1e84 100644 --- a/chirp/drivers/icf.py +++ b/chirp/drivers/icf.py @@ -22,13 +22,11 @@ import re import time import logging -import struct from chirp import chirp_common, errors, util, memmap from chirp import directory from chirp.settings import RadioSetting, RadioSettingGroup, \ RadioSettingValueString, RadioSettings -from chirp import util LOG = logging.getLogger(__name__) diff --git a/chirp/drivers/retevis_rt98.py b/chirp/drivers/retevis_rt98.py index 75edcbd82..8a4cb9857 100644 --- a/chirp/drivers/retevis_rt98.py +++ b/chirp/drivers/retevis_rt98.py @@ -24,7 +24,7 @@ from chirp import util from chirp.settings import RadioSettingGroup, RadioSetting, RadioSettings, \ RadioSettingValueList, RadioSettingValueString, RadioSettingValueBoolean, \ - RadioSettingValueInteger, RadioSettingValueString + RadioSettingValueInteger LOG = logging.getLogger(__name__) diff --git a/chirp/drivers/th9000.py b/chirp/drivers/th9000.py index 44360b01a..d785ccab8 100644 --- a/chirp/drivers/th9000.py +++ b/chirp/drivers/th9000.py @@ -23,8 +23,7 @@ from chirp import memmap from chirp import util from chirp.settings import RadioSettingGroup, RadioSetting, RadioSettings, \ - RadioSettingValueList, RadioSettingValueString, RadioSettingValueInteger, \ - RadioSettingValueString + RadioSettingValueList, RadioSettingValueString, RadioSettingValueInteger LOG = logging.getLogger(__name__) From 27e870decda96e1542216728856a01bb8d1bd669 Mon Sep 17 00:00:00 2001 From: Daniele Forsi Date: Mon, 19 Jun 2023 23:46:13 +0200 Subject: [PATCH 08/13] Remove duplicate methods Fixes: ./chirp/drivers/icx90.py:670:5: F811 redefinition of unused 'get_raw_memory' from line 605 ./chirp/drivers/ft1d.py:2528:5: F811 redefinition of unused 'apply_WEhemi' from line 2521 --- chirp/drivers/ft1d.py | 7 ------- chirp/drivers/icx90.py | 4 ---- 2 files changed, 11 deletions(-) diff --git a/chirp/drivers/ft1d.py b/chirp/drivers/ft1d.py index 211edc332..38bc98c4c 100644 --- a/chirp/drivers/ft1d.py +++ b/chirp/drivers/ft1d.py @@ -2525,13 +2525,6 @@ def apply_WEhemi(cls, setting, obj): hemi = ' ' setattr(obj, "WEhemi", hemi) - def apply_WEhemi(cls, setting, obj): - hemi = setting.value.get_value().upper() - - if hemi != 'W' and hemi != 'E': - hemi = ' ' - setattr(obj, "WEhemi", hemi) - def apply_bt_lat(cls, setting, obj): val = setting.value.get_value() val = cls.backtrack_zero_pad(val, 3) diff --git a/chirp/drivers/icx90.py b/chirp/drivers/icx90.py index ce8066ca7..d5e658429 100644 --- a/chirp/drivers/icx90.py +++ b/chirp/drivers/icx90.py @@ -602,10 +602,6 @@ def set_settings(self, settings): def process_mmap(self): self.memobj = bitwise.parse(ICX90_MEM_FORMAT, self._mmap) - def get_raw_memory(self, number): - (mem_item, special, unique_idx) = self.get_mem_item(number) - return repr(mem_item) - def sync_in(self): icf.IcomCloneModeRadio.sync_in(self) self.process_mmap() From d03a5d4b2274b42bad228453636d440e12989f7a Mon Sep 17 00:00:00 2001 From: Daniele Forsi Date: Thu, 22 Jun 2023 21:41:51 +0200 Subject: [PATCH 09/13] Fix two instances of "E722 do not use bare 'except'" For consistency with the set_settings() method in other drivers --- chirp/drivers/ap510.py | 2 +- chirp/drivers/ft857.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/chirp/drivers/ap510.py b/chirp/drivers/ap510.py index 3b8d39b5c..c233d51ae 100644 --- a/chirp/drivers/ap510.py +++ b/chirp/drivers/ap510.py @@ -753,7 +753,7 @@ def set_settings(self, settings): multiple = self._mmap.multiple multiple['tf_card'] = TF_CARD.index(str(setting.value)) self._mmap.multiple = multiple - except: + except Exception: LOG.debug(setting.get_name()) raise diff --git a/chirp/drivers/ft857.py b/chirp/drivers/ft857.py index 1b6655bbc..842c4e65d 100644 --- a/chirp/drivers/ft857.py +++ b/chirp/drivers/ft857.py @@ -1101,7 +1101,7 @@ def set_settings(self, settings): setattr(self._memobj, setting + "_offset", abs(val)) else: setattr(obj, setting, element.value) - except: + except Except: LOG.debug(element.get_name()) raise From d977a352155ab12b09f1dd560848e9ec5f00fe53 Mon Sep 17 00:00:00 2001 From: Daniele Forsi Date: Mon, 19 Jun 2023 00:27:30 +0200 Subject: [PATCH 10/13] Remove clean files from tools/cpep8.manifest --- tools/cpep8.manifest | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/tools/cpep8.manifest b/tools/cpep8.manifest index e6ebcd12a..da7bca149 100644 --- a/tools/cpep8.manifest +++ b/tools/cpep8.manifest @@ -10,33 +10,24 @@ ./chirp/drivers/anytone778uv.py ./chirp/drivers/anytone_ht.py ./chirp/drivers/anytone_iii.py -./chirp/drivers/ap510.py ./chirp/drivers/baofeng_common.py ./chirp/drivers/baofeng_uv3r.py -./chirp/drivers/baofeng_wp970i.py ./chirp/drivers/bf_t8.py -./chirp/drivers/bjuv55.py ./chirp/drivers/btech.py ./chirp/drivers/ft1d.py ./chirp/drivers/ft2900.py -./chirp/drivers/ft2d.py ./chirp/drivers/ft60.py ./chirp/drivers/ft7800.py -./chirp/drivers/ft818.py ./chirp/drivers/ft857.py ./chirp/drivers/ft90.py ./chirp/drivers/ga510.py ./chirp/drivers/generic_csv.py -./chirp/drivers/gmrsuv1.py ./chirp/drivers/gmrsv2.py ./chirp/drivers/h777.py -./chirp/drivers/ic2100.py ./chirp/drivers/ic2730.py ./chirp/drivers/ic9x.py ./chirp/drivers/icf.py ./chirp/drivers/icomciv.py -./chirp/drivers/icq7.py -./chirp/drivers/icv80.py ./chirp/drivers/iradio_uv_5118.py ./chirp/drivers/kenwood_live.py ./chirp/drivers/kg935g.py @@ -45,7 +36,6 @@ ./chirp/drivers/kyd.py ./chirp/drivers/leixen.py ./chirp/drivers/lt725uv.py -./chirp/drivers/mursv1.py ./chirp/drivers/radioddity_r2.py ./chirp/drivers/radtel_t18.py ./chirp/drivers/retevis_rb15.py @@ -59,10 +49,8 @@ ./chirp/drivers/retevis_rt87.py ./chirp/drivers/retevis_rt98.py ./chirp/drivers/tdxone_tdq8a.py -./chirp/drivers/tg_uv2p.py ./chirp/drivers/th9000.py ./chirp/drivers/th9800.py -./chirp/drivers/th9800.py ./chirp/drivers/th_uv3r.py ./chirp/drivers/th_uv3r25.py ./chirp/drivers/th_uv8000.py @@ -76,12 +64,7 @@ ./chirp/drivers/ts590.py ./chirp/drivers/uv5r.py ./chirp/drivers/uv5x3.py -./chirp/drivers/uv6r.py -./chirp/drivers/uvb5.py ./chirp/drivers/vgc.py -./chirp/drivers/vx170.py -./chirp/drivers/vx2.py -./chirp/drivers/vx3.py ./chirp/drivers/vx6.py ./chirp/drivers/vx7.py ./chirp/drivers/vx8.py From 1bbed4f71017427e29c4b3faa4d0c55802ba7db8 Mon Sep 17 00:00:00 2001 From: Daniele Forsi Date: Sat, 24 Jun 2023 19:36:57 +0200 Subject: [PATCH 11/13] Fix typo Fixes: chirp/chirp_common.py:398:15: E1101: Instance of 'Memory' has no 'freqx' member; maybe 'freq'? (no-member) --- chirp/chirp_common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chirp/chirp_common.py b/chirp/chirp_common.py index 0815bb517..96fef397d 100644 --- a/chirp/chirp_common.py +++ b/chirp/chirp_common.py @@ -395,7 +395,7 @@ def format_freq(self): def parse_freq(self, freqstr): """Set the frequency from a string""" self.freq = parse_freq(freqstr) - return self.freqx + return self.freq def __str__(self): if self.tmode == "Tone": From 8017a2593e00beec8a82a318c0e064f9e0d12fd2 Mon Sep 17 00:00:00 2001 From: Daniele Forsi Date: Sat, 24 Jun 2023 21:35:00 +0200 Subject: [PATCH 12/13] Remove unused variable and unneeded seek() Fixes: chirp/drivers/generic_csv.py:199:12: W0612: Unused variable 'header' (unused-variable) --- chirp/drivers/generic_csv.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/chirp/drivers/generic_csv.py b/chirp/drivers/generic_csv.py index 49a2adb24..1d5cf4fe4 100644 --- a/chirp/drivers/generic_csv.py +++ b/chirp/drivers/generic_csv.py @@ -196,8 +196,6 @@ def load(self, filename=None): self._blank() with open(self._filename, newline='', encoding='utf-8') as f: - header = f.readline().strip() - f.seek(0, 0) return self._load(f) def _load(self, f): From 25f96cddee653d7235b04add392b57b1087679de Mon Sep 17 00:00:00 2001 From: Dan Smith Date: Mon, 26 Jun 2023 17:08:20 -0700 Subject: [PATCH 13/13] Remove unused bandplan_na import from wp970i This was probably lost in a rebase. --- chirp/drivers/baofeng_wp970i.py | 1 - 1 file changed, 1 deletion(-) diff --git a/chirp/drivers/baofeng_wp970i.py b/chirp/drivers/baofeng_wp970i.py index 84d7b36b6..c401e69ba 100644 --- a/chirp/drivers/baofeng_wp970i.py +++ b/chirp/drivers/baofeng_wp970i.py @@ -19,7 +19,6 @@ from chirp.drivers import baofeng_common from chirp import chirp_common, directory from chirp import bitwise -from chirp import bandplan_na from chirp.settings import RadioSettingGroup, RadioSetting, \ RadioSettingValueBoolean, RadioSettingValueList, \ RadioSettingValueString, RadioSettingValueInteger, \