mirror of
https://github.com/jlu5/PyLink.git
synced 2025-02-18 14:30:42 +01:00
pylink, world: default tests mode to False, simplify imports
This commit is contained in:
parent
77e13bce03
commit
be19f88e86
8
pylink
8
pylink
@ -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.
|
||||||
|
9
world.py
9
world.py
@ -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.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user