3
0
mirror of https://github.com/jlu5/PyLink.git synced 2025-02-18 22:40:44 +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 #!/usr/bin/env python3
"""
PyLink IRC Services launcher.
"""
import os import os
import sys import sys
try: try:
from pylinkirc import world, conf 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: except ImportError:
sys.stderr.write("ERROR: Failed to import PyLink main module (pylinkirc.world).\n\nIf you are " 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 " "running PyLink from source, please install PyLink first using 'python3 "
@ -30,7 +30,7 @@ if __name__ == '__main__':
conf.loadConf(args.config) conf.loadConf(args.config)
from pylinkirc.log import log 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) log.info('PyLink %s starting...', world.version)
# Write a PID file unless specifically told not to. # Write a PID file unless specifically told not to.

View File

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