summaryrefslogtreecommitdiff
path: root/contrib/webgps.py
diff options
context:
space:
mode:
authorBeat Bolli <bbolli@ewanet.ch>2013-10-21 20:35:01 +0200
committerEric S. Raymond <esr@thyrsus.com>2013-10-22 13:38:24 -0400
commit0729dde1ef416a0f93bbab136588fbbab8a6da6d (patch)
tree034b3ec06f772b98f1cbe5d179f31e41aec4e394 /contrib/webgps.py
parent04b5721b011e2a351fd6204be99d5cddacdef4bc (diff)
downloadgpsd-0729dde1ef416a0f93bbab136588fbbab8a6da6d.tar.gz
webgps.py: add documentation
Diffstat (limited to 'contrib/webgps.py')
-rwxr-xr-xcontrib/webgps.py39
1 files changed, 34 insertions, 5 deletions
diff --git a/contrib/webgps.py b/contrib/webgps.py
index 76e3553f..a95fc848 100755
--- a/contrib/webgps.py
+++ b/contrib/webgps.py
@@ -1,11 +1,40 @@
#!/usr/bin/env python
# encoding: utf-8
-# webgps.py
-#
-# This is a Python port of webgps.c from http://www.wireless.org.au/~jhecker/gpsd/
-# by Beat Bolli <me+gps@drbeat.li>
-#
+"""webgps.py
+
+This is a Python port of webgps.c from http://www.wireless.org.au/~jhecker/gpsd/
+by Beat Bolli <me+gps@drbeat.li>
+
+It creates a skyview of the currently visible GPS satellites and their tracks
+over a time period.
+
+Usage:
+ ./webgps.py [duration]
+
+ duration may be
+ - a number of seconds
+ - a number followed by a time unit ('s' for secinds, 'm' for minutes,
+ 'h' for hours or 'd' for days, e.g. '4h' for a duration of four hours)
+ - the letter 'c' for continuous operation
+
+If duration is missing, the current skyview is generated and webgps.py exits
+immediately. This is the same as giving a duration of 0.
+
+If a duration is given, webgps.py runs for this duration and generates the
+tracks of the GPS satellites in view. If the duration is the letter 'c',
+the script never exits and continuously updates the skyview.
+
+webgps.py generates two files: a HTML5 file that can be browsed, and a
+JavaScript file that contains the drawing commands for the skyview. The HTML5
+file auto-refreshes every five minutes. The generated file names are
+"gpsd-<duration>.html" and "gpsd-<duration>.js".
+
+If webgps.py is interrupted with Ctrl-C before the duration is over, it saves
+the current tracks into the file "tracks.p". This is a Python "pickle" file.
+If this file is present on start of webgps.py, it is loaded. This allows to
+restart webgps.py without losing accumulated satellite tracks.
+"""
import time, calendar, math, socket, sys, os, select, pickle
try: