summaryrefslogtreecommitdiff
path: root/leapsecond.py
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2017-07-01 14:55:22 -0700
committerGary E. Miller <gem@rellim.com>2017-07-01 14:55:22 -0700
commitc63e830a1723d95555d33df12c013b0b8de52830 (patch)
tree99c3394b2301222694af98bb35df6bb818e6d7e3 /leapsecond.py
parentf20a254843285b60288dca3c88d10cdaf006683f (diff)
downloadgpsd-c63e830a1723d95555d33df12c013b0b8de52830.tar.gz
leapsecond.py: pep8 fixes
Diffstat (limited to 'leapsecond.py')
-rwxr-xr-xleapsecond.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/leapsecond.py b/leapsecond.py
index 062dda01..f0888c61 100755
--- a/leapsecond.py
+++ b/leapsecond.py
@@ -332,7 +332,8 @@ def graph_history(filename):
(b, c, e) = leastsquares(list(zip(list(range(len(raw))), raw)))
e /= (60 * 60 * 24 * 7)
dates = [time.strftime("%Y-%m-%d", time.localtime(t)) for t in raw]
- enddate = time.strftime("%Y-%m-%d", time.localtime(raw[-1]+16416000)) # Adding 190 days to scale
+ # Adding 190 days to scale
+ enddate = time.strftime("%Y-%m-%d", time.localtime(raw[-1] + 16416000))
fmt = ''
fmt += '# Least-squares approximation of Unix time from leapsecond is:\n'
fmt += 'lsq(x) = %s * x + %s\n' % (b, c)
@@ -367,20 +368,20 @@ def unix_to_rfc822(tv):
def printnext(val):
"Compute Unix time correponsing to a scheduled leap second."
if val[:3].lower() not in ("jun", "dec"):
- sys.stderr.write("leapsecond.py: -n argument must begin with "\
- "'Jun' or 'Dec'\n")
+ sys.stderr.write("leapsecond.py: -n argument must begin with "
+ "'Jun' or 'Dec'\n")
raise SystemExit(1)
else:
month = val[:3].lower()
if len(val) != 7:
- sys.stderr.wrrite("leapsecond.py: -n argument must be of "\
- "the form {jun|dec}nnnn.\n")
+ sys.stderr.wrrite("leapsecond.py: -n argument must be of "
+ "the form {jun|dec}nnnn.\n")
raise SystemExit(1)
try:
year = int(val[3:])
except ValueError:
- sys.stderr.write("leapsecond.py: -n argument must end "\
- "with a 4-digit year.\n")
+ sys.stderr.write("leapsecond.py: -n argument must end "
+ "with a 4-digit year.\n")
raise SystemExit(1)
# Date looks valid
tv = leapbound(year, month)