From bb86d882410693654b42685d908a4de5a3b4eb0c Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Wed, 10 Mar 2010 19:00:52 +0000 Subject: Non-streaming operation of the Python exerciser doesn't make sense any more... ...and the query() entry point is gone. Fixes Debian bug #569703. --- gps/gps.py | 30 ++++++++---------------------- 1 file changed, 8 insertions(+), 22 deletions(-) (limited to 'gps/gps.py') 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 -- cgit v1.2.1