[Git][NTPsec/ntpsec][master] Fix pyflakes warnings in gps-log for wildcard imports and unused modules

Gary E. Miller gitlab at mg.gitlab.com
Tue Jan 3 04:57:31 UTC 2017


Gary E. Miller pushed to branch master at NTPsec / ntpsec


Commits:
7855fa37 by Matt Selsky at 2017-01-02T23:53:09-05:00
Fix pyflakes warnings in gps-log for wildcard imports and unused modules

contrib/gps-log:7: 'datetime.datetime' imported but unused
contrib/gps-log:10: 'from gps import *' used; unable to detect undefined names
contrib/gps-log:15: gps may be undefined, or defined from star imports: gps
contrib/gps-log:15: WATCH_ENABLE may be undefined, or defined from star imports: gps
contrib/gps-log:30: isotime may be undefined, or defined from star imports: gps
contrib/gps-log:46: isnan may be undefined, or defined from star imports: gps

- - - - -


1 changed file:

- contrib/gps-log


Changes:

=====================================
contrib/gps-log
=====================================
--- a/contrib/gps-log
+++ b/contrib/gps-log
@@ -4,15 +4,14 @@
 from __future__ import print_function
 
 import time
-from datetime import datetime
 import sys
 import threading
-from gps import *
+import gps
 
 class GpsPoller(threading.Thread):
     def __init__(self):
         threading.Thread.__init__(self)
-        self.gpsd = gps(mode=WATCH_ENABLE) #starting the stream of info
+        self.gpsd = gps.gps(mode=gps.WATCH_ENABLE) #starting the stream of info
         self.running = True
 
     def run(self):
@@ -27,7 +26,7 @@ class GpsPoller(threading.Thread):
         "Displays the time, device, TDOP, and nSat data collected"
         #print(gpsd.fix.latitude,', ',gpsd.fix.longitude,'  Time: ',gpsd.utc)
         print('%s %s %f %d' % \
-                (isotime(self.get_time()),
+                (gps.isotime(self.get_time()),
                 self.gpsd.device,
                 self.gpsd.tdop,
                 self.gpsd.satellites_used))
@@ -43,7 +42,7 @@ if __name__ == '__main__':
             #It may take a second or two to get good data
 
             try:
-                if 'nan' != gpsp.get_time() and not isnan(gpsp.get_time()):
+                if 'nan' != gpsp.get_time() and not gps.isnan(gpsp.get_time()):
                     if last_time != gpsp.get_time():
                         gpsp.display()
                     last_time = gpsp.get_time()



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/7855fa37c895125c3ef1b9aba34666d6c0a6056c
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170103/f100531a/attachment.html>


More information about the vc mailing list