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": 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..8ba5d8422 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 @@ -691,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: @@ -1725,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 132ce4306..e396232dd 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__) @@ -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/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/ap510.py b/chirp/drivers/ap510.py index f9cf1f777..c233d51ae 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'] @@ -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) @@ -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/baofeng_common.py b/chirp/drivers/baofeng_common.py index 454c2b234..f5b09d123 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 @@ -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/baofeng_wp970i.py b/chirp/drivers/baofeng_wp970i.py index 034618abc..c401e69ba 100644 --- a/chirp/drivers/baofeng_wp970i.py +++ b/chirp/drivers/baofeng_wp970i.py @@ -17,9 +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 bandplan_na +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/bf_t1.py b/chirp/drivers/bf_t1.py index c151edb64..496af8d0f 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 @@ -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 2abd3d96f..0b969b5c5 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__) @@ -114,20 +113,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, @@ -826,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/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..5be6cd6e8 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, \ @@ -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 0ee87c9a9..fff15e698 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: @@ -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 a7c2b57e0..38bc98c4c 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", @@ -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 @@ -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/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/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..192e4d22d 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 @@ -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 49c26efd6..dd6ba612a 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__) @@ -717,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 f63014d03..f668a74df 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 @@ -1187,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 a5a03f451..87db2784e 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 @@ -743,7 +742,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 = [] @@ -767,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/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/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 diff --git a/chirp/drivers/ft90.py b/chirp/drivers/ft90.py index da7733e37..fe0362cab 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 @@ -335,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) @@ -346,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) @@ -671,13 +670,13 @@ 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) 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 a3ebdc47f..bb2d50b96 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__) @@ -715,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 @@ -731,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 14c2bd2b9..1d5cf4fe4 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) @@ -176,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)) @@ -197,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): 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/h777.py b/chirp/drivers/h777.py index 344ef28ae..2fe9a482f 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 @@ -577,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/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 e29aa2ed5..16036c3c4 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__) @@ -1306,7 +1305,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 @@ -1357,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/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/icf.py b/chirp/drivers/icf.py index 8fac46032..5f43d1e84 100644 --- a/chirp/drivers/icf.py +++ b/chirp/drivers/icf.py @@ -22,14 +22,11 @@ import re import time 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 -from chirp import util + RadioSettingValueString, RadioSettings LOG = logging.getLogger(__name__) @@ -338,7 +335,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 @@ -467,7 +464,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/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..fd55c83a3 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__) @@ -343,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 884685a59..d12024751 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__) @@ -372,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 ad696268a..a0bd8a886 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__) @@ -207,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 c403d3c41..d5e658429 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 = """ @@ -596,17 +595,13 @@ 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 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() diff --git a/chirp/drivers/iradio_uv_5118.py b/chirp/drivers/iradio_uv_5118.py index f15ceba3f..accce0449 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__) @@ -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/kguv920pa.py b/chirp/drivers/kguv920pa.py index 231908f69..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__) @@ -36,7 +35,7 @@ CHARSET = "0123456789" + \ ":;<=>?@" + \ "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + \ - "[\]^_`" + \ + "[\\]^_`" + \ "abcdefghijklmnopqrstuvwxyz" + \ "{|}~\x4E" + \ " !\"#$%&'()*+,-./" diff --git a/chirp/drivers/kguv9dplus.py b/chirp/drivers/kguv9dplus.py index 3dc0e9210..2974164e8 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__) @@ -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 1894b6dd6..9a6974953 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 @@ -499,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 157083959..c78d46d92 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__) @@ -597,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 @@ -624,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 9d6037c42..84900f9c3 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__) @@ -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 69f461a8a..16e341dd5 100644 --- a/chirp/drivers/lt725uv.py +++ b/chirp/drivers/lt725uv.py @@ -235,38 +235,13 @@ 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 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): @@ -1553,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/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/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 64681c5d2..7b779db15 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__) @@ -105,15 +104,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, @@ -661,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 daf8ccc40..c2e885770 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, @@ -1015,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 eaf28d1e4..6f4e31fab 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__) @@ -755,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 07245b334..4dfbc0806 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, @@ -595,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 e3434a907..e6b8c9319 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__) @@ -141,19 +140,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]] @@ -716,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 134692c77..3fc81f0a2 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__) @@ -104,23 +103,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 @@ -736,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 d9911ba83..eaf4550e2 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__) @@ -555,35 +554,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, @@ -1828,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 c13028c1d..99e89d614 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 + \ "`{|}!\"#$%&'()*+,-./:;<=>?@[]^_" @@ -675,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 6dbd17720..ac818f971 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__) @@ -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 @@ -882,7 +860,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 @@ -898,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 f45cab2d3..a649ea456 100644 --- a/chirp/drivers/retevis_rt76p.py +++ b/chirp/drivers/retevis_rt76p.py @@ -29,7 +29,6 @@ RadioSettingGroup, RadioSettings, RadioSettingValueBoolean, - RadioSettingValueFloat, RadioSettingValueInteger, RadioSettingValueList, RadioSettingValueString, @@ -194,30 +193,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, @@ -997,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 eabb66f2d..a6c4bb3ab 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)] @@ -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 6604ea8f0..8a4cb9857 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 LOG = logging.getLogger(__name__) @@ -116,25 +115,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) @@ -606,7 +586,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) @@ -815,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: @@ -1384,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/rh5r_v2.py b/chirp/drivers/rh5r_v2.py index 235bd52f1..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__) @@ -129,7 +125,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/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/tdxone_tdq8a.py b/chirp/drivers/tdxone_tdq8a.py index d35d2aca8..56a57efa4 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__) @@ -945,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 @@ -959,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 cf59d8cab..32749217b 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__) @@ -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 d765f6e14..608c717d6 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 @@ -534,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 a2a0dd7a0..d785ccab8 100644 --- a/chirp/drivers/th9000.py +++ b/chirp/drivers/th9000.py @@ -23,9 +23,7 @@ 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 LOG = logging.getLogger(__name__) @@ -61,17 +59,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 { @@ -855,7 +842,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 cf3a05d78..31536a385 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 @@ -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_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 50aae3e3d..0319d96ac 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__) @@ -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 @@ -1479,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 2b9ce65fb..f58849b1b 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__) @@ -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 1556cc9dc..ef39ec452 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 @@ -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 @@ -774,7 +774,6 @@ def match_model(cls, filedata, filename): if __name__ == "__main__": import sys import serial - import detect import getopt def fixopts(opts): @@ -836,8 +835,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/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 a9b6382d0..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 @@ -226,7 +225,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/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/tmd710.py b/chirp/drivers/tmd710.py index 493179dba..d6f46d8ef 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__) @@ -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 d41b19814..58e83026d 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__) @@ -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 495d288cf..fe2cd4532 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__) @@ -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 b948e4121..8c27dc7ed 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, @@ -532,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 @@ -1792,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 @@ -1808,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/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/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 135ce125e..95f544238 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): @@ -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) @@ -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/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 d6ce7a75a..41ee3f4a9 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 @@ -712,7 +711,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 = [] @@ -744,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 c9a2a9c4e..13e0a1768 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 @@ -938,7 +937,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 = [] @@ -972,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 0ea371c61..d9cda0869 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 = [] @@ -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 384956fab..2f6e571cf 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", @@ -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 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 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