3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-27 04:59:24 +01:00

pylink, world: default tests mode to False, simplify imports

This commit is contained in:
James Lu 2016-06-23 22:51:40 -07:00
parent 77e13bce03
commit be19f88e86
2 changed files with 7 additions and 10 deletions

8
pylink
View File

@ -1,12 +1,12 @@
#!/usr/bin/env python3
"""
PyLink IRC Services launcher.
"""
import os
import sys
try:
from pylinkirc import world, conf
# This must be set to False to disable test mode and enable threaded connections.
# Otherwise you'll only be able to connect to one net at a time! Which is boring.
world.testing = False
except ImportError:
sys.stderr.write("ERROR: Failed to import PyLink main module (pylinkirc.world).\n\nIf you are "
"running PyLink from source, please install PyLink first using 'python3 "
@ -30,7 +30,7 @@ if __name__ == '__main__':
conf.loadConf(args.config)
from pylinkirc.log import log
from pylinkirc import classes, utils, coremods, world
from pylinkirc import classes, utils, coremods
log.info('PyLink %s starting...', world.version)
# Write a PID file unless specifically told not to.

View File

@ -7,12 +7,9 @@ import threading
import subprocess
import os
# Global variable to indicate whether we're being ran directly, or imported
# for a testcase. This defaults to True.
testing = True
# Sets the default protocol module to use with tests.
testing_ircd = 'inspircd'
# This indicates whether we're running in tests modes. What it actually does
# though is control whether IRC connections should be threaded or not.
testing = False
# Statekeeping for our hooks list, IRC objects, loaded plugins, and initialized
# service bots.