aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--RADIOS.md505
-rw-r--r--README.md3
-rw-r--r--chirp/directory.py2
-rw-r--r--chirp/drivers/ap510.py5
-rw-r--r--chirp/drivers/bf-t1.py2
-rw-r--r--chirp/drivers/ft450d.py19
-rw-r--r--chirp/drivers/kguv8dplus.py4
-rw-r--r--chirp/drivers/leixen.py4
-rw-r--r--chirp/drivers/puxing_px888k.py17
-rw-r--r--chirp/drivers/th_uvf8d.py2
-rw-r--r--chirp/drivers/thd72.py6
-rw-r--r--chirp/drivers/tk270.py2
-rw-r--r--chirp/drivers/tk760.py2
-rw-r--r--chirp/drivers/tk760g.py11
-rw-r--r--chirp/drivers/ts2000.py2
-rw-r--r--chirp/drivers/ts850.py4
-rwxr-xr-xshare/make_supported.py27
-rwxr-xr-xtests/run_tests.py3
-rw-r--r--tests/unit/base.py10
-rw-r--r--tests/unit/test_memedit_edits.py11
-rw-r--r--tests/unit/test_platform.py12
-rw-r--r--tests/unit/test_shiftdialog.py11
-rw-r--r--tox.ini6
24 files changed, 625 insertions, 46 deletions
diff --git a/.gitignore b/.gitignore
index f1334df..392a03d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,3 +9,4 @@
.pytest_cache
.tox
.eggs
+logs
diff --git a/RADIOS.md b/RADIOS.md
new file mode 100644
index 0000000..0515fa1
--- /dev/null
+++ b/RADIOS.md
@@ -0,0 +1,505 @@
+# List of Supported Radios (Tested and Untested)
+
+Below is a list of radios that are known to work with the original CHIRP program.
+
+Radios marked `TESTED` are known to work with the current release of py3-CHIRP.
+
+## Radios
+
+# Abbree
+
+- AR-F3 (use Baofeng UV-82III)
+- AR-F8 (use Wouxun KG-UV8D)
+
+# Alinco
+
+- DJ-175T
+- DJ-596T
+- DJ-G7EG
+- DR-03T
+- DR-06T
+- DR-135T
+- DR-235T
+- DR-435T
+
+# Ansoko
+
+- A-5R
+- A-8S
+
+# AnyTone
+
+- AT-778UV
+- AT-5888UV
+- OBLTR-8R
+- TERMN-8R
+
+# Arcshell
+
+- AR-5
+- AR-6
+- AR-7 (use Radtel T18)
+
+# Baiston
+
+- BST-2100 (use Baofeng BF-888)
+
+# Baofeng/Pofung
+
+- 997-S (Foscam Digital Technologies) (use UV-5R)
+- B-580T (use UV-5R)
+- BF-88E (use BF-888S)
+- BF-666S/777S/888S
+- BF-9100 (use BF/T1)
+- BF-A58, BF-A58S
+- BF-C2 (use BF-888S)
+- BF-E500S (use UV-5R)
+- BF-F8, F8+ (use UV-5R)
+- BF-F8+III (use Radioddity UV-5RX3)
+- BF-F8HP (3 power levels) `TESTED`
+- BF-F9 (use UV-5R)
+- BF-F9V2+ (use BF-F8HP) `TESTED`
+- BF-F11 (use UV-5R)
+- BF-R3 (use Radioddity UV-5RX3)
+- BF-R5 Mini (use BF-888S)
+- BF-S5 Plus (use UV-82III)
+- BF-T1
+- BF-UV9R+HP (use UV-82WP)
+- BF-UV10R (use BF-F8HP 3 power levels) `TESTED`
+- BF-UVF10 (use BF-A58S)
+- BF-UVB2+ (use UV-5R)
+- BF-V9 (use BF-888)
+- BF-V85 (use UV-B5)
+- F-11 (use UV-B5)
+- FF-12P (use UV-5R)
+- GT-1 (use BF-888S)
+- GT-3, GT-3 MK II (use UV-5R)
+- GT-3TP (use BF-F8HP) `TESTED`
+- GT-3WP
+- GT-5 (use UV-82)
+- GT-5TP (use UV-82HP)
+- Mini (use BF-T1)
+- UV-3R
+- UV-5R and variants (2 power levels)
+- UV-5R V2+, UV-5R2 (use UV-5R)
+- UV-5R+ (use BF-F8HP) `TESTED`
+- UV-5R++ (use UV-5R)
+- UV-5R7W (use BF-F8HP) `TESTED`
+- UV-5RA, UV-5RA+, UV-5RAX, UV-5RAX+ (use UV-5R)
+- UV-5RB (use UV-5R)
+- UV-5RC, UV-5RC, UV-5RCX+ (use UV-5R)
+- UV-5RD (use UV-5R)
+- UV-5RE, UV-5RE+ (use UV-5R)
+- UV-5RG, RK, RQ, RS, RT, RU (use UV-5R)
+- UV-5RHP (use BF-F8HP) `TESTED`
+- UV-5RIII (use Radioddity UV-5RX3)
+- UV-5RM HP (use BF-F8HP) `TESTED`
+- UV-5RTP (use BF-F8HP) `TESTED`
+- UV-5RWP (use UV-82WP)
+- UV-5RX3 (use Radioddity UV-5RX3)
+- UV-5S, 5X (use UV-5R)
+- UV-5XP
+- UV-6
+- UV-6R
+- UV-8R (use UV-82HP)
+- UV-9R/9R PLUS/9R ERA
+- UV-9S (use Radioddity UV-5RX3)
+- UV-9X+ (use UV-82HP)
+- UV-59T (use Radioddity UV-5RX3)
+- UV-82/82C/82L/82X
+- UV-82HP/82DX/82HX (3 power levels)
+- UV-82III (1 x PTT)
+- UV-82III (2 x PTT) (use Radioddity UV-82X3)
+- UV-82T (use Radioddity UV-82X3)
+- UV-82WP
+- UV-82X3 (use Radioddity UV-82X3)
+- UV-920 (use UV-5R)
+- UV-B2 (use UV-82)
+- UV-B2+, B3+ (use UV-5R)
+- UV-B5, B6
+- UV-S9 (use BF-F8HP) `TESTED`
+- UV-S9T (use Radioddity UV-5RX3)
+- UV-X9 (use UV-82HP)
+
+# Baojie
+
+- BJ-218 (Variant of Luiton LT-725uv)
+- BJ-318 (use Baojie BJ-218)
+- BJ-9900
+- BJ-UV55
+
+# Boblov
+
+- X3+
+
+# BTech
+
+- GMRS-50X1
+- GMRS-V1
+- MURS-V1
+- UV-2501
+- UV-2501+220
+- UV-25X2
+- UV-25X4
+- UV-5001
+- UV-50X2
+- UV-50X3
+- UV-5X3
+
+# Cignus
+
+- UV-85 (use Baofeng UV-5R)
+- UV-87 (use TYT TH-UV88)
+
+# CRT
+
+- Micron UV (Variant of Anytone AT-778UV)
+
+# eSYNiC
+
+- ESY-88 (Variant of Baofeng BF-888s)
+
+# Feidaxin
+
+- FD-150A
+- FD-160A
+- FD-268A, B
+- FD-288A, B
+- FD-450A
+- FD-460A, UH
+
+# Greaval
+
+- GV-8S
+- GV-9S
+
+# Hesenate
+
+- BJ-218 (Variant of Luiton LT-725uv)
+- HT-5RX3 (use Radioddity UV-5RX3)
+- HT-U222 (use Retevis RT22)
+
+# HobbyPCB
+
+- RS-UV3
+
+# Icom
+
+- IC-80AD
+- IC-91, IC-92AD
+- IC-208H
+- IC-746
+- IC-910H
+- IC-2100H
+- IC-2200H
+- IC-2300H
+- IC-2720H
+- IC-2730A
+- IC-2820H
+- IC-7000
+- IC-7100
+- IC-7200
+- IC-E90
+- IC-P7
+- IC-Q7A
+- IC-T70
+- IC-T7H
+- IC-T8A
+- IC-T90
+- IC-V82, IC-U82
+- IC-V86
+- IC-W32A, E
+- ID-31A
+- ID-51, ID-51+
+- ID-80H
+- ID-800H
+- ID-880H
+- ID-RPx000V/RP2x
+
+# Intek
+
+- HR-2040 (use Anytone AT-5888UB)
+- KT-980HP (Variant of Baofeng UV-5R)
+
+# Jetstream
+
+- JT220M
+- JT270M, MH
+- JT2705M (Variant of Waccom Mini 8900)
+
+# Juentai
+
+- JT-6188 Mini (Variant of QYT KT8900)
+- JT-6188 Plus (Variant of Waccom Mini 8900)
+
+# Kenwood
+
+- TH-D7, TH-D7G
+- TH-D72
+- TH-F6
+- TH-F7
+- TH-G71
+- TH-K2
+- TK-260/270/272/278
+- TK-260G/270G/272G/278G
+- TK-360/370/372/378
+- TK-360G/370G/372G/378G/388G
+- TK-760/762/768
+- TK-760G/762G/768G
+- TK-860/862/868
+- TK-860G/862G/868G
+- TK-7102/8102/7108/8108
+- TK-2180/3180/7180/8180
+- TM-271
+- TM-281
+- TM-471
+- TM-D700
+- TM-D710, TM-D710G
+- TM-G707
+- TM-V7
+- TM-V71
+- TS-480HX/SAT
+- TS-590S/SG
+- TS-850
+- TS-2000
+
+# KYD
+
+- IP-620
+- NC-630A
+
+# Leadzm
+
+- LE-C2 (Variant of Baofeng BF-C2)
+
+# Leixen
+
+- VV-898, VV-898S, VV-898E
+
+# Luiton
+
+- LT-316 (Variant of Retevis RT22)
+- LT-580 VHF, UHF
+- LT-588UV (Variant of QYT KT8900)
+- LT-725UV
+- LT-898UV (Variant of Leixen VV-898)
+
+# Midland
+
+- DBR2500 (Variant of Anytone AT-778UV)
+
+# MTC
+
+- UV-5R-3
+
+# NKTech
+
+- UV-7RX (use Retevis RT6)
+
+# Plant-Tours
+
+- MT-700
+
+# Pofung
+
+- (see Baofeng)
+
+# Polmar
+
+- DB-50M (use Anytone AT-5888UV)
+
+# Powerwerx
+
+- DB-750X (use Anytone AT-5888UV)
+
+# Puxing
+
+- PX-2R (UHF)
+- PX-777
+- PX-888K
+
+# QYT
+
+- KT980+ (same as KT-8900D)
+- KT7900D
+- KT8900 (same as KT-8900)
+- KT8900R
+- KT8900D
+- KT-8R
+- KT-UV980 (Variant of Waccom Mini 8900)
+
+# R&L Electronics
+
+- UV-5R 3 band (use Radioddity UV-5RX3)
+
+# Radioddity
+
+- DB25 (Variant of QYT KT8900D)
+- GA-2S
+- GA-5S
+- GA-510
+- QB25
+- R2
+- UV-5R EX
+- UV-5RX3
+- UV-82X3
+
+# Radtel
+
+- RT-10 (use Retevis RT22)
+- T18
+
+# Retevis
+
+- H-777 (use Baofeng BF-888)
+- RT1
+- RT5 with 2 power levels (use Baofeng UV-5R)
+- RT5 with 3 power levels (variant of Baofeng BF-F8HP) `TESTED`
+- RT-5R, RT-5RV (Variants of Baofeng UV-5R)
+- RT6
+- RT21
+- RT22
+- RT23
+- RT24
+- RT26
+- RT95 (Variant of Anytone AT-778UV)
+- RT-B6 (use Baofeng UV-B5)
+
+# Rugged Radios
+
+- RH5R, RH5R-V2 (use Baofeng UV-5R)
+- RH5X (Variant of Baofeng BF-A58)
+
+# Sainsonic
+
+- GT-3TP (use Baofeng BF-F8HP) `TESTED`
+- GT-890 (Variant of QYT KT8900)
+
+# Standard Horizon
+
+- (see Yaesu)
+
+# Surecom
+
+- KT8900D (Variant of QYT KT7900D)
+
+# Tacklife
+
+- MTR01 (use Radioddity R2)
+
+# TDXone
+
+- TD-Q8A
+
+# TechSide
+
+- TI-F8+ (Variant of the Baofeng BF-F8HP) `TESTED`
+
+# Tenway
+
+- TW-325
+- UV-5R Pro (Variant of the Baofeng BF-F8HP) `TESTED`
+- UV-82 Pro
+
+# TIDRADIO
+
+- BF-F8TD (use TD-UV5R TriPower)
+- TD-UV5R TriPower
+- TD-H6
+
+# TID
+
+- TD-M8
+
+# Tonfa
+
+- UV-985 (use Baofeng UV-5R)
+
+# TYT
+
+- TH-350
+- TH-7800
+- TH-9000 (each 144, 220, 440)
+- TH-9800
+- TH-UV3R, TH-UV3R-25
+- TH-UV8000D/E
+- TH-UV88
+- TH-UVF1
+- TH-UVF8D
+
+# Vero
+
+- UV-E5, UV-E5 MK II (use Baofeng UV-5R)
+
+# Vertex Standard
+
+- (see Yaesu)
+
+# Waccom
+
+- MINI-8900
+
+# WLN
+
+- KD-C1 (Variant of Retevis RT22)
+
+# Wouxun
+
+- KG-816/818
+- KG-UVD1P/UV2D/UV3D
+- KG-UV6D/UV6X
+- KG-UV7D (use KG-UV6)
+- KG-UV8D
+- KG-UV8D Plus
+- KG-UV8E
+- KG-UV8T
+- KG-UV9D Plus
+- KG-UVD1P
+
+# Yaesu
+
+- FT-1D
+- FT-2D
+- FT-3D
+- FT-4VR
+- FT-4XE, R
+- FT-25R
+- FT-50R
+- FT-60R
+- FT-65E, R
+- FT-70D
+- FT-90R
+- FT-450D
+- FT-817/ND
+- FT-818/ND
+- FT-857/D
+- FT-897
+- FT-1500M
+- FT-1802M
+- FT-2800M
+- FT-1900R/2900M
+- FT-7100M
+- FT-7800/7900
+- FT-8100
+- FT-8800
+- FT-8900
+- FTM-350
+- FTM-3100 (use FTM-3200D selection)
+- FTM-3200D
+- VX-2R
+- VX-3R
+- VX-5R
+- VX-6, 6R
+- VX-7R
+- VX-8, 8R, 8D, 8G
+- VX-170
+- VXA-700
+
+# Zastone
+
+- BJ-218 (Variant of Luiton LT-725uv)
+- MP-300 (Variant of QYT KT8900)
+- MP-380 (use QYT KT8900D)
+- MP-800 (use TYT TH-9800)
+- ZT-V8, V8A, V8A+ (use Baofeng UV-R5)
+- ZT-X6 (Variant of Retevis RT22)
diff --git a/README.md b/README.md
index e0ad693..42549be 100644
--- a/README.md
+++ b/README.md
@@ -17,6 +17,8 @@ py3-CHIRP has been tested in Python3.9 on various platforms. Known dependencies
## Testing
+For a list of supported radios (tested and untested) see [RADIOS.md](https://github.com/mpoletiek/py3-CHIRP/blob/main/RADIOS.md)
+
Depending on the platform you're testing on, you should use a different script to start CHIRP.
### Linux & MacOS
@@ -26,6 +28,7 @@ Depending on the platform you're testing on, you should use a different script t
`chirpwx.py`
+
## The Story
When I first started using Gentoo again CHIRP was still a part of the main Gentoo Portage Repository.
diff --git a/chirp/directory.py b/chirp/directory.py
index f79f23d..60c3813 100644
--- a/chirp/directory.py
+++ b/chirp/directory.py
@@ -227,3 +227,5 @@ def safe_import_drivers(limit=None):
__import__('chirp.drivers.%s' % driver_module)
except Exception as e:
print('Failed to import %s: %s' % (module, e))
+ #Use the below line for more information when troubleshooting
+ #traceback.print_exc()
diff --git a/chirp/drivers/ap510.py b/chirp/drivers/ap510.py
index f905d31..724e4e0 100644
--- a/chirp/drivers/ap510.py
+++ b/chirp/drivers/ap510.py
@@ -242,7 +242,8 @@ class AP510Memory(object):
class AP510Memory20141215(AP510Memory):
"""Compatible with firmware version 20141215"""
- ATTR_MAP = dict(AP510Memory.ATTR_MAP.items() + {
+ ATTR_MAP = dict(AP510Memory.ATTR_MAP.items())
+ ATTR_MAP.update({
'tx_volume': '21', # 1-6
'rx_volume': '22', # 1-9
'tx_power': '23', # 1: 1 watt, 0: 0.5 watt
@@ -252,7 +253,7 @@ class AP510Memory20141215(AP510Memory):
'path3': '27', # like "WIDE1 1" else "0"
'multiple': '28',
'auto_on': '29',
- }.items())
+ })
def get_multiple(self):
return dict(zip(
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/ft450d.py b/chirp/drivers/ft450d.py
index 12af6b8..4d49ea5 100644
--- a/chirp/drivers/ft450d.py
+++ b/chirp/drivers/ft450d.py
@@ -304,8 +304,23 @@ class FT450DRadio(yaesu_clone.YaesuCloneModeRadio):
struct mem_struct current;
"""
- _CALLSIGN_CHARSET = [chr(x) for x in range(ord("0"), ord("9") + 1) +
- range(ord("A"), ord("Z") + 1) + [ord(" ")]]
+ temp_list = []
+
+ for x in range(ord("0"),ord("9")+1):
+ temp_list.append(chr(x))
+
+ for x in range(ord("A"),ord("Z")+1):
+ temp_list.append(chr(x))
+
+ temp_list.append(chr(ord(" ")))
+
+ #print(temp_list)
+
+ #_CALLSIGN_CHARSET = [chr(x) for x in range(ord("0"), ord("9") + 1) +
+ # range(ord("A"), ord("Z") + 1) + [ord(" ")]]
+
+ _CALLSIGN_CHARSET = temp_list
+
_CALLSIGN_CHARSET_REV = dict(zip(_CALLSIGN_CHARSET,
range(0, len(_CALLSIGN_CHARSET))))
diff --git a/chirp/drivers/kguv8dplus.py b/chirp/drivers/kguv8dplus.py
index 64f09ae..185c452 100644
--- a/chirp/drivers/kguv8dplus.py
+++ b/chirp/drivers/kguv8dplus.py
@@ -666,9 +666,9 @@ class KGUV8DPlusRadio(chirp_common.CloneModeRadio,
_nam = self._memobj.names[number]
if mem.empty:
- _mem.set_raw("\x00" * (_mem.size() / 8))
+ _mem.set_raw("\x00" * int((_mem.size() / 8)))
self._memobj.valid[number] = 0
- self._memobj.names[number].set_raw("\x00" * (_nam.size() / 8))
+ self._memobj.names[number].set_raw("\x00" * int((_nam.size() / 8)))
return
_mem.rxfreq = int(mem.freq / 10)
diff --git a/chirp/drivers/leixen.py b/chirp/drivers/leixen.py
index fd580d4..e9a39d6 100644
--- a/chirp/drivers/leixen.py
+++ b/chirp/drivers/leixen.py
@@ -226,8 +226,8 @@ PFKEYSHORT_LIST = ["OFF",
]
MODES = ["NFM", "FM"]
-WTFTONES = map(float, xrange(56, 64))
-TONES = WTFTONES + chirp_common.TONES
+WTFTONES = map(float, range(56, 64))
+TONES = list(WTFTONES) + chirp_common.TONES
DTCS_CODES = [17, 50, 645] + chirp_common.DTCS_CODES
DTCS_CODES.sort()
TMODES = ["", "Tone", "DTCS", "DTCS"]
diff --git a/chirp/drivers/puxing_px888k.py b/chirp/drivers/puxing_px888k.py
index 78f49a6..7e4fb83 100644
--- a/chirp/drivers/puxing_px888k.py
+++ b/chirp/drivers/puxing_px888k.py
@@ -527,7 +527,11 @@ BACKLIGHT_MODES = ["Off", "Auto", "On"]
TONE_RESET_TIME = ['Off'] + ['%ds' % x for x in range(1, 256)]
DTMF_TONE_RESET_TIME = TONE_RESET_TIME[0:16]
-DTMF_GROUPS = zip(["Off", "A", "B", "C", "D", "*", "#"], [255]+range(10, 16))
+temp_list = [255]
+for x in range(10,16):
+ temp_list.append(x)
+
+DTMF_GROUPS = zip(["Off", "A", "B", "C", "D", "*", "#"], temp_list)
FIVE_TONE_STANDARDS = ['ZVEI1', 'ZVEI2', 'CCIR1', 'CCITT']
# should mimic the defaults in the memedit MemoryEditor somewhat
@@ -540,13 +544,18 @@ SANE_MEMORY_DEFAULT = b"\x14\x61\x00\x00\x14\x61\x00\x00" + \
# these two option sets are listed differently like this in the stock software,
# so I'm keeping them separate for now if they are in fact identical
# in behaviour, that should probably be amended
+temp_list = [255]
+for x in range(1,4):
+ temp_list.append(x)
+
DTMF_ALERT_TRANSPOND = zip(['Off', 'Call alert',
'Transpond-alert',
'Transpond-ID code'],
- [255]+range(1, 4))
+ temp_list)
+
FIVE_TONE_ALERT_TRANSPOND = zip(['Off', 'Alert tone',
'Transpond', 'Transpond-ID code'],
- [255]+range(1, 4))
+ temp_list)
BFM_BANDS = ['87.5-108MHz', '76.0-91.0MHz', '76.0-108.0MHz', '65.0-76.0MHz']
BFM_STRIDE = ['100kHz', '50kHz']
@@ -1142,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/tk270.py b/chirp/drivers/tk270.py
index b7927d2..89961ee 100644
--- a/chirp/drivers/tk270.py
+++ b/chirp/drivers/tk270.py
@@ -96,7 +96,7 @@ struct {
MEM_SIZE = 0x400
BLOCK_SIZE = 8
-MEM_BLOCKS = range(0, (MEM_SIZE / BLOCK_SIZE))
+MEM_BLOCKS = range(0, int(int(MEM_SIZE) / BLOCK_SIZE))
ACK_CMD = "\x06"
TIMEOUT = 0.05 # from 0.03 up it' s safe, we set in 0.05 for a margin
diff --git a/chirp/drivers/tk760.py b/chirp/drivers/tk760.py
index c9a2ff1..c272574 100644
--- a/chirp/drivers/tk760.py
+++ b/chirp/drivers/tk760.py
@@ -97,7 +97,7 @@ KEYS = {
MEM_SIZE = 0x400
BLOCK_SIZE = 8
-MEM_BLOCKS = range(0, (MEM_SIZE / BLOCK_SIZE))
+MEM_BLOCKS = range(0, int((int(MEM_SIZE) / BLOCK_SIZE)))
ACK_CMD = "\x06"
# from 0.03 up it' s safe
# I have to turn it up, some users reported problems with this, was 0.05
diff --git a/chirp/drivers/tk760g.py b/chirp/drivers/tk760g.py
index 212eb73..6e62c19 100644
--- a/chirp/drivers/tk760g.py
+++ b/chirp/drivers/tk760g.py
@@ -264,12 +264,19 @@ struct {
MEM_SIZE = 0x8000 # 32,768 bytes
BLOCK_SIZE = 256
BLOCKS = MEM_SIZE / BLOCK_SIZE
-MEM_BLOCKS = range(0, BLOCKS)
+MEM_BLOCKS = range(0, int(BLOCKS))
# define and empty block of data, as it will be used a lot in this code
EMPTY_BLOCK = "\xFF" * 256
-RO_BLOCKS = range(0x10, 0x1F) + range(0x59, 0x5f)
+RO_BLOCKS = []
+for x in range(0x10,0x1F):
+ RO_BLOCKS.append(x)
+
+for x in range(0x59,0x5f):
+ RO_BLOCKS.append(x)
+
+#RO_BLOCKS = range(0x10, 0x1F) + range(0x59, 0x5f)
ACK_CMD = "\x06"
POWER_LEVELS = [chirp_common.PowerLevel("Low", watts=1),
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 4520aca..8fb453d 100644
--- a/chirp/drivers/ts850.py
+++ b/chirp/drivers/ts850.py
@@ -37,7 +37,7 @@ TS850_MODES = {
"CW-R": "7",
"FSK-R": "9",
}
-TS850_MODES_REV = {val: mode for mode, val in TS850_MODES.iteritems()}
+TS850_MODES_REV = {val: mode for mode, val in TS850_MODES.items()}
TS850_TONES = list(chirp_common.OLD_TONES)
TS850_TONES.remove(69.3)
@@ -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)
diff --git a/tests/run_tests.py b/tests/run_tests.py
index e13fd8c..0331e5e 100755
--- a/tests/run_tests.py
+++ b/tests/run_tests.py
@@ -26,6 +26,7 @@ import glob
import tempfile
import time
from optparse import OptionParser
+#import serial
from serial import Serial
# change to the tests directory
@@ -52,7 +53,7 @@ logger.handle_options(LoggerOpts())
from chirp import CHIRP_VERSION
# FIXME: Not all drivers are py3 compatible in syntax, so punt on this
# until that time, and defer to the safe import loop below.
-# from chirp.drivers import *
+from chirp.drivers import *
from chirp import chirp_common, directory
from chirp import import_logic, memmap, settings, errors
from chirp import settings
diff --git a/tests/unit/base.py b/tests/unit/base.py
index 1e112ce..65f2eee 100644
--- a/tests/unit/base.py
+++ b/tests/unit/base.py
@@ -3,10 +3,12 @@ import unittest
import mock
-try:
- import mox
-except ImportError:
- from mox3 import mox
+from mox3 import mox
+
+#try:
+# import mox3
+#except ImportError:
+# from mox3 import mox
import warnings
warnings.simplefilter('ignore', Warning)
diff --git a/tests/unit/test_memedit_edits.py b/tests/unit/test_memedit_edits.py
index fdf971c..167f467 100644
--- a/tests/unit/test_memedit_edits.py
+++ b/tests/unit/test_memedit_edits.py
@@ -1,7 +1,10 @@
-try:
- import mox
-except ImportError:
- from mox3 import mox
+from mox3 import mox
+
+#try:
+# import mox3
+#except ImportError:
+# from mox3 import mox
+
from tests.unit import base
__builtins__["_"] = lambda s: s
diff --git a/tests/unit/test_platform.py b/tests/unit/test_platform.py
index 394f894..3dbca47 100644
--- a/tests/unit/test_platform.py
+++ b/tests/unit/test_platform.py
@@ -14,10 +14,14 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import unittest
-try:
- import mox
-except ImportError:
- from mox3 import mox
+
+from mox3 import mox
+
+#try:
+# import mox3
+#except ImportError:
+# from mox3 import mox
+
import os
from tests.unit import base
diff --git a/tests/unit/test_shiftdialog.py b/tests/unit/test_shiftdialog.py
index fe0b62d..d146e4d 100644
--- a/tests/unit/test_shiftdialog.py
+++ b/tests/unit/test_shiftdialog.py
@@ -1,8 +1,11 @@
import unittest
-try:
- import mox
-except ImportError:
- from mox3 import mox
+
+from mox3 import mox
+
+#try:
+# import mox3
+#except ImportError:
+# from mox3 import mox
from tests.unit import base
from chirp import chirp_common
diff --git a/tox.ini b/tox.ini
index 32f367e..dafd59b 100644
--- a/tox.ini
+++ b/tox.ini
@@ -3,7 +3,7 @@ envlist = unit,driver,style,py3clean,py3unit,py3driver
skipsdist = True
[testenv]
-basepython = python2.7
+basepython = python3.7
sitepackages = True
passenv = HOME
whitelist_externals = bash
@@ -40,7 +40,7 @@ commands =
py3clean chirp tests
[testenv:py3unit]
-basepython = python3
+basepython = python3.7
sitepackages = False
setenv =
PYTHONPATH=../..
@@ -51,7 +51,7 @@ commands =
pytest --disable-warnings -v tests/unit {posargs}
[testenv:py3driver]
-basepython = python3
+basepython = python3.7
sitepackages = False
setenv =
PYTHONPATH=../..