summaryrefslogtreecommitdiff
path: root/gps/gps.py
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2010-03-10 19:00:52 +0000
committerEric S. Raymond <esr@thyrsus.com>2010-03-10 19:00:52 +0000
commitbb86d882410693654b42685d908a4de5a3b4eb0c (patch)
tree23e602cbd56450cd93b90198690f937000e2081a /gps/gps.py
parent663f1c5a25b69d230610b42a26de2da0633bac8e (diff)
downloadgpsd-bb86d882410693654b42685d908a4de5a3b4eb0c.tar.gz
Non-streaming operation of the Python exerciser doesn't make sense any more...
...and the query() entry point is gone. Fixes Debian bug #569703.
Diffstat (limited to 'gps/gps.py')
-rwxr-xr-xgps/gps.py30
1 files changed, 8 insertions, 22 deletions
diff --git a/gps/gps.py b/gps/gps.py
index 33a604a3..fe5f7906 100755
--- a/gps/gps.py
+++ b/gps/gps.py
@@ -659,34 +659,20 @@ def isotime(s):
if __name__ == '__main__':
import readline, getopt
- (options, arguments) = getopt.getopt(sys.argv[1:], "vw")
+ (options, arguments) = getopt.getopt(sys.argv[1:], "w")
streaming = False
verbose = False
for (switch, val) in options:
- if switch == '-w':
- streaming = True
- elif switch == '-v':
+ if switch == '-v':
verbose = True
if len(arguments) > 2:
- print 'Usage: gps.py [host [port]]'
+ print 'Usage: gps.py [-v] [host [port]]'
sys.exit(1)
- if streaming:
- session = gps(*arguments)
- session.set_raw_hook(lambda s: sys.stdout.write(s.strip() + "\n"))
- session.stream(WATCH_ENABLE|WATCH_NEWSTYLE)
- for report in session:
- print report
- else:
- print "This is the exerciser for the Python gps interface."
- session = gps(*arguments)
- session.set_raw_hook(lambda s: sys.stdout.write(s.strip() + "\n"))
- try:
- while True:
- session.query(raw_input("> "))
- print session
- except EOFError:
- print "Goodbye!"
- del session
+ session = gps(*arguments)
+ session.set_raw_hook(lambda s: sys.stdout.write(s.strip() + "\n"))
+ session.stream(WATCH_ENABLE|WATCH_NEWSTYLE)
+ for report in session:
+ print report
# gps.py ends here