[chirp_devel] [PATCH] RE-APPLY [thd7] Fix supported tones list. #859

Tom Hayward
Tue May 14 12:21:40 PDT 2013


# HG changeset patch
# User Tom Hayward <tom at tomh.us>
# Date 1368559297 25200
# Node ID 337f99d1156727d5c60b01f6748e44929dd904d2
# Parent  40ec9b65ae38af741643125a7cc77a8c3304172f
RE-APPLY [thd7] Fix supported tones list. #859

diff -r 40ec9b65ae38 -r 337f99d11567 chirp/kenwood_live.py
--- a/chirp/kenwood_live.py	Thu May 09 14:47:30 2013 +0200
+++ b/chirp/kenwood_live.py	Tue May 14 12:21:37 2013 -0700
@@ -268,8 +268,23 @@
               "9 digit NMEA", "6 digit Magellan", "DGPS"],
 }
 
+class KenwoodOldLiveRadio(KenwoodLiveRadio):
+    _kenwood_valid_tones = list(chirp_common.OLD_TONES)
+
+    def set_memory(self, memory):
+        supported_tones = list(chirp_common.OLD_TONES)
+        supported_tones.remove(69.3)
+        if memory.rtone not in supported_tones:
+            raise errors.UnsupportedToneError("This radio does not support " +
+                                              "tone %.1fHz" % memory.rtone)
+        if memory.ctone not in supported_tones:
+            raise errors.UnsupportedToneError("This radio does not support " +
+                                              "tone %.1fHz" % memory.ctone)
+
+        return KenwoodLiveRadio.set_memory(self, memory)
+
 @directory.register
-class THD7Radio(KenwoodLiveRadio):
+class THD7Radio(KenwoodOldLiveRadio):
     """Kenwood TH-D7"""
     MODEL = "TH-D7"
 
@@ -543,26 +558,12 @@
         return mem
 
 @directory.register
-class TMV7Radio(KenwoodLiveRadio):
+class TMV7Radio(KenwoodOldLiveRadio):
     """Kenwood TM-V7"""
     MODEL = "TM-V7"
 
     mem_upper_limit = 200 # Will be updated
 
-    _kenwood_valid_tones = list(chirp_common.OLD_TONES)
-
-    def set_memory(self, memory):
-        supported_tones = list(chirp_common.OLD_TONES)
-        supported_tones.remove(69.3)
-        if memory.rtone not in supported_tones:
-            raise errors.UnsupportedToneError("This radio does not support " +
-                                              "tone %.1fHz" % memory.rtone)
-        if memory.ctone not in supported_tones:
-            raise errors.UnsupportedToneError("This radio does not support " +
-                                              "tone %.1fHz" % memory.ctone)
-
-        return KenwoodLiveRadio.set_memory(self, memory)
-
     def get_features(self):
         rf = chirp_common.RadioFeatures()
         rf.has_dtcs = False



More information about the chirp_devel mailing list