summaryrefslogtreecommitdiff
path: root/gegps
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2016-03-22 05:07:37 -0400
committerEric S. Raymond <esr@thyrsus.com>2016-03-22 05:07:37 -0400
commit8c23561f6a02cb8df93f8b26bdc34de13d1fbd1f (patch)
tree6baba9effd2a7553cee0910b304bbef2a7337c95 /gegps
parent3e8b9be3a77635781ebca888d7aa73162a3588cd (diff)
downloadgpsd-8c23561f6a02cb8df93f8b26bdc34de13d1fbd1f.tar.gz
gegps now runs polyglot under Python 2 and 3.
Diffstat (limited to 'gegps')
-rwxr-xr-xgegps5
1 files changed, 3 insertions, 2 deletions
diff --git a/gegps b/gegps
index a4d00911..164a2971 100755
--- a/gegps
+++ b/gegps
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# usage: gegps [-i] [-d kmldir]
@@ -20,6 +20,7 @@
# Modified by Chen Wei <weichen302@aol.com> for use with gpsd
# Cleaned up and adapted for the GPSD project by Eric S. Raymond.
+# This code runs under both Python 2 and Python 3. Preserve this property!
from __future__ import print_function
import sys, os, getopt
@@ -89,7 +90,7 @@ if __name__ == "__main__":
else:
try:
while True:
- report = next(session)
+ report = session.next()
if report['class'] == 'TPV':
f = open(os.path.join(kmldir, 'Realtime_GPS.kml'), 'w')
f.write(kmlize(report))