summaryrefslogtreecommitdiff
path: root/gps/client.py
Commit message (Collapse)AuthorAgeFilesLines
* gps/client.py: pylint cleanupsGary E. Miller2018-09-221-6/+26
| | | | Found a bug. Variable steam s/b stream.
* Python modules: add module docstrings.Gary E. Miller2018-09-221-0/+1
|
* gps/client.py: fix for Python 3.Gary E. Miller2018-09-211-1/+3
|
* SConstruct: pep8 cleanup, no functional change.Gary E. Miller2018-09-211-1/+1
|
* gps/client: Fix Python 3 problem in send().Gary E. Miller2018-09-151-2/+3
|
* gps/client.py: remove ConnectionRefusedError which is Python 3 only.Gary E. Miller2018-09-141-8/+2
| | | | We have to support Python 2 for a bit longer.
* gps/client: Commen that ConnectionRefusedError is not in Python 2.Gary E. Miller2018-09-141-0/+2
| | | | So gps/client crashes on a failed connection.
* client.py: remove debug code that slipped out.Gary E. Miller2018-08-071-3/+3
|
* gps/client.py: Add back in missing defaults.Gary E. Miller2018-06-261-0/+3
| | | | The reconnect patch lost host and port.
* gps/client.py: Fix for PEP8Gary E. Miller2018-06-201-1/+2
|
* [PATCH] [fix] gps/*py now passes `scons check`Daniel_M_Williams2018-05-211-6/+18
| | | | | | Whoops, the auto reconnect patch broke scons check. Signed-off-by: Gary E. Miller <gem@rellim.com>
* re-implement reconnect code in python-client-libraryDaniel_M_Williams2018-05-181-29/+85
| | | | Signed-off-by: Gary E. Miller <gem@rellim.com>
* client.py: pep8 fixesGary E. Miller2017-07-011-3/+10
|
* Adds bytes-typed alternative response to Python client.Fred Wright2016-12-241-5/+12
| | | | | | | | | | | | | | | | | | | | | In Python 2, 'bytes' and 'str' are synonyms, but in Python 3 they are not. Since the client may return binary data in some cases, 'bytes' is a more appropriate data type. Rather than requiring double conversions in this case (the socket returns 'bytes'), this adds an alternative response item which is typed as 'bytes'. Although the accessor method 'data()' has always existed, it's shadowed by a name collision in some cases, resulting in the requirement that the caller access the 'response' item directly (as noted in the documentation). Thus, it's not possible to avoid the conversion to 'str' in the cases where it isn't actually used. This change doesn't bother to add an accessor method for 'bresponse', for consistency with the way the API is normally used, though that should be fixed if this aspect of the API is ever cleaned up. TESTED: Ran "scons check" on OSX with all supported versions of Python.
* Restores json_error definition accidentally removed by 94cb114.Fred Wright2016-04-141-0/+7
| | | | | | TESTED: Ran "scons check". Note that this doesn't test the actual change, since the exception in question is only used in certain error cases.
* Fixes gps/*.py to use new-style classes.Fred Wright2016-04-111-3/+3
| | | | | | | | | | | | | | | | | | | | | | | Although this isn't strictly a Python 3 requirement, using the new-style class definition syntax improves consistency between Python 2 and Python 3. Old-style classes have been deprecated since Python 2.2, but many such definitions linger on. Python 3 eliminates old-style classes, but instead of complaining about old-style definitions, it simply unconditionally and silently makes all classes new-style. The only incompatible differences are quite subtle and rarely matter in practice, but things are more consistent across versions if the new-style definitions are used. Also, the preferred method for subclasses to invoke parent init methods is via the super() construct, which is only available with new-style classes. Using super() is especially useful with multiple inheritance, which it handles automatically (provided that the init methods have compatible signatures). TESTED: Ran "scons build-all check valgrind-audit", as well as gegps, gpscat, gpsprof, xgps, and xgpsspeed, with all six supported Python versions (except 2.6 for xgps*).
* Makes "future imports" and Python version comments consistent.Fred Wright2016-04-101-1/+1
| | | | | | | | | | | | | | | | | | | | 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.
* Removes redundant polystr/polybytes defs from client.py.Fred Wright2016-04-091-23/+2
| | | | | TESTED: Ran "scons check" with both Python 2 and Python 3.
* Fixes a client.py exception for Python 3.Fred Wright2016-04-091-1/+2
| | | | | | | | | | | | In Python 3, exception objects are local to the try/except block, making them inaccessible outside that block. It was probably actually an error to set the "message" to be the exception object rather than its string representation, anyway. TESTED: Ran xgps without gpsd running, and verified that the proper error box is displayed, in both Python 2 and Python 3 (with appropriate builds of the extensions).
* Forces Python 3 import behavior in all gps/* modules.Fred Wright2016-04-091-1/+1
| | | | | | | | | | | | This ensures that any future changes that accidentally rely on the Python 2 implicit relative import behavior will fail in Python 2 as well as Python 3. TESTED: Ran "scons build-all check" (with Python 2.7). Also verified that the regression tests and test_maidenhead.py run with Python 2.6, and that gpsfake -T and test_maidenhead.py run with Python 3 when the extensions are built for Python 3 (not yet a build option).
* RTCM3 JSON can be over 4.4k long, So go big in regres driver.Gary E. Miller2016-04-071-1/+2
| | | | Thanks to Fred Wright for locating the trouble spot.
* Fixes client.py bug ausing RTCM3.2 regression-test failures.Fred Wright2016-04-071-0/+1
| | | | | | | | | | | | | | | | | When an entire 4K buffer of packet data contains no newlines, it's simply retained for future use. But the code was failing to clear the previous response in that case, causing the caller to see duplicate data. Since this bug only mattered with lines longer than 4K bytes, and since even then it varied as a function of the alignment of lines vs. 4K boundaries, it was never seen on previous regression tests. TESTED: Ran "scons build-all check" with the updated code and the corrected test data for RTCM3.2. Signed-off-by: Gary E. Miller <gem@rellim.com>
* Fix a slightly botched Python 3 move.Eric S. Raymond2016-04-061-2/+2
|
* Restore language about 2.6 portability, clean up Python imports.Eric S. Raymond2016-03-271-5/+4
|
* Second fix for Python 3 sat display.Eric S. Raymond2016-03-271-1/+1
|
* gpsfake now runs polyglot under Python 2 or 3.Eric S. Raymond2016-03-221-2/+17
|
* Forward-port gps/ Python client code to run polyglot under Python 2 or 3.Eric S. Raymond2016-03-221-9/+9
| | | | | | | 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.
* [pep8] autopep8 whitespace cleanupJon Schlueter2016-02-091-0/+3
| | | | | large scale autopep8 cleanup of several pep8 whitespace warnings
* pep8 whitespace and is not None cleanup in gps/client.pyJon Schlueter2015-03-131-20/+31
|
* pylint validation pass. All regresio tests pass, xgps runs live.Eric S. Raymond2014-08-231-1/+1
|
* pylint found a minor error in the factoring of the Python library classes.Eric S. Raymond2013-11-241-5/+2
| | | | All regression tests pass. PPS is live.
* Ritualistic pacification of pylint. All regression tests pass, xgps runs.Eric S. Raymond2013-11-151-0/+3
|
* Insert required calls to Python Eceptions base class.Eric S. Raymond2013-11-151-2/+3
| | | | All regression tests pass.
* Partial pylint cleanup. All regression tests pass, xgps works.Eric S. Raymond2013-11-151-2/+2
|
* ppsbar -> pps.Eric S. Raymond2013-11-131-5/+5
| | | | All regression tests pass. PPS is live in both gpsd and gpsmon.
* Typo fix.Eric S. Raymond2013-11-121-1/+1
|
* Fix buggy enable-flag-to-JSON mapping in the Python interface.Eric S. Raymond2013-11-121-3/+3
|
* SPLIT24 and PPSBAR flags belong in the Python interface, too.Eric S. Raymond2013-11-121-0/+10
|
* More Python sanity checking.Eric S. Raymond2011-10-281-1/+1
|
* Fixed copy'n'paste bug in the Python binding.Michael Tatarinov2011-10-121-2/+2
| | | | Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
* Add -r option to gpsplot.Eric S. Raymond2011-10-101-1/+2
|
* gps library code is pychecker clean. All regression tests pass.Eric S. Raymond2011-08-231-2/+2
|
* Remove a fossil from the Python binding.Eric S. Raymond2011-03-241-1/+0
|
* Document the unpack() method in C and Python APIs.Eric S. Raymond2011-03-241-1/+1
| | | | | | | | We're not bumping the minor API number because the C library has had this all along. Alas, it can't be made to fit the RAII model of the C++ binding. All regression tests pass.
* Sync the Python and C++ bindings to the C one. Document it properly.Eric S. Raymond2011-03-181-0/+4
|
* waiting method in the Python binding gets a timeout argument.Eric S. Raymond2011-03-091-2/+2
|
* Abandon the attempt to de-Unicodify JSON as it comes in.Eric S. Raymond2011-02-281-18/+3
| | | | | | | | | | This turned out to cause mike_t's bug with doubling of backslashes - praobably doue to a subtle bug in the Python encode feature. And it seems not to be necessary, as Python doesn't notice the difference between plain and Unicode strings unless they contain Unicode. Has the nice effect of simplifying the Python client code. The only place decoding to ASCII is now done is where a C extension needs it.
* Somewhat more effective asciifying in the Python client.Eric S. Raymond2011-02-221-14/+14
|
* Assume any 'satellites' attribute in JSON is a JSON array.Eric S. Raymond2011-02-221-1/+2
|
* Typo fixes.Eric S. Raymond2011-02-211-1/+1
|