diff options
author | Asko Oja | 2009-05-04 14:02:39 +0000 |
---|---|---|
committer | Marko Kreen | 2009-06-01 07:49:44 +0000 |
commit | 9cbd16ab343c28c55012127a1cb643b793547416 (patch) | |
tree | 6a5b351db839396c8d6912d2a0eb90fe1c94d734 /python/pgqadm.py | |
parent | 16e20c4daccb4f0e95249d8fcfe32e89bae41882 (diff) |
python scripts: Move template config to docstring.
* Template config is now in docstring to make to more
easy to keep up-to-date.
* dbscript: --ini option to show template config.
Diffstat (limited to 'python/pgqadm.py')
-rwxr-xr-x | python/pgqadm.py | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/python/pgqadm.py b/python/pgqadm.py index 2687ed8a..672f7abf 100755 --- a/python/pgqadm.py +++ b/python/pgqadm.py @@ -1,6 +1,28 @@ #! /usr/bin/env python """PgQ ticker and maintenance. + + +Config template:: + + [pgqadm] + + # should be globally unique + job_name = pgqadm_somedb + + db = dbname=provider port=6000 host=127.0.0.1 + + # how often to run maintenance [minutes] + maint_delay_min = 5 + + # how often to check for activity [secs] + loop_delay = 0.5 + + logfile = ~/log/%(job_name)s.log + pidfile = ~/pid/%(job_name)s.pid + + use_skylog = 0 + """ import sys @@ -46,12 +68,13 @@ config_allowed_list = { } class PGQAdmin(skytools.DBScript): - """PgQ admin + maint script.""" + __doc__ = __doc__ def __init__(self, args): """Initialize pgqadm.""" skytools.DBScript.__init__(self, 'pgqadm', args) self.set_single_loop(1) + if len(self.args) < 2: print("need command") sys.exit(1) |