From 8200880a4949fd112674551374868f292b8a6524 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Tue, 22 Mar 2016 03:08:21 -0400 Subject: 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. --- gegps | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'gegps') diff --git a/gegps b/gegps index 19623dbc..a4d00911 100755 --- a/gegps +++ b/gegps @@ -20,6 +20,8 @@ # Modified by Chen Wei 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 -- cgit v1.2.1