| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Given that the data returned bye fake.py may include binary data,
'bytes' is a more appropriate type. Unlike the client API, where it's
easy to provide both return types, it would be less convenient to do
that here, so 'bytes' is preferred as the one choice (and is
consistent with network sockets).
When sending such data to stdout (or stderr), the straightforward
method is to write to sys.stdXXX.buffer rather than sys.stdXXX. That
doesn't exist in Python 2, but a helper function is now provided to
get the appropriate 'bytes' stream for stdXXX.
Since no previous *release* of GPSD is compatible with Python 3,
changing this now doesn't break anything based on released code.
TESTED:
Ran "scons check" on OSX with all supported Python versions.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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:
Using an SConstruct patched to run the build helpers with the target
Python, ran "scons build-all check ", as well as gpsprof and xgps,
with all six supported Python versions (except 2.6 for xgps).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This incorporates the following changes:
1) Adds definitions for polystr(), polybytes(), and make_std_wrapper()
to misc.py (the most logical place for code needed by multiple
modules), using dummy definitions in the Python 2 case. For more
info, see the Practical Python Porting guide.
2) Reworks the logfile->daemon data path in fake.py to use 'bytes'
consistently.
3) Uses polybytes() in fake.py to construct control-socket commands as
'bytes', as expected by the socket I/O.
4) Uses make_std_wrapper() in gpsfake, to ensure that binary data is
correctly written to stdout.
5) Adds 'division' to the future imports in gpsfake for consistency,
though it doesn't actually matter in practice.
Also updates the compatibility comments in all three files, and fixes
a minor typo in misc.py.
TESTED:
Ran "scons build-all check" with Python 2.7, and ran all daemon
regression tests with Python 2.6 and with Python 3.2-3.5 (with
appropriately built extensions; not yet a build option).
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This makes it possible to view the "slow" as well as the normal
WRITE_PAD values with gpsfake -T, without having to look at the source
code. It adds a new GetDelay() function to fake.py, which returns the
proper delay value, taking into account both the possible environment
variable and the "slow" option. This is now used for all hree uses of
WRITE_PAD.
Because the environment override is now part of the function, the
WRITE_PAD constant is no longer modified by the environment value, but
instead reflects the platform default.
TESTED:
Ran the full set of regression tests, with both default and acceptably
shortened WRITE_PAD. Also verified that a zero value causes trouble
(OSX), and that adding -S to the zero value makes it work.
Signed-off-by: Jon Schlueter <jon.schlueter@gmail.com>
|
|
|
|
|
|
|
| |
TESTED:
Ran a quick gpsfake -v with >/dev/null, and observed output.
Signed-off-by: Jon Schlueter <jon.schlueter@gmail.com>
|
|
|
|
|
| |
Part of a the isync patch series from Michael Brown <mbrown@fensystems.co.uk>,
which failed to apply properly and had to be hand-atched a bit.
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
All regression tests pass.
|
|
|
|
| |
in python you don't need parens around values for if elseif statements
|
|
|
|
| |
whitespace around operators and before function delcarations
|
|
|
|
| |
use "is None" instead of ""== None"
|
|
|
|
| |
random was imported but never used
|
|
|
|
| |
It creates a race condition.
|
|
|
|
|
|
| |
A delay in gpsfake is replaced by a watch for acknowledgment.
All regression tests pass.
|
| |
|
|
|
|
| |
All regression tests pass.
|
|
|
|
| |
All regression tests pass.
|
|
|
|
| |
All regression tests pass.
|
|
|
|
|
|
| |
This makes the -f option of gpsfake obsolete, and it has been removed.
All regression tests pass.
|
|
|
|
|
|
| |
Also, zero in on shorter delays in the regression tests.
All regression tests pass.
|
| |
|
| |
|
|
|
|
|
| |
They are different! This code printed one, and the if statement in
gps/fake.py used the other.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
All regression tests pass with pps=tru or pps=false, PPS is live.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
All regression tests pass.
|
|
|
|
|
| |
regress-driver run is sped up by 7% when run over SSH.
Patch by: Beat Bolli <bbolli@ewanet.ch>
|
| |
|
| |
|
| |
|
|
|
|
| |
Patch concept due to Gleb Smirnoff.
|
| |
|
| |
|
|
|
|
| |
All regression tests pass.
|
| |
|
|
|
|
|
|
| |
The good news is that rgression tests all pass with this case and -u off.
The bad news is that they fail with -u on. It looks like the switch
forces some other bug, previously masked, into the open.
|
| |
|
|
|
|
| |
This is a step towards making UDP data sources work.
|
| |
|