refactored pluginsystem

This commit is contained in:
braph
2016-04-05 14:18:22 +02:00
committed by Thorsten S
parent d59645bacf
commit 5c1aa9b516
18 changed files with 1710 additions and 1712 deletions

View File

@@ -3,8 +3,9 @@
import logging
import time
import sys
from common import VERSION, EVENTLOOP_DELAY
import config
import events
from common import VERSION
from sleekxmpp import ClientXMPP
@@ -101,13 +102,6 @@ def start(botclass, active=False):
rooms=config.conf_get('rooms'),
nick=config.conf_get('bot_nickname')
)
import plugins
if active:
plugins.register_all()
# if plugins.plugin_enabled_get(plugins.command_dsa_watcher):
# first result is lost.
# plugins.command_dsa_watcher(['dsa-watcher', 'crawl'])
bot.connect()
bot.register_plugin('xep_0045')
@@ -115,13 +109,10 @@ def start(botclass, active=False):
config.runtimeconf_set('start_time', -time.time())
while 1:
try:
plugins.joblist.run(False)
time.sleep(EVENTLOOP_DELAY)
except KeyboardInterrupt:
print('')
exit(130)
if active:
import plugins
events.event_loop.start()
if '__main__' == __name__: