~ubuntu-branches/debian/stretch/gpsd/stretch

« back to all changes in this revision

Viewing changes to gpsfake

  • Committer: Bazaar Package Importer
  • Author(s): Bernd Zeimetz
  • Date: 2010-07-15 14:46:02 UTC
  • mto: (1.1.11)
  • mto: This revision was merged to the branch mainline in revision 25.
  • Revision ID: james.westby@ubuntu.com-20100715144602-v68en708flyrtgcm
Tags: upstream-2.95
ImportĀ upstreamĀ versionĀ 2.95

Show diffs side-by-side

added added

removed removed

Lines of Context:
71
71
        if progress:
72
72
            baton.twirl('*\010')
73
73
        elif not singleshot:
74
 
            sys.stderr.write("gpsfake: log cycle of %s begins.\n" % fakegps.name)
 
74
            sys.stderr.write("gpsfake: log cycle of %s begins.\n" % fakegps.testload.name)
75
75
    time.sleep(cycle)
76
76
    if linedump and fakegps.testload.legend:
77
77
        ml = fakegps.testload.sentences[linenumber % len(fakegps.testload.sentences)].strip()
88
88
 
89
89
if __name__ == '__main__':
90
90
    try:
91
 
        (options, arguments) = getopt.getopt(sys.argv[1:], "1bc:D:fghilm:no:pr:s:vx")
 
91
        (options, arguments) = getopt.getopt(sys.argv[1:], "1bc:D:fghilm:no:pr:s:uvx")
92
92
    except getopt.GetoptError, msg:
93
93
        print "gpsfake: " + str(msg)
94
94
        raise SystemExit, 1
106
106
    predump = False
107
107
    pipe = False
108
108
    singleshot = False
109
 
    flicker = False
110
109
    promptme = False
111
110
    client_init = '?WATCH={"json":true,"nmea":true}'
112
111
    doptions = ""
 
112
    udp = False
113
113
    verbose = 0
114
114
    for (switch, val) in options:
115
115
        if (switch == '-1'):
138
138
        elif (switch == '-p'):
139
139
            pipe = True
140
140
        elif (switch == '-r'):
141
 
            if flicker:
142
 
                client_init += val
143
 
            else:
144
 
                client_init = val
 
141
            client_init = val
145
142
        elif (switch == '-s'):
146
143
            speed = int(val)
 
144
        elif (switch == '-u'):
 
145
            udp = True
147
146
        elif (switch == '-v'):
148
147
            verbose += 1
149
148
        elif (switch == '-h'):
155
154
    else:
156
155
        print >>sys.stderr, "Processing %s" % ",".join(arguments)
157
156
 
158
 
    test = gps.fake.TestSession(prefix=monitor, port=port, options=doptions, verbose=verbose, predump=predump)
 
157
    test = gps.fake.TestSession(prefix=monitor, port=port, options=doptions, udp=udp, verbose=verbose, predump=predump)
159
158
 
160
159
    if pipe:
161
160
        test.reporter = sys.stdout.write
190
189
                # Without a delay here there's a window for test
191
190
                # sentences to arrive before the watch takes effect.
192
191
                # This needs to increase if leading sentences in
193
 
                # test loads aren't being process.
 
192
                # test loads aren't being processed.
194
193
                time.sleep(1)
195
194
            test.run()
196
195
        except socket.error, msg: