[Git][NTPsec/ntpsec][master] 3 commits: PEP8: E111 indentation is not a multiple of four
Eric S. Raymond
gitlab at mg.gitlab.com
Tue Oct 4 03:29:06 UTC 2016
Eric S. Raymond pushed to branch master at NTPsec / ntpsec
Commits:
532cab4f by Matt Selsky at 2016-10-03T23:28:53-04:00
PEP8: E111 indentation is not a multiple of four
- - - - -
3cc2acb0 by Matt Selsky at 2016-10-03T23:28:53-04:00
PEP8: E303 too many blank lines (2)
- - - - -
b87ca16a by Matt Selsky at 2016-10-03T23:28:53-04:00
PEP8: E703 statement ends with a semicolon
- - - - -
3 changed files:
- contrib/gps-log
- ntpstats/ntpviz
- pylib/statfiles.py
Changes:
=====================================
contrib/gps-log
=====================================
--- a/contrib/gps-log
+++ b/contrib/gps-log
@@ -11,50 +11,50 @@ import threading
gpsd = None #seting the global variable
class GpsPoller(threading.Thread):
- def __init__(self):
- threading.Thread.__init__(self)
- global gpsd #bring it in scope
- gpsd = gps(mode=WATCH_ENABLE) #starting the stream of info
- self.current_value = None
- self.running = True
-
- def run(self):
- global gpsd
- while gpsp.running:
- gpsd.next() # loop and grab each set of gpsd info
+ def __init__(self):
+ threading.Thread.__init__(self)
+ global gpsd #bring it in scope
+ gpsd = gps(mode=WATCH_ENABLE) #starting the stream of info
+ self.current_value = None
+ self.running = True
+
+ def run(self):
+ global gpsd
+ while gpsp.running:
+ gpsd.next() # loop and grab each set of gpsd info
if __name__ == '__main__':
- gpsp = GpsPoller() # create the thread
- try:
- gpsp.start() # start it up
- last_time = 0
- print("# Time Device tdop nSat")
- while True:
- #It may take a second or two to get good data
- #print(gpsd.fix.latitude,', ',gpsd.fix.longitude,' Time: ',gpsd.utc)
-
- try:
- if 'nan' != gpsd.fix.time and not isnan(gpsd.fix.time):
- if last_time != gpsd.fix.time:
- # new fix, log it.
- print( '%s %s %f %d' % \
- (isotime(gpsd.fix.time),
- gpsd.device,
- gpsd.tdop,
- gpsd.satellites_used)
- )
- last_time = gpsd.fix.time
- except AttributeError as e:
- print( 'parse error\n')
+ gpsp = GpsPoller() # create the thread
+ try:
+ gpsp.start() # start it up
+ last_time = 0
+ print("# Time Device tdop nSat")
+ while True:
+ #It may take a second or two to get good data
+ #print(gpsd.fix.latitude,', ',gpsd.fix.longitude,' Time: ',gpsd.utc)
+
+ try:
+ if 'nan' != gpsd.fix.time and not isnan(gpsd.fix.time):
+ if last_time != gpsd.fix.time:
+ # new fix, log it.
+ print( '%s %s %f %d' % \
+ (isotime(gpsd.fix.time),
+ gpsd.device,
+ gpsd.tdop,
+ gpsd.satellites_used)
+ )
+ last_time = gpsd.fix.time
+ except AttributeError as e:
+ print( 'parse error\n')
sys.stdout.flush()
time.sleep(5) #set to whatever
- except (KeyboardInterrupt, SystemExit): #when you press ctrl+c
- print("\nKilling Thread...")
- except Exception as e: # any error, signal
- print( e )
+ except (KeyboardInterrupt, SystemExit): #when you press ctrl+c
+ print("\nKilling Thread...")
+ except Exception as e: # any error, signal
+ print( e )
- gpsp.running = False
- gpsp.join() # wait for the thread to finish what it's doing
- print("Done.\nExiting.")
+ gpsp.running = False
+ gpsp.join() # wait for the thread to finish what it's doing
+ print("Done.\nExiting.")
=====================================
ntpstats/ntpviz
=====================================
--- a/ntpstats/ntpviz
+++ b/ntpstats/ntpviz
@@ -972,7 +972,6 @@ Python by ESR, concept and GNUPLOT code by Dan Drown.
# register to dump debug on all normal exits
atexit.register( print_profile )
-
nice = 19 # always run nicely
if 0 != nice:
try:
=====================================
pylib/statfiles.py
=====================================
--- a/pylib/statfiles.py
+++ b/pylib/statfiles.py
@@ -90,7 +90,7 @@ class NTPStats:
line = line.strip(' \0\r\n\t')
if line is not None:
if 0 == len(line):
- continue;
+ continue
split = line.split(None, 2)
try:
t = int(float(split[0]))
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/c977b990bd96b504e09fe4b5e12a7600332db8f7...b87ca16a05c5c76786be4f7b95405879273f2ee4
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20161004/1c0b2abb/attachment.html>
More information about the vc
mailing list