Commits

Benoit C committed 44247c8

adds main

  • Participants
  • Parent commits e298ac7

Comments (0)

Files changed (1)

+#!/usr/bin/env python
+import sys
+
+from twisted.internet import reactor
+from autiste.core import LogBotFactory
+
+import yaml
+
+
+if __name__ == '__main__':
+    # initialize logging
+    #log.startLogging(sys.stdout)
+
+    # configuration
+    if len(sys.argv) != 2:
+        print "Usage : %s <blah.yml>" % sys.argv[0]
+        sys.exit()
+    content = file(sys.argv[1]).read()
+    conf = yaml.load(content)
+    for server in conf['servers']:
+        server_conf = conf['servers'][server]
+
+        f = LogBotFactory(server_conf.get('nick'), server_conf.get('channels'), conf)
+        reactor.connectTCP(server_conf["host"], int(server_conf["port"]), f)
+        reactor.run()