diff options
| author | Matthew Poletiek <matthew.poletiek@gmail.com> | 2020-12-20 16:35:39 -0600 |
|---|---|---|
| committer | Matthew Poletiek <matthew.poletiek@gmail.com> | 2020-12-20 16:35:39 -0600 |
| commit | b74292b26cbf64bcb3b32032a3b09c19f9f82805 (patch) | |
| tree | 75c8a6ac1a08bc5bbec386302760037fdce6d955 | |
| parent | 9ddcc6ef45bdb138d0a94b31bbf7217d58404fd2 (diff) | |
| download | chirp-b74292b26cbf64bcb3b32032a3b09c19f9f82805.tar.gz chirp-b74292b26cbf64bcb3b32032a3b09c19f9f82805.tar.xz | |
Fixing tests
| -rw-r--r-- | chirp/drivers/bf-t1.py | 2 | ||||
| -rw-r--r-- | chirp/drivers/puxing_px888k.py | 2 | ||||
| -rw-r--r-- | chirp/drivers/th_uvf8d.py | 2 | ||||
| -rw-r--r-- | chirp/drivers/thd72.py | 6 | ||||
| -rw-r--r-- | chirp/drivers/ts2000.py | 2 | ||||
| -rw-r--r-- | chirp/drivers/ts850.py | 2 | ||||
| -rwxr-xr-x | share/make_supported.py | 27 |
7 files changed, 33 insertions, 10 deletions
diff --git a/chirp/drivers/bf-t1.py b/chirp/drivers/bf-t1.py index f93972f..a0c4939 100644 --- a/chirp/drivers/bf-t1.py +++ b/chirp/drivers/bf-t1.py @@ -503,7 +503,7 @@ class BFT1(chirp_common.CloneModeRadio, chirp_common.ExperimentalRadio): """Get the radio's features""" rf = chirp_common.RadioFeatures() - rf.valid_special_chans = SPECIALS.keys() + rf.valid_special_chans = list(SPECIALS.keys()) rf.has_settings = True rf.has_bank = False rf.has_tuning_step = False diff --git a/chirp/drivers/puxing_px888k.py b/chirp/drivers/puxing_px888k.py index 63499fe..7e4fb83 100644 --- a/chirp/drivers/puxing_px888k.py +++ b/chirp/drivers/puxing_px888k.py @@ -1151,7 +1151,7 @@ class Puxing_PX888K_Radio(chirp_common.CloneModeRadio): rf.valid_name_length = 6 rf.valid_cross_modes = CROSS_MODES rf.memory_bounds = (1, 128) - rf.valid_special_chans = SPECIAL_CHANNELS.keys() + rf.valid_special_chans = list(SPECIAL_CHANNELS.keys()) rf.valid_tuning_steps = [5.0, 6.25, 10.0, 12.5, 25.0] return rf diff --git a/chirp/drivers/th_uvf8d.py b/chirp/drivers/th_uvf8d.py index e302784..412ec07 100644 --- a/chirp/drivers/th_uvf8d.py +++ b/chirp/drivers/th_uvf8d.py @@ -288,7 +288,7 @@ class TYTUVF8DRadio(chirp_common.CloneModeRadio): rf.valid_skips = ["", "S"] rf.valid_power_levels = POWER_LEVELS rf.valid_modes = ["FM", "NFM"] - rf.valid_special_chans = SPECIALS.keys() + rf.valid_special_chans = list(SPECIALS.keys()) rf.valid_name_length = 7 return rf diff --git a/chirp/drivers/thd72.py b/chirp/drivers/thd72.py index 5b3d053..b8b01e9 100644 --- a/chirp/drivers/thd72.py +++ b/chirp/drivers/thd72.py @@ -244,9 +244,9 @@ class THD72Radio(chirp_common.CloneModeRadio): rf.has_bank = False rf.has_settings = True rf.valid_tuning_steps = [] - rf.valid_modes = MODES_REV.keys() - rf.valid_tmodes = TMODES_REV.keys() - rf.valid_duplexes = DUPLEX_REV.keys() + rf.valid_modes = list(MODES_REV.keys()) + rf.valid_tmodes = list(TMODES_REV.keys()) + rf.valid_duplexes = list(DUPLEX_REV.keys()) rf.valid_skips = ["", "S"] rf.valid_characters = chirp_common.CHARSET_ALPHANUMERIC rf.valid_name_length = 8 diff --git a/chirp/drivers/ts2000.py b/chirp/drivers/ts2000.py index c842a5f..99f4d39 100644 --- a/chirp/drivers/ts2000.py +++ b/chirp/drivers/ts2000.py @@ -50,7 +50,7 @@ class TS2000Radio(KenwoodLiveRadio): rf.valid_tuning_steps = list(TS2000_SSB_STEPS + TS2000_FM_STEPS) rf.valid_bands = [(1000, 1300000000)] rf.valid_skips = ["", "S"] - rf.valid_duplexes = TS2000_DUPLEX.values() + rf.valid_duplexes = list(TS2000_DUPLEX.values()) # TS-2000 uses ";" as a message separator even though it seems to # allow you to to use all printable ASCII characters at the manual diff --git a/chirp/drivers/ts850.py b/chirp/drivers/ts850.py index 746a94d..8fb453d 100644 --- a/chirp/drivers/ts850.py +++ b/chirp/drivers/ts850.py @@ -81,7 +81,7 @@ class TS850Radio(KenwoodLiveRadio): rf.valid_bands = TS850_BANDS rf.valid_characters = chirp_common.CHARSET_UPPER_NUMERIC rf.valid_duplexes = TS850_DUPLEX - rf.valid_modes = TS850_MODES.keys() + rf.valid_modes = list(TS850_MODES.keys()) rf.valid_skips = TS850_SKIP rf.valid_tmodes = TS850_TMODES diff --git a/share/make_supported.py b/share/make_supported.py index 67ecebd..5934688 100755 --- a/share/make_supported.py +++ b/share/make_supported.py @@ -58,7 +58,7 @@ def supported_row(radio): try: value = ", ".join([str(x) for x in value if not str(x).startswith("?")]) - except Exception, e: + except Exception as e: raise if key == "memory_bounds": @@ -167,7 +167,30 @@ for radio in directory.DRV_TO_RADIO.values(): def get_key(rc): return '%s %s %s' % (rc.VENDOR, rc.MODEL, rc.VARIANT) -for radio in sorted(models, cmp=lambda a, b: get_key(a) < get_key(b) and -1 or 1): + + +# Python2 to 3 wrapper for converting an old comparison below to a key +def cmp_to_key(mycmp): + 'Convert a cmp= function into a key= function' + class K: + def __init__(self, obj, *args): + self.obj = obj + def __lt__(self, other): + return mycmp(self.obj, other.obj) < 0 + def __gt__(self, other): + return mycmp(self.obj, other.obj) > 0 + def __eq__(self, other): + return mycmp(self.obj, other.obj) == 0 + def __le__(self, other): + return mycmp(self.obj, other.obj) <= 0 + def __ge__(self, other): + return mycmp(self.obj, other.obj) >= 0 + def __ne__(self, other): + return mycmp(self.obj, other.obj) != 0 + return K + + +for radio in sorted(models, key=cmp_to_key(lambda a, b: get_key(a) < get_key(b) and -1 or 1)): if counter % 10 == 0: output(header_row()) _radio = radio(None) |
