File: update.py

package info (click to toggle)
pglistener 4
  • links: PTS
  • area: main
  • in suites: buster, sid, stretch
  • size: 224 kB
  • ctags: 132
  • sloc: python: 594; perl: 364; sh: 120; sql: 89; makefile: 2
file content (23 lines) | stat: -rwxr-xr-x 429 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env python

import sys

from pglistener import config

def main(argv):
    configfile = argv[1]
    sections = argv[2:]

    listeners = dict([(l.name, l) for l in
        config.read_configs(configfile)])

    if not sections:
        sections = listeners.keys()

    for section in sections:
        listeners[section].connect()
        listeners[section].do_update()

if __name__ == '__main__':
    main(sys.argv)