aboutsummaryrefslogtreecommitdiff
path: root/start.py
diff options
context:
space:
mode:
authorGravatar jesopo2019-10-11 14:00:26 +0100
committerGravatar jesopo2019-10-11 14:00:26 +0100
commitcefde48e42d68eeb25e83185586ef4ebf40516ed (patch)
tree393582bd5f6723e7841eeddc38c1a78242154a1b /start.py
parentLockFile doesn't need to hold on to _database_location (diff)
signature
first draft of infrastructure for unix domain control socket
Diffstat (limited to 'start.py')
-rwxr-xr-xstart.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/start.py b/start.py
index 270c021d..fbd17b23 100755
--- a/start.py
+++ b/start.py
@@ -7,7 +7,7 @@ if sys.version_info < (3, 6):
sys.exit(1)
import atexit, argparse, faulthandler, os, platform, time
-from src import Cache, Config, Database, EventManager, Exports, IRCBot
+from src import Cache, Config, Control, Database, EventManager, Exports, IRCBot
from src import LockFile, Logging, ModuleManager, Timers, utils
faulthandler.enable()
@@ -96,6 +96,9 @@ events = EventManager.EventRoot(log).wrap()
exports = Exports.Exports()
timers = Timers.Timers(database, events, log)
+control = Control.Control(events, args.database)
+control.bind()
+
module_directories = [os.path.join(directory, "modules")]
if args.external:
module_directories.append(os.path.abspath(args.external))
@@ -111,6 +114,8 @@ bot.add_poll_hook(cache)
bot.add_poll_hook(lock_file)
bot.add_poll_hook(timers)
+bot.add_poll_source(control)
+
if args.module:
definition = modules.find_module(args.module)
module = modules.load_module(bot, definition)