exporting patch: # HG changeset patch # User Mathias Weyland # Date 1520963591 -3600 # Tue Mar 13 18:53:11 2018 +0100 # Node ID 5080618c1fd0d1acab01ea5202ed5125a786b53a # Parent 056ccab1b395bd08613c67f81fff1a48f8ce1f06 [Alinco DJ-G7] Code cleanup to pass linter tests diff -r 056ccab1b395 -r 5080618c1fd0 chirp/drivers/alinco.py --- a/chirp/drivers/alinco.py Mon Mar 12 23:06:39 2018 +0000 +++ b/chirp/drivers/alinco.py Tue Mar 13 18:53:11 2018 +0100 @@ -749,9 +749,9 @@ # band. if mode not in ("NFM", "FM"): return 0x01 - if (freq >= 136000000 and freq < 174000000) or \ - (freq >= 400000000 and freq < 470000000) or \ - (freq >= 1240000000 and freq < 1300000000): + if (freq >= 136000000 and freq < 174000000) or \ + (freq >= 400000000 and freq < 470000000) or \ + (freq >= 1240000000 and freq < 1300000000): return 0x02 else: return 0x01 @@ -761,22 +761,26 @@ if _mem.empty != 0x00: if _mem.unknown1 == 0xffffff: # Previous versions of this code have skipped the unknown - # fields. They contain bytes of value if the channel is empty and - # thus those bytes remain 0xff when the channel is put to use. - # The radio is totally fine with this but the Alinco programming - # software is not (see #5275). Here, we check for this and - # report if it is encountered. - LOG.warning("Channel %d is inconsistent: Found 0xff in non-empty channel. Touch channel to fix." % number) + # fields. They contain bytes of value if the channel is empty + # and thus those bytes remain 0xff when the channel is put to + # use. The radio is totally fine with this but the Alinco + # programming software is not (see #5275). Here, we check for + # this and report if it is encountered. + LOG.warning("Channel %d is inconsistent: Found 0xff in " + "non-empty channel. Touch channel to fix." + % number) - if _mem.empty != self._get_empty_flag(_mem.freq, self.MODES[_mem.mode]): - LOG.warning("Channel %d is inconsistent: Found out of band frequency. Touch channel to fix." % number) + if _mem.empty != self._get_empty_flag(_mem.freq, + self.MODES[_mem.mode]): + LOG.warning("Channel %d is inconsistent: Found out of band " + "frequency. Touch channel to fix." % number) def process_mmap(self): self._memobj = bitwise.parse(DJG7EG_MEM_FORMAT, self._mmap) # We check all channels for corruption (see bug #5275) but we don't fix - # it automatically because it would be unpolite to modify something on a - # read operation. A log message is emitted though for the user to take - # actions. + # it automatically because it would be unpolite to modify something on + # a read operation. A log message is emitted though for the user to + # take actions. for number in range(len(self._memobj.memory)): self._check_channel_consistency(number)