summaryrefslogtreecommitdiff
path: root/leapsecond.py
Commit message (Collapse)AuthorAgeFilesLines
* Typo: ISO8661 -> ISO8601Sanjeev Gupta2018-11-081-1/+1
| | | | | Signed-off-by: Sanjeev Gupta <ghane0@gmail.com> Signed-off-by: Gary E. Miller <gem@rellim.com>
* leapsecondpy: pylint remove redundant elses.Gary E. Miller2018-10-081-21/+22
|
* leapsecond.py: pep8 cleanup.Gary E. Miller2018-07-261-0/+2
| | | | Note the program pep8 is now called pycodestyle
* leapsecond.py: Fix for PEP8.Gary E. Miller2018-06-201-10/+18
|
* SPDXify the licerse references.Eric S. Raymond2018-03-081-1/+1
|
* leapsecond.py: fix pylint nitGary E. Miller2017-07-261-4/+4
| | | | | pylint does not like changing the type of a variable. In this case tupples to ints. So add an intermediate variable.
* leapsecond.py: pep8 fixesGary E. Miller2017-07-011-13/+28
|
* leapsecond.py: pep8 fixesGary E. Miller2017-07-011-7/+8
|
* Fix an off-by-one bug in counting leapseconds.Eric S. Raymond2017-01-011-1/+1
|
* Makes "future imports" and Python version comments consistent.Fred Wright2016-04-101-2/+3
| | | | | | | | | | | | | | | | | | | | This makes the "future import" statements consistently specify absolute_import, print_function, and division, for maximum consistency between Python 2 and Python 3. Although absolute_import is probably a don't care for top-level programs, if unit tests were ever implemented for the programs they would be imported as modules, making the module import behavior relevant. Note that previous Python 3 fixes are a prerequisite for this change. Also makes the "polyglot comment" consistent across sources. TESTED: Using a version of SConstruct patched to use the target Python for build helpers, ran "scons build-all check valgrind-audit www/hardware.html" with all six supported Python versions. Also ran gegps, gpscat, gpsprof, xgps, and xgpsspeed with both Python 2 and Python 3.
* Fixes leapseconds.py for Python 3.Fred Wright2016-04-101-27/+61
| | | | | | | | | | | | | | | | | | | | | | This fixes two Python 3 issues with leapsecond.py: 1) The urllib module is subdivided in Python 3. Only the 'request' submodule is needed here. Either that or the Python 2 urllib is now imported as 'urlrequest'. 2) The data returned by urlopen() is 'bytes' in Python 3, requiring the polystr transformation to be usable as a string. Also, the (duplicate) isotime() definition here has been updated to match the version in gps/misc.py. It is still duplicated to avoid a dependency on the latter, as is the needed portion of the polystr code. TESTED: Ran "scons build-all check". Also ran "leapsecond.py -f" with all six supported Python versions, and verified that the result matches the existing leapseconds.cache. Did *not* test the updated retrieve() function, but it's not used anywhere.
* Fixes integer division for Python 3.Fred Wright2016-04-101-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | This changes a few integer division cases to use the '//' floored-division operator, matching the normal Python 2 (C-like) '/' behavior, for compatibility with the switch to the "mathematical" divison operator in Python 3 (and in Python 2 with the "future division" import). This was more about keeping the behavior the same than determining whether floored division is actually the proper choice. One place where floored division is definitely wanted is in the GPS week calculations in leapsecond.py, which are now OK for Python 3, though currently that module is only used by SConstruct, and hence not with Python 3. Two other minor fixes: 1) The GPS base date is corrected in the comment in leapsecond.py. 2) The fit_to_grid() function in xgps now consistently returns floats, rather than returning either ints or floats depending on the line width. TESTED: Ran "scons build-all check" with all 6 supported Python versions. Also ran xgps and xgpsspeed with all but 2.6.
* Restore language about 2.6 portability, clean up Python imports.Eric S. Raymond2016-03-271-5/+5
|
* pylint cleanup.Eric S. Raymond2016-03-221-1/+1
|
* Forward-port gps/ Python client code to run polyglot under Python 2 or 3.Eric S. Raymond2016-03-221-1/+2
| | | | | | | Verified by testing gpsprof under both versions. leapecond.py is also OK. Not yet polyglot: gegps, gpscap.py, gpscat, gpsfake, jsongen.py, maskaudit.py, test_maidenhead.py, valgrind_audit.py, xgps, xgpsspeed.
* Forward-port Python utilities to run polyglot under either Python 2 or 3.Eric S. Raymond2016-03-221-34/+35
| | | | | | For the moment most shebang lines still say 'python2' rather than just 'python'. This is because the client code in gps/ hasn't been touched yet; the internal imports break under Python 3 and that needs to be fixed.
* Change Python hashbang lines to invoke 'python2'Eric S. Raymond2015-07-191-1/+1
| | | | | | We've learned that Ubuntu 15.10 will have python3 as default. The ugly transition gas befun; our only recourse is to hape that all our deployment targets have 'pyton2' do the right thing. Works on 14.10.
* leapsecond.py no longer handles -c optionSanjeev Gupta2015-05-081-2/+0
| | | | Signed-off-by: Gary E. Miller <gem@rellim.com>
* Extend xrange, so that first and last points can be seen.Sanjeev Gupta2015-05-071-1/+2
| | | | | | Else they lie on the border. Signed-off-by: Gary E. Miller <gem@rellim.com>
* Extend yrange, so that first and last points can be seen.Sanjeev Gupta2015-05-071-1/+1
| | | | | | Else they lie on the border. Signed-off-by: Gary E. Miller <gem@rellim.com>
* Leap seconds plotted as points.Sanjeev Gupta2015-05-071-2/+2
| | | | | | | There is no uniformity, hence a line linking points is misleading. Also clarify Title, this is not TAI-UTC, but GPS-UTC. Signed-off-by: Gary E. Miller <gem@rellim.com>
* Change axis, time monotonic on X , leapsecond count on YSanjeev Gupta2015-05-071-8/+9
| | | | Signed-off-by: Gary E. Miller <gem@rellim.com>
* pep8 cleanup of leapsecond.py for whitespaceJon Schlueter2015-02-231-41/+59
| | | | | | | 2 lines between functions 2 spaces before inline comments cleanup indentation in a couple of places whitespace around operators and = and after commas
* pylint cleanup. All regression tests pass.Eric S. Raymond2015-01-251-3/+3
|
* Clean up some timebase assumptions (code not yet used).Eric S. Raymond2014-08-261-6/+6
|
* Correct computatiojn of build timestamps.Eric S. Raymond2014-08-251-3/+9
|
* pylint validation pass. All regresio tests pass, xgps runs live.Eric S. Raymond2014-08-231-12/+11
|
* pylint cleanup.Eric S. Raymond2013-12-021-10/+12
|
* Write a lengthy sidebar on why leap seconds existSanjeev Gupta2013-11-281-0/+2
| | | | | | | | I am not sure where this should be, but I do not think this documentation is of direct use to users. Hence I am adding it to timebase.c , for developers. Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
* Only fetch leapseconds when cache is older than last potential issue date.Eric S. Raymond2013-11-271-19/+29
|
* Remove unused code.Eric S. Raymond2013-11-271-51/+3
|
* Refactor leap-second cache fetching. No logic changes yet.Eric S. Raymond2013-11-271-1/+22
|
* Cosmetic fix to leapsecond cache generation.Eric S. Raymond2013-11-271-1/+1
|
* Make current GPS week available in timebase.h for rollover detection.Eric S. Raymond2013-11-271-3/+21
|
* Gnuplot sample command linesSanjeev Gupta2013-11-251-2/+4
| | | | | 1. Minor typo in example 2. Added second example for thos with an X11-aware gnuplot
* Apparently gnuplot X11 mode is dead.Eric S. Raymond2013-11-251-1/+3
|
* Fix gnuplot syntaxSanjeev Gupta2013-11-251-2/+1
| | | | | | I will go through all files that call gnuplot and check syntax Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
* More pylint cleanup in some build helpers. Build succeeds.Eric S. Raymond2013-11-151-1/+0
|
* Partial pylint cleanup. All regression tests pass, xgps works.Eric S. Raymond2013-11-151-6/+4
|
* Address Savannah bug #40461: leapsecond.py and http proxiesEric S. Raymond2013-11-131-1/+1
| | | | | Fail more gracefully in this case, and add a leapfetch=no option to work around it.
* leapsecond.py: make save_leapseconds() check all defined servers.Beat Bolli2013-10-311-14/+20
| | | | | | | | Because of connection problems, add the IERS to the list of places that are checked for the UTC-TAI history. Adjust the parsing for the differences in the format of the IERS file. Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
* leapsecond.py: set a socket timeout for slow servers.Beat Bolli2013-10-311-0/+5
| | | | | | | I have problems connecting to maia.usno.navy.mil, and setting a socket timeout at least doesn't block the build process. Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
* Better usage help and minor improvements for leapsecond.pyClaus Klein2013-02-251-53/+127
|
* Restore Python 2.5 compatibility.Thomas Petazzoni2012-10-231-3/+24
| | | | Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
* Deal properly with scheduled IERS transitions in the future...Eric S. Raymond2012-01-111-3/+6
| | | | ...as well as past ones. All regression tests pass.
* More Python sanity checking.Eric S. Raymond2011-10-281-1/+1
|
* Python glitches caught by pylint.Eric S. Raymond2011-10-281-1/+1
| | | | One could have been a fatal error.
* Add pychecker production for anity-checking Python code.Eric S. Raymond2011-08-231-8/+1
|
* Documentation and website update.Eric S. Raymond2011-08-201-1/+8
|
* Don't clobber existing leapseconds cache if USNO is not accessible.Eric S. Raymond2011-08-171-4/+5
|