mirror of
https://github.com/jlu5/PyLink.git
synced 2024-11-24 03:29:28 +01:00
parent
dd08c01791
commit
1ad8b2e539
@ -9,6 +9,8 @@ import threading
|
|||||||
import utils
|
import utils
|
||||||
import world
|
import world
|
||||||
from log import log
|
from log import log
|
||||||
|
import conf
|
||||||
|
import classes
|
||||||
|
|
||||||
@utils.add_cmd
|
@utils.add_cmd
|
||||||
def disconnect(irc, source, args):
|
def disconnect(irc, source, args):
|
||||||
@ -51,15 +53,9 @@ def connect(irc, source, args):
|
|||||||
return
|
return
|
||||||
if network.connection_thread.is_alive():
|
if network.connection_thread.is_alive():
|
||||||
irc.reply('Error: Network "%s" seems to be already connected.' % netname)
|
irc.reply('Error: Network "%s" seems to be already connected.' % netname)
|
||||||
else: # Reconnect the network!
|
else: # Recreate the IRC object.
|
||||||
network.connection_thread = threading.Thread(target=network.connect)
|
proto = utils.getProtocolModule(network.serverdata.get("protocol"))
|
||||||
network.connection_thread.start()
|
world.networkobjects[netname] = classes.Irc(netname, proto, conf.conf)
|
||||||
|
|
||||||
# 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)
|
|
||||||
|
|
||||||
irc.reply("Done.")
|
irc.reply("Done.")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user