diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2013-11-19 13:26:41 -0500 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2013-11-19 13:26:41 -0500 |
commit | 06f235f46154541b032ed22095b77ff036c9cb17 (patch) | |
tree | 724df52ac673e2ee4ea05b16749c6996adf2c96a /gpsfake | |
parent | 016542ab0d0674106f8b1700974422f2160b37a1 (diff) | |
download | gpsd-06f235f46154541b032ed22095b77ff036c9cb17.tar.gz |
Simplify the build. No logic changes.
Diffstat (limited to 'gpsfake')
-rwxr-xr-x | gpsfake | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -9,7 +9,7 @@ # This file is Copyright (c) 2010 by the GPSD project # BSD terms apply: see the file COPYING in the distribution root for details. -import sys, os, time, getopt, socket, random +import sys, os, time, getopt, socket, random, pty import gps, gps.fake as gpsfake # The "as" pacifies pychecker class Baton: @@ -157,6 +157,12 @@ if __name__ == '__main__': sys.stderr.write("usage: gpsfake [-h] [-l] [-m monitor] [--D debug] [-o options] [-p] [-s speed] [-c cycle] [-b] logfile\n") raise SystemExit,0 + try: + pty.openpty() + except Exception: + print >>sys.stderr, "gpsfake: ptys not available, falling back to UDP." + udp = True + if not arguments: print >>sys.stderr, "gpsfake: requires at least one logfile argument." raise SystemExit, 1 |