diff options
author | Fred Wright <fw@fwright.net> | 2017-07-14 15:46:45 -0700 |
---|---|---|
committer | Fred Wright <fw@fwright.net> | 2017-07-14 15:46:45 -0700 |
commit | bda3f970bd713cf553dcca47beb22682a49c7081 (patch) | |
tree | 7e86c72d197cd335455c8da85e7045dd632ba35e /gps | |
parent | 81e3562ddf0817e513518dea866276729361d5e8 (diff) | |
download | gpsd-bda3f970bd713cf553dcca47beb22682a49c7081.tar.gz |
Fixes some pylint issues.
This doesn't fix all complaints by pylint, but significantly
reduces their number. Ditto for pep8 complaints.
Also makes a couple of related cosmetic edits.
TESTED:
Ran "scons build-all check" with no errors.
Both "pylint" and "pep8" targets report fewer issues.
Diffstat (limited to 'gps')
-rw-r--r-- | gps/__init__.py | 6 | ||||
-rw-r--r-- | gps/fake.py | 2 | ||||
-rwxr-xr-x | gps/gps.py | 3 | ||||
-rw-r--r-- | gps/misc.py | 4 |
4 files changed, 7 insertions, 8 deletions
diff --git a/gps/__init__.py b/gps/__init__.py index 553d30ea..06b87597 100644 --- a/gps/__init__.py +++ b/gps/__init__.py @@ -7,11 +7,11 @@ # Preserve this property! from __future__ import absolute_import # Ensure Python2 behaves like Python 3 -api_major_version = 5 # bumped on incompatible changes -api_minor_version = 0 # bumped on compatible changes - from .gps import * from .misc import * +api_major_version = 5 # bumped on incompatible changes +api_minor_version = 0 # bumped on compatible changes + # The 'client' module exposes some C utility functions for Python clients. # The 'packet' module exposes the packet getter via a Python interface. diff --git a/gps/fake.py b/gps/fake.py index 9d850518..a4b9c1b5 100644 --- a/gps/fake.py +++ b/gps/fake.py @@ -78,6 +78,7 @@ import pty import select import signal import socket +import stat import subprocess import sys import termios # fcntl, array, struct @@ -87,7 +88,6 @@ import time import gps from gps import polybytes from . import packet as sniffer -import stat # The magic number below has to be derived from observation. If # it's too high you'll slow the tests down a lot. If it's too low @@ -20,7 +20,6 @@ from __future__ import absolute_import, print_function, division from .client import * -from .misc import isotime NaN = float('nan') @@ -213,7 +212,7 @@ class gps(gpscommon, gpsdata, gpsjson): self.driver_mode = default("native", 0) self.mincycle = default("mincycle", NaN) self.serialmode = default("serialmode", "8N1") - # FIXME: decode DEVICSES + # FIXME: decode DEVICES # FIXME: decode PPS elif self.data.get("class") == "TPV": self.device = default("device", "missing") diff --git a/gps/misc.py b/gps/misc.py index 78b97093..f76bb89e 100644 --- a/gps/misc.py +++ b/gps/misc.py @@ -152,7 +152,7 @@ def EarthDistance(c1, c2): f = 1 / 298.257223563 b = 6356752.314245 # meters; b = (1 - f)a - MILES_PER_KILOMETER = 0.621371 + # MILES_PER_KILOMETER = 1000.0 / (.3048 * 5280.0) MAX_ITERATIONS = 200 CONVERGENCE_THRESHOLD = 1e-12 # .000,000,000,001 @@ -171,7 +171,7 @@ def EarthDistance(c1, c2): sinU2 = math.sin(U2) cosU2 = math.cos(U2) - for iteration in range(MAX_ITERATIONS): + for _ in range(MAX_ITERATIONS): sinLambda = math.sin(Lambda) cosLambda = math.cos(Lambda) sinSigma = math.sqrt((cosU2 * sinLambda) ** 2 + |