load modules at startup based on config file, remove that item from TODO
This commit is contained in:
parent
6cc9577570
commit
9191f25052
1
TODO
1
TODO
@ -6,7 +6,6 @@ dr.botzo --- TODO
|
|||||||
* weather module
|
* weather module
|
||||||
* 8ball style module
|
* 8ball style module
|
||||||
* modularizing
|
* modularizing
|
||||||
* select modules to load from config file
|
|
||||||
* karma v2
|
* karma v2
|
||||||
* some sort of cron interface (periodic events)
|
* some sort of cron interface (periodic events)
|
||||||
* named pipe to send commands to the bot outside of IRC
|
* named pipe to send commands to the bot outside of IRC
|
||||||
|
18
dr.botzo.py
18
dr.botzo.py
@ -65,12 +65,18 @@ irclib.DEBUG = config.getboolean('IRC', 'debug')
|
|||||||
irc = DrBotIRC()
|
irc = DrBotIRC()
|
||||||
server = irc.server().connect(botserver, botport, botnick, botircname)
|
server = irc.server().connect(botserver, botport, botnick, botircname)
|
||||||
|
|
||||||
count = Countdown.Countdown(config, server, modlist)
|
# load features
|
||||||
dice = Dice.Dice(config, server, modlist)
|
try:
|
||||||
fact = FactFile.FactFile(config, server, modlist)
|
cfgmodlist = config.get('modules', 'modlist')
|
||||||
admin = IrcAdmin.IrcAdmin(config, server, modlist)
|
|
||||||
gt = GoogleTranslate.GoogleTranslate(config, server, modlist)
|
mods = cfgmodlist.split(',')
|
||||||
seen = Seen.Seen(config, server, modlist)
|
for mod in mods:
|
||||||
|
# try to load each module
|
||||||
|
eval(mod + '.' + mod + '(config, server, modlist)')
|
||||||
|
except NoSectionError as e:
|
||||||
|
print("You seem to be missing a modules config section, which you probably wanted.")
|
||||||
|
except NoOptionError as e:
|
||||||
|
print("You seem to be missing a modlist config option, which you probably wanted.")
|
||||||
|
|
||||||
# loop forever
|
# loop forever
|
||||||
irc.process_forever()
|
irc.process_forever()
|
||||||
|
Loading…
Reference in New Issue
Block a user