
# HG changeset patch # User Zachary T Welch zach@mandolincreekfarm.com # Fake Node ID c8b271a86a8ee9ebd4c37073eedef7e0f19b0a98
Fix pylint issues with chirp/ files (#159)
diff --git a/chirp/bandplan.py b/chirp/bandplan.py index 97f2425..37dac30 100644 --- a/chirp/bandplan.py +++ b/chirp/bandplan.py @@ -13,10 +13,15 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see http://www.gnu.org/licenses/.
+""" +Provides the Band class to use for defining band plans. +""" + from chirp import chirp_common
class Band(object): + """Represents a single band allocation.""" def __init__(self, limits, name, mode=None, step_khz=None, input_offset=None, output_offset=None, tones=None): # Apply semantic and chirp limitations to settings. @@ -56,10 +61,12 @@ class Band(object): other.limits[1] == self.limits[1])
def contains(self, other): + """Return True if the other band exists inside this band.""" return (other.limits[0] >= self.limits[0] and other.limits[1] <= self.limits[1])
def width(self): + """Return the band width.""" return self.limits[1] - self.limits[0]
def inverse(self): diff --git a/chirp/bandplan_au.py b/chirp/bandplan_au.py index 9f4ba50..e025f39 100644 --- a/chirp/bandplan_au.py +++ b/chirp/bandplan_au.py @@ -13,6 +13,9 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see http://www.gnu.org/licenses/.
+""" +The band plan for Australia. +"""
from chirp import bandplan, bandplan_iaru_r3
diff --git a/chirp/bandplan_iaru_r1.py b/chirp/bandplan_iaru_r1.py index e41b0ee..5e48b49 100644 --- a/chirp/bandplan_iaru_r1.py +++ b/chirp/bandplan_iaru_r1.py @@ -13,6 +13,10 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see http://www.gnu.org/licenses/.
+""" +The band plan for IARU Region 1. +""" + from chirp import bandplan
SHORTNAME = "iaru_r1" diff --git a/chirp/bandplan_iaru_r2.py b/chirp/bandplan_iaru_r2.py index 5886187..ce67334 100644 --- a/chirp/bandplan_iaru_r2.py +++ b/chirp/bandplan_iaru_r2.py @@ -13,6 +13,10 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see http://www.gnu.org/licenses/.
+""" +The band plan for IARU Region 2. +""" + from chirp import bandplan
SHORTNAME = "iaru_r2" diff --git a/chirp/bandplan_iaru_r3.py b/chirp/bandplan_iaru_r3.py index 08bb56e..a72a613 100644 --- a/chirp/bandplan_iaru_r3.py +++ b/chirp/bandplan_iaru_r3.py @@ -13,6 +13,10 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see http://www.gnu.org/licenses/.
+""" +The band plan for IARU Region 3. +""" + from chirp import bandplan
SHORTNAME = "iaru_r3" diff --git a/chirp/bandplan_na.py b/chirp/bandplan_na.py index 50bbb27..1e5d746 100644 --- a/chirp/bandplan_na.py +++ b/chirp/bandplan_na.py @@ -13,6 +13,10 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see http://www.gnu.org/licenses/.
+""" +The band plan for North America. +""" + from chirp import bandplan, bandplan_iaru_r2
diff --git a/chirp/detect.py b/chirp/detect.py index 7f3ee87..2a0821d 100644 --- a/chirp/detect.py +++ b/chirp/detect.py @@ -13,6 +13,10 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see http://www.gnu.org/licenses/.
+""" +Automatic detection of connected radio. +""" + import serial import logging
@@ -80,8 +84,7 @@ def detect_icom_radio(port):
ser.close()
- LOG.info("Auto-detected %s %s on %s" % - (result.VENDOR, result.MODEL, port)) + LOG.info("Auto-detected %s %s on %s", result.VENDOR, result.MODEL, port)
return result
diff --git a/chirp/errors.py b/chirp/errors.py index f4d9324..d64b62b 100644 --- a/chirp/errors.py +++ b/chirp/errors.py @@ -13,6 +13,10 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see http://www.gnu.org/licenses/.
+""" +Defines exceptions used throughout CHIRP. +""" +
class InvalidDataError(Exception): """The radio driver encountered some invalid data""" diff --git a/chirp/memmap.py b/chirp/memmap.py index af0706c..ed1953f 100644 --- a/chirp/memmap.py +++ b/chirp/memmap.py @@ -13,10 +13,14 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see http://www.gnu.org/licenses/.
+""" +Represent a device's memory map. +""" + from chirp import util
-class MemoryMap: +class MemoryMap(object): """ A pythonic memory map interface """ @@ -79,7 +83,7 @@ class MemoryMap: return self.get_packed()
def __repr__(self): - return self.printable(printit=False) + return self.printable()
def truncate(self, size): """Truncate the memory map to @size""" diff --git a/chirp/util.py b/chirp/util.py index 1fc5529..e5dd31c 100644 --- a/chirp/util.py +++ b/chirp/util.py @@ -13,6 +13,10 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see http://www.gnu.org/licenses/.
+""" +Assorted utility routines used throughout CHIRP. +""" + import struct
diff --git a/tools/cpep8.lintful b/tools/cpep8.lintful index 15d6174..68c32b7 100644 --- a/tools/cpep8.lintful +++ b/tools/cpep8.lintful @@ -1,16 +1,9 @@ # cpep8.lintful: The list of files that do not meet pylint standards. # DO NOT ADD NEW FILES!! Instead, fix the code to be compliant. # Over time, this list should shrink and (eventually) be eliminated. -./chirp/bandplan.py -./chirp/bandplan_au.py -./chirp/bandplan_iaru_r1.py -./chirp/bandplan_iaru_r2.py -./chirp/bandplan_iaru_r3.py -./chirp/bandplan_na.py ./chirp/bitwise.py ./chirp/bitwise_grammar.py ./chirp/chirp_common.py -./chirp/detect.py ./chirp/directory.py ./chirp/drivers/alinco.py ./chirp/drivers/anytone.py @@ -89,9 +82,7 @@ ./chirp/drivers/wouxun_common.py ./chirp/drivers/yaesu_clone.py ./chirp/elib_intl.py -./chirp/errors.py ./chirp/import_logic.py -./chirp/memmap.py ./chirp/platform.py ./chirp/pyPEG.py ./chirp/ui/bandplans.py @@ -113,7 +104,6 @@ ./chirp/ui/reporting.py ./chirp/ui/settingsedit.py ./chirp/ui/shiftdialog.py -./chirp/util.py ./chirp/xml_ll.py ./chirpc ./chirpw