3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-24 11:39:25 +01:00
PyLink/world.py
James Lu 183a4cbd75 core: add extban support in matchHost, and $account matching (#170)
The following forms are supported in $account, with groups separated by a
literal colon. All account and network name matching is currently case sensitive:

$account -> Returns True (a match) if the target is registered.
$account:accountname -> Returns True if the target's account name matches the one given, and the target is connected to the local network..
$account:accountname:netname -> Returns True if both the target's account name and origin network name match the ones given.
$account:*:netname -> Matches all logged in users on the given network.
2016-07-07 00:26:52 -07:00

25 lines
719 B
Python

"""
world.py: Stores global variables for PyLink, including lists of active IRC objects and plugins.
"""
from collections import defaultdict
import threading
# 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.
hooks = defaultdict(list)
networkobjects = {}
plugins = {}
services = {}
# Registered extarget handlers. This maps exttarget names (strings) to handling functions.
exttarget_handlers = {}
started = threading.Event()
source = "https://github.com/GLolol/PyLink" # CHANGE THIS IF YOU'RE FORKING!!