[chirp_devel] [PATCH 24/35] Fix style issues in ic2820.py (#2355)
Zachary T Welch
Tue Mar 3 17:48:36 PST 2015
# HG changeset patch
# User Zachary T Welch <zach at mandolincreekfarm.com>
# Fake Node ID a04cae6e0167ccd14e0da8aad157f0fdb7084108
Fix style issues in ic2820.py (#2355)
diff --git a/chirp/drivers/ic2820.py b/chirp/drivers/ic2820.py
index 8b507d9..37b996d 100644
--- a/chirp/drivers/ic2820.py
+++ b/chirp/drivers/ic2820.py
@@ -78,12 +78,13 @@ struct {
"""
TMODES = ["", "Tone", "??0", "TSQL", "??1", "??2", "DTCS"]
-DUPLEX = ["", "-", "+", "+"] # Not sure about index 3
-MODES = ["FM", "NFM", "AM", "??", "DV"]
-DTCSP = ["NN", "NR", "RN", "RR"]
+DUPLEX = ["", "-", "+", "+"] # Not sure about index 3
+MODES = ["FM", "NFM", "AM", "??", "DV"]
+DTCSP = ["NN", "NR", "RN", "RR"]
MEM_LOC_SIZE = 48
+
class IC2820Bank(icf.IcomNamedBank):
"""An IC2820 bank"""
def get_name(self):
@@ -94,9 +95,10 @@ class IC2820Bank(icf.IcomNamedBank):
_banks = self._model._radio._memobj.bank_names
_banks[self.index].name = str(name).ljust(8)[:8]
+
def _get_special():
- special = {"C0" : 500 + 20,
- "C1" : 500 + 21}
+ special = {"C0": 500 + 20,
+ "C1": 500 + 21}
for i in range(0, 10):
ida = "%iA" % i
@@ -106,15 +108,18 @@ def _get_special():
return special
+
def _resolve_memory_number(number):
if isinstance(number, str):
return _get_special()[number]
else:
return number
+
def _wipe_memory(mem, char):
mem.set_raw(char * (mem.size() / 8))
+
@directory.register
class IC2820Radio(icf.IcomCloneModeRadio, chirp_common.IcomDstarSupport):
"""Icom IC-2820"""
@@ -129,7 +134,8 @@ class IC2820Radio(icf.IcomCloneModeRadio, chirp_common.IcomDstarSupport):
(0x6960, 0x6980, 16),
(0x6980, 0x7160, 32),
(0x7160, 0x7180, 16),
- (0x7180, 0xACC0, 32),]
+ (0x7180, 0xACC0, 32),
+ ]
_num_banks = 26
_bank_class = IC2820Bank
@@ -231,7 +237,7 @@ class IC2820Radio(icf.IcomCloneModeRadio, chirp_common.IcomDstarSupport):
mem.dtcs = chirp_common.DTCS_CODES[_mem.dtcs]
mem.dtcs_polarity = DTCSP[_mem.dtcs_polarity]
if _mem.tune_step > 8:
- mem.tuning_step = 5.0 # Sometimes TS is garbage?
+ mem.tuning_step = 5.0 # Sometimes TS is garbage?
else:
mem.tuning_step = chirp_common.TUNING_STEPS[_mem.tune_step]
mem.name = str(_mem.name).rstrip()
@@ -285,10 +291,10 @@ class IC2820Radio(icf.IcomCloneModeRadio, chirp_common.IcomDstarSupport):
_mem.urcall = mem.dv_urcall.ljust(8)
_mem.r1call = mem.dv_rpt1call.ljust(8)
_mem.r2call = mem.dv_rpt2call.ljust(8)
-
+
def get_raw_memory(self, number):
return repr(self._memobj.memory[number])
-
+
def get_urcall_list(self):
_calls = self._memobj.urcall
calls = []
@@ -310,7 +316,7 @@ class IC2820Radio(icf.IcomCloneModeRadio, chirp_common.IcomDstarSupport):
def get_mycall_list(self):
_calls = self._memobj.mycall
calls = []
-
+
for i in range(*self.MYCALL_LIMIT):
calls.append(str(_calls[i-1].call))
diff --git a/tools/cpep8.blacklist b/tools/cpep8.blacklist
index 1895c15..b15e6c5 100644
--- a/tools/cpep8.blacklist
+++ b/tools/cpep8.blacklist
@@ -1,7 +1,6 @@
# cpep8.blacklist: The list of files that do not meet PEP8 standards.
# DO NOT ADD NEW FILES!! Instead, fix the code to be compliant.
# Over time, this list should shrink and (eventually) be eliminated.
-./chirp/drivers/ic2820.py
./chirp/drivers/ic9x.py
./chirp/drivers/ic9x_icf.py
./chirp/drivers/ic9x_icf_ll.py
More information about the chirp_devel
mailing list