Browse Source

Reorganise.

master
flabbergast 7 years ago
parent
commit
57047f04bf
  1. 0
      scripts/gps-watcher.py
  2. 0
      scripts/index.template.html
  3. 26
      watch-gpsd-daemon.py

0
watch-gpsd-daemon-threaded.py → scripts/gps-watcher.py

0
index.template.html → scripts/index.template.html

26
watch-gpsd-daemon.py

@ -1,26 +0,0 @@
import gps
from datetime import datetime
# Listen on port 2947 (gpsd) of localhost
session = gps.gps("localhost", "2947")
session.stream(gps.WATCH_ENABLE | gps.WATCH_NEWSTYLE)
# main (infinite) loop
while True:
try:
report = session.next()
# Wait for a 'TPV' report and display the current time
# To see all report data, uncomment the line below
# print report
print report
if report['class'] == 'TPV':
if hasattr(report, 'time'):
print report.time
print datetime.now()
except KeyError:
pass
except KeyboardInterrupt:
quit()
except StopIteration:
session = None
print "GPSD has terminated"
Loading…
Cancel
Save