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

Tom Hayward
Wed May 8 22:42:38 PDT 2013


# HG changeset patch
# User Tom Hayward <tom at tomh.us>
# Date 1368043662 25200
# Node ID 015adbb7dfe9055ba0c881a7508cccfc961f51b3
# Parent  f6c48f71ea6c96b969751f136e40e6c0128960a4
[thd7] Fix supported tones list. #859

diff -r f6c48f71ea6c -r 015adbb7dfe9 chirp/kenwood_live.py
--- a/chirp/kenwood_live.py	Sun May 05 10:30:26 2013 -0700
+++ b/chirp/kenwood_live.py	Wed May 08 13:07:42 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