mirror of
https://github.com/lilydjwg/archrepo2.git
synced 2025-03-10 12:02:43 +00:00
32 lines
714 B
Python
Executable file
32 lines
714 B
Python
Executable file
#!/usr/bin/env python3
|
|
# vim:fileencoding=utf-8
|
|
|
|
import sys
|
|
import configparser
|
|
import logging
|
|
|
|
from tornado.ioloop import IOLoop
|
|
|
|
from myutils import enable_pretty_logging
|
|
enable_pretty_logging(logging.DEBUG)
|
|
|
|
from repomon import repomon
|
|
|
|
def main(conffile):
|
|
config = configparser.ConfigParser(default_section='multi')
|
|
config.read(conffile)
|
|
|
|
repos = config['multi'].get('repos', 'repository')
|
|
repos = [repo.strip() for repo in repos.split(',')]
|
|
notifiers = [repomon(config[repo]) for repo in repos]
|
|
|
|
ioloop = IOLoop.instance()
|
|
try:
|
|
ioloop.start()
|
|
except KeyboardInterrupt:
|
|
ioloop.close()
|
|
for notifier in notifiers:
|
|
notifier.stop()
|
|
|
|
if __name__ == '__main__':
|
|
main(sys.argv[1])
|