# Path: core/channel.py
# class ChannelManager:
#     def __init__(self, db_dir, logger, network_name=None, validator=None):
#     def getList(self):
#     def getListFromNetwork(self, network_name):
#     def add(self, channel):
#     def addForNetwork(self, network_name, channel):
#     def delete(self, channel):
#     def delForNetwork(self, network_name, channel):
#     def makeNetworkDB(self):
#     def formatDBFileName(self, db_name):
# 
# Path: tools/hostmask.py
# def match(hostmask, matchhost, require_nickname=False):
# 
# Path: tools/logger.py
# class Logger:
#     def __init__(self, network_name, logDir=False, verbose=False,
#                  timestamp="%H:%M", logTimestamp="%Y-%m-%d %H:%M:%S", useColours=True):
#     def log(self, text):
#     def warning(self, text):
#     def notice(self, text):
#     def error(self, text):
#     def event(self, event, text):
#     def debug(self, text):
#     def log_verbose(self, text):
#     def notice_verbose(self, text):
#     def setVerbose(self, verbose):
#     def setTimestamp(self, timestamp):
#     def getTimestamp(self):
#     def setLogTimestamp(self, timestamp):
#     def getLogTimestamp(self):
#     def _setColours(self, useColours=True):
#     def _setColoursNone(self):
#     def _write(self, message, file=None):


import json
import os
import sys
from core import channel
from tools import hostmask
from tools import logger
                                .format(val[0], val[1]))
            except Exception as e:
                self.logger.error("An error occured while loading config.json:\n{}".format(str(e)))
                sys.exit(1)
        else:
            self.logger.error("Could not find configuration file config.json, did you configure the bot?")
            sys.exit(1)

    def getNetworks(self):
        return self.networks

    def getNetwork(self, network):
        return self.networks[network] if network in self.networks else None

    def getNetworkById(self, id):
        for network in self.networks:
            if network["id"] == id:
                return network

        return None

    def getNetworkItem(self, network, item):
        return self.networks[network][item] if network in self.networks and item in self.networks[network] else None

    def getCommandPrefix(self, network):
        return self.networks[network]["command_prefix"] if network in self.networks else "!"

    def isAdministrator(self, network, address):
        if network in self.networks:
            for addr in self.networks[network]["administrators"]:

# Path: core/channel.py
# class ChannelManager:
#     def __init__(self, db_dir, logger, network_name=None, validator=None):
#     def getList(self):
#     def getListFromNetwork(self, network_name):
#     def add(self, channel):
#     def addForNetwork(self, network_name, channel):
#     def delete(self, channel):
#     def delForNetwork(self, network_name, channel):
#     def makeNetworkDB(self):
#     def formatDBFileName(self, db_name):
# 
# Path: tools/hostmask.py
# def match(hostmask, matchhost, require_nickname=False):
# 
# Path: tools/logger.py
# class Logger:
#     def __init__(self, network_name, logDir=False, verbose=False,
#                  timestamp="%H:%M", logTimestamp="%Y-%m-%d %H:%M:%S", useColours=True):
#     def log(self, text):
#     def warning(self, text):
#     def notice(self, text):
#     def error(self, text):
#     def event(self, event, text):
#     def debug(self, text):
#     def log_verbose(self, text):
#     def notice_verbose(self, text):
#     def setVerbose(self, verbose):
#     def setTimestamp(self, timestamp):
#     def getTimestamp(self):
#     def setLogTimestamp(self, timestamp):
#     def getLogTimestamp(self):
#     def _setColours(self, useColours=True):
#     def _setColoursNone(self):
#     def _write(self, message, file=None):


# Path: core/config.py
import json
import os
import sys
from core import channel
from tools import hostmask
from tools import logger

                                .format(val[0], val[1]))
            except Exception as e:
                self.logger.error("An error occured while loading config.json:\n{}".format(str(e)))
                sys.exit(1)
        else:
            self.logger.error("Could not find configuration file config.json, did you configure the bot?")
            sys.exit(1)

    def getNetworks(self):
        return self.networks

    def getNetwork(self, network):
        return self.networks[network] if network in self.networks else None

    def getNetworkById(self, id):
        for network in self.networks:
            if network["id"] == id:
                return network

        return None

    def getNetworkItem(self, network, item):
        return self.networks[network][item] if network in self.networks and item in self.networks[network] else None

    def getCommandPrefix(self, network):
        return self.networks[network]["command_prefix"] if network in self.networks else "!"

    def isAdministrator(self, network, address):
        if network in self.networks:
            for addr in self.networks[network]["administrators"]:

                if hostmask.match(address, addr):