cobalt.py

changeset 92
da291d9426ea
parent 73
d67cc4fbc3f1
child 94
2c93636202a5
equal deleted inserted replaced
91:60ead38a61af 92:da291d9426ea
35 import configfile as ConfigFile 35 import configfile as ConfigFile
36 from configfile import Config 36 from configfile import Config
37 import hgpoll as HgPoll 37 import hgpoll as HgPoll
38 import bt as Bt 38 import bt as Bt
39 import irc as Irc 39 import irc as Irc
40 import rest as Rest
40 41
41 if __name__ != '__main__': 42 if __name__ != '__main__':
42 raise ImportError ('cobalt may not be imported as a module') 43 raise ImportError ('cobalt may not be imported as a module')
43 44
44 g_BotActive = False 45 g_BotActive = False
101 Irc.irc_client (conndata, 0) 102 Irc.irc_client (conndata, 0)
102 break 103 break
103 else: 104 else:
104 raise ValueError ("unknown autoconnect entry %s" % (aconn)) 105 raise ValueError ("unknown autoconnect entry %s" % (aconn))
105 106
107 # Start the REST server
108 Rest.RESTServer()
109
106 g_BotActive = True 110 g_BotActive = True
107 asyncore.loop() 111 asyncore.loop()
108 except KeyboardInterrupt: 112 except KeyboardInterrupt:
109 for client in Irc.all_clients: 113 for client in Irc.all_clients:
110 client.keyboardinterrupt() 114 client.keyboardinterrupt()

mercurial