summaryrefslogtreecommitdiff
path: root/gegps
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2016-03-22 03:08:21 -0400
committerEric S. Raymond <esr@thyrsus.com>2016-03-22 03:08:21 -0400
commit8200880a4949fd112674551374868f292b8a6524 (patch)
tree5332fe0413615a729c4953d43cba7a7ea7a1a17f /gegps
parent254022f6c77e55280c6da59a01ee5225abdf7bcb (diff)
downloadgpsd-8200880a4949fd112674551374868f292b8a6524.tar.gz
Forward-port Python utilities to run polyglot under either Python 2 or 3.
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.
Diffstat (limited to 'gegps')
-rwxr-xr-xgegps6
1 files changed, 4 insertions, 2 deletions
diff --git a/gegps b/gegps
index 19623dbc..a4d00911 100755
--- a/gegps
+++ b/gegps
@@ -20,6 +20,8 @@
# Modified by Chen Wei <weichen302@aol.com> for use with gpsd
# Cleaned up and adapted for the GPSD project by Eric S. Raymond.
+from __future__ import print_function
+
import sys, os, getopt
import gps
@@ -87,7 +89,7 @@ if __name__ == "__main__":
else:
try:
while True:
- report = session.next()
+ report = next(session)
if report['class'] == 'TPV':
f = open(os.path.join(kmldir, 'Realtime_GPS.kml'), 'w')
f.write(kmlize(report))
@@ -95,6 +97,6 @@ if __name__ == "__main__":
except StopIteration:
pass
except KeyboardInterrupt:
- print 'gegpsd stopped '
+ print('gegpsd stopped ')
# end