summaryrefslogtreecommitdiff
path: root/update.py
blob: 5f4a84583554706e93145297c30cb29b60af39ff (plain)
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)