diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2010-03-10 19:00:52 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2010-03-10 19:00:52 +0000 |
commit | bb86d882410693654b42685d908a4de5a3b4eb0c (patch) | |
tree | 23e602cbd56450cd93b90198690f937000e2081a /gps/gps.py | |
parent | 663f1c5a25b69d230610b42a26de2da0633bac8e (diff) | |
download | gpsd-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-x | gps/gps.py | 30 |
1 files changed, 8 insertions, 22 deletions
@@ -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 |