forked from hackyourlife/orakel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadmin.py
executable file
·36 lines (32 loc) · 998 Bytes
/
admin.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
#!/bin/python
# -*- coding: utf-8 -*-
# vim:set ts=8 sts=8 sw=8 tw=80 noet cc=80:
import configparser
import logging
from module import Module
from admincmd import AdminCMD
from autocmd import AutoCMD
from mute import Mute
from terminator import Terminator
class Admin(Module):
def __init__(self, trollmsg):
super(Admin, self).__init__(name="admin")
self.admincmd = AdminCMD(parent=self)
self.autocmd = AutoCMD(trollmsg, parent=self)
self.mute = Mute(parent=self)
self.terminator = Terminator(parent=self)
self.log.info("load complete")
if __name__ == "__main__":
logging.basicConfig(level=logging.INFO,
format='%(levelname)-8s %(message)s')
filename = "orakel.cfg"
config = configparser.SafeConfigParser()
config.read(filename)
troll = config.get("modules", "troll")
troll = [x.strip() for x in troll.split(';') if x.strip() != '']
admin = Admin(troll)
try:
admin.start()
except KeyboardInterrupt:
admin.log.info("unloading")
admin.stop()