summaryrefslogtreecommitdiff
path: root/gpsfake
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2006-07-23 21:27:19 +0000
committerEric S. Raymond <esr@thyrsus.com>2006-07-23 21:27:19 +0000
commit0b6ad90a01e9cc8fbd258952e30f1778b6c97588 (patch)
tree1dbf84b879341245c5a9730f7fb25bb27b71e169 /gpsfake
parent56dfc2460710cef912a5fdf6eb2a5e95ca452a34 (diff)
downloadgpsd-0b6ad90a01e9cc8fbd258952e30f1778b6c97588.tar.gz
Pipe (-p) option split into -1 and -p options. New test added.
Diffstat (limited to 'gpsfake')
-rwxr-xr-xgpsfake13
1 files changed, 8 insertions, 5 deletions
diff --git a/gpsfake b/gpsfake
index 4f223164..389df231 100755
--- a/gpsfake
+++ b/gpsfake
@@ -40,7 +40,7 @@ class Baton:
return
try:
- (options, arguments) = getopt.getopt(sys.argv[1:], "bc:D:ghilm:o:pr:s:v")
+ (options, arguments) = getopt.getopt(sys.argv[1:], "1bc:D:ghilm:o:pr:s:v")
except getopt.GetoptError, msg:
print "gpsfake: " + str(msg)
raise SystemExit, 1
@@ -51,12 +51,15 @@ monitor = ""
speed = 4800
linedump = False
pipe = False
+singleshot = False
promptme = False
init = "w+r+"
doptions = ""
verbose = False
for (switch, val) in options:
- if (switch == '-b'):
+ if (switch == '-1'):
+ singleshot = True
+ elif (switch == '-b'):
progress = True
elif (switch == '-c'):
cycle = float(val)
@@ -89,10 +92,10 @@ logfile = arguments[0]
def fakehook(linenumber, fakegps):
if linenumber % len(fakegps.testload.sentences) == 0:
- if pipe and linenumber > 0:
+ if singleshot and linenumber > 0:
return False
- if pipe:
- baton.twirl('*')
+ if progress:
+ baton.twirl('*\010')
else:
sys.stderr.write("gpsfake: log cycle begins.\n")
time.sleep(cycle)