mirror of
https://github.com/jlu5/PyLink.git
synced 2024-11-27 21:19:31 +01:00
parent
dd08c01791
commit
1ad8b2e539
@ -9,6 +9,8 @@ import threading
|
||||
import utils
|
||||
import world
|
||||
from log import log
|
||||
import conf
|
||||
import classes
|
||||
|
||||
@utils.add_cmd
|
||||
def disconnect(irc, source, args):
|
||||
@ -51,15 +53,9 @@ def connect(irc, source, args):
|
||||
return
|
||||
if network.connection_thread.is_alive():
|
||||
irc.reply('Error: Network "%s" seems to be already connected.' % netname)
|
||||
else: # Reconnect the network!
|
||||
network.connection_thread = threading.Thread(target=network.connect)
|
||||
network.connection_thread.start()
|
||||
|
||||
# And the plugins we have too.
|
||||
for plugin in world.plugins.values():
|
||||
if hasattr(plugin, 'main'):
|
||||
log.debug('(%s) Calling main() function of plugin %r', irc.name, plugin)
|
||||
plugin.main(irc)
|
||||
else: # Recreate the IRC object.
|
||||
proto = utils.getProtocolModule(network.serverdata.get("protocol"))
|
||||
world.networkobjects[netname] = classes.Irc(netname, proto, conf.conf)
|
||||
|
||||
irc.reply("Done.")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user