# HG changeset patch # User Zachary T Welch zach@mandolincreekfarm.com # Fake Node ID 349ea8dee133e881f58aa9bb12a57ad66b33f118
Fix style issues in some drivers (#2355)
diff --git a/chirp/drivers/ft1802.py b/chirp/drivers/ft1802.py index a491907..952a23c 100644 --- a/chirp/drivers/ft1802.py +++ b/chirp/drivers/ft1802.py @@ -94,15 +94,15 @@ class FT1802Radio(yaesu_clone.YaesuCloneModeRadio): def get_prompts(cls): rp = chirp_common.RadioPrompts() rp.pre_download = _(dedent("""\ - 1. Turn radio off. - 2. Connect cable to mic jack. - 3. Press and hold in the [LOW(A/N)] key while turning the radio on. - 4. <b>After clicking OK</b>, press the [MHz(SET)] key to send image.""")) +1. Turn radio off. +2. Connect cable to mic jack. +3. Press and hold in the [LOW(A/N)] key while turning the radio on. +4. <b>After clicking OK</b>, press the [MHz(SET)] key to send image.""")) rp.pre_upload = _(dedent("""\ - 1. Turn radio off. - 2. Connect cable to mic jack. - 3. Press and hold in the [LOW(A/N)] key while turning the radio on. - 4. Press the [D/MR(MW)] key ("--WAIT--" will appear on the LCD).""")) +1. Turn radio off. +2. Connect cable to mic jack. +3. Press and hold in the [LOW(A/N)] key while turning the radio on. +4. Press the [D/MR(MW)] key ("--WAIT--" will appear on the LCD).""")) return rp
def get_features(self): @@ -113,8 +113,8 @@ class FT1802Radio(yaesu_clone.YaesuCloneModeRadio): rf.can_odd_split = True rf.has_ctone = False rf.has_tuning_step = True - rf.has_dtcs_polarity = False # in radio settings, not per memory - rf.has_bank = False # has banks, but not implemented + rf.has_dtcs_polarity = False # in radio settings, not per memory + rf.has_bank = False # has banks, but not implemented
rf.valid_tuning_steps = STEPS rf.valid_modes = MODES @@ -162,7 +162,8 @@ class FT1802Radio(yaesu_clone.YaesuCloneModeRadio): mem.freq = chirp_common.fix_rounded_step(int(_mem.freq) * 1000) mem.offset = chirp_common.fix_rounded_step(int(_mem.offset) * 1000) mem.duplex = DUPLEX[_mem.duplex] - mem.tuning_step = _mem.step_changed and STEPS[_mem.tune_step] or STEPS[0] + mem.tuning_step = _mem.step_changed and \ + STEPS[_mem.tune_step] or STEPS[0] if _mem.tmode < TMODES.index("Cross"): mem.tmode = TMODES[_mem.tmode] mem.cross_mode = CROSS_MODES[0] @@ -196,7 +197,7 @@ class FT1802Radio(yaesu_clone.YaesuCloneModeRadio): _flag = self._memobj.flags[mem.number/2]
nibble = (mem.number % 2) and "odd" or "even" - + valid = _flag["%s_valid" % nibble] visible = _flag["%s_visible" % nibble]
@@ -228,7 +229,8 @@ class FT1802Radio(yaesu_clone.YaesuCloneModeRadio): if mem.tmode != "Cross": _mem.tmode = TMODES.index(mem.tmode) else: - _mem.tmode = TMODES.index("Cross") + CROSS_MODES.index(mem.cross_mode) + _mem.tmode = TMODES.index("Cross") + \ + CROSS_MODES.index(mem.cross_mode) _mem.tone = chirp_common.TONES.index(mem.rtone) _mem.dtcs = chirp_common.DTCS_CODES.index(mem.dtcs)
@@ -239,7 +241,7 @@ class FT1802Radio(yaesu_clone.YaesuCloneModeRadio): except IndexError: raise Exception("Character `%s' not supported") if _mem.name[0] != 0xFF: - _mem.name[0] += 0x80 # show name instead of frequency + _mem.name[0] += 0x80 # show name instead of frequency
_mem.narrow = MODES.index(mem.mode) _mem.power = 3 if mem.power is None else POWER_LEVELS.index(mem.power) diff --git a/chirp/drivers/ft2800.py b/chirp/drivers/ft2800.py index d091d7b..52efe27 100644 --- a/chirp/drivers/ft2800.py +++ b/chirp/drivers/ft2800.py @@ -23,6 +23,8 @@ from yaesu_clone import YaesuCloneModeRadio LOG = logging.getLogger(__name__)
CHUNK_SIZE = 16 + + def _send(s, data): for i in range(0, len(data), CHUNK_SIZE): chunk = data[i:i+CHUNK_SIZE] @@ -35,6 +37,7 @@ IDBLOCK = "\x0c\x01\x41\x33\x35\x02\x00\xb8" TRAILER = "\x0c\x02\x41\x33\x35\x00\x00\xb7" ACK = "\x0C\x06\x00"
+ def _download(radio): data = "" for _i in range(0, 10): @@ -60,7 +63,7 @@ def _download(radio): elif len(chunk) != 38: print "Should fail?" break - #raise Exception("Failed to get full data block") + # raise Exception("Failed to get full data block") else: cs = 0 for byte in chunk[:-1]: @@ -82,6 +85,7 @@ def _download(radio):
return memmap.MemoryMap(data)
+ def _upload(radio): for _i in range(0, 10): data = radio.pipe.read(256) @@ -157,6 +161,7 @@ POWER_LEVELS = [chirp_common.PowerLevel("Hi", watts=65), ] CHARSET = chirp_common.CHARSET_UPPER_NUMERIC + "()+-=*/???|_"
+ @directory.register class FT2800Radio(YaesuCloneModeRadio): """Yaesu FT-2800""" @@ -176,7 +181,8 @@ class FT2800Radio(YaesuCloneModeRadio): rf.has_dtcs_polarity = False rf.has_bank = False
- rf.valid_tuning_steps = [5.0, 10.0, 12.5, 15.0, 20.0, 25.0, 50.0, 100.0] + rf.valid_tuning_steps = [5.0, 10.0, 12.5, 15.0, + 20.0, 25.0, 50.0, 100.0] rf.valid_modes = MODES rf.valid_tmodes = TMODES rf.valid_bands = [(137000000, 174000000)] diff --git a/chirp/drivers/ft50.py b/chirp/drivers/ft50.py index 2f726ec..6a9cf21 100644 --- a/chirp/drivers/ft50.py +++ b/chirp/drivers/ft50.py @@ -16,8 +16,9 @@ from chirp.drivers import yaesu_clone, ft50_ll from chirp import chirp_common, directory
+ # Not working, don't register -#@directory.register +# @directory.register class FT50Radio(yaesu_clone.YaesuCloneModeRadio): BAUD_RATE = 9600 VENDOR = "Yaesu" @@ -32,7 +33,7 @@ class FT50Radio(yaesu_clone.YaesuCloneModeRadio): rf.memory_bounds = (1, 100) rf.has_dtcs_polarity = False rf.has_bank = False - rf.valid_modes = [ "FM", "WFM", "AM" ] + rf.valid_modes = ["FM", "WFM", "AM"] return rf
def _update_checksum(self): diff --git a/tools/cpep8.blacklist b/tools/cpep8.blacklist index fa6ebdb..81065eb 100644 --- a/tools/cpep8.blacklist +++ b/tools/cpep8.blacklist @@ -1,9 +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/ft1802.py -./chirp/drivers/ft2800.py -./chirp/drivers/ft50.py ./chirp/drivers/ft50_ll.py ./chirp/drivers/ft60.py ./chirp/drivers/ft7800.py