-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.py
executable file
·65 lines (42 loc) · 1.46 KB
/
server.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# -*- coding: utf-8 -*-
"""
__old_import__ = __import__
def new_import(name, globals={}, locals={}, fromlist=[], level= -1):
print name
return __old_import(name, globals, locals, fromlist, level)
__import__ = new_import
print __import__
"""
#from twisted.internet import gtk2reactor # for gtk-2.0
#gtk2reactor.install()
from scrutator.core.network import *
from scrutator.core.factory import *
from remote.protocols.identify.brain import *
from scrutator.core.config import ServerConfig
from scrutator.minidi.injector import Context
from scrutator.protocols.example.sandbox import SandboxBrainServer
from remote.protocols.irc.server import IrcBrainServer
"""class Reply(SimpleListener):
def action(self, eventObj, evtMgr):
#event = KickEvent(plop=eventObj)
evtMgr.push(eventObj)
reactor.callLater(10,evtMgr.push, eventObj)"""
if __name__ == '__main__':
from twisted.python import log
identifier = "server"
log.startLogging(open('log/'+identifier+".log", 'w'))
#CoreManager().addConfig(XMLConfig("resource/impl/server.xml"))
context = Context()
context.addConfig(ServerConfig())
#ask retrieve due to lazy init
#context.getBean('mainEventManager')
context.getBean('eventReceiver')
#eventSender = context.getBean('eventSender')
#init the brain
ic = GlobalBrainServer()
context.setBean('RegistryBrain',ic)
#sb = SandboxBrainServer()
#context.setBean('SandboxBrain',sb)
ib = IrcBrainServer()
context.setBean('IrcBrainServer',ib)
reactor.run()