コード例 #1
0
 def clientConnectionFailed(self, connector, reason):
     self.doStop()
     logerr(
         "Cannot connect to IRC server %s on port %d: %s.\nERROR: Please check your configuration in `gazouilleur/config.py`.\n"
         % (config.HOST, config.PORT, reason.getErrorMessage()))
     reactor.stop()
コード例 #2
0
ファイル: tests.py プロジェクト: wincelau/gazouilleur
 def clientConnectionFailed(self, connector, reason):
     self.doStop()
     logerr("Cannot connect to IRC server %s on port %d: %s.\nERROR: Please check your configuration in `gazouilleur/config.py`.\n" % (config.HOST, config.PORT, reason.getErrorMessage()))
     reactor.stop()
コード例 #3
0
        colorize(
            "Could not read `gazouilleur/config.py`.\nERROR: Please edit it to fix the following syntax issue:\nERROR: %s\n%s\n"
            % (e, "\n".join(format_exc().splitlines()[-3:-1])),
            'red',
            style='bold'))
    exit(1)

#Load decorator
from gazouilleur.lib.log import logerr

try:
    config.BOTNAME, config.BOTPASS, config.HOST, config.PORT, config.MONGODB, config.GLOBAL_USERS, config.BACK_HOURS, config.COMMAND_CHARACTER, config.CHANNELS, config.DEBUG, config.ADMINS, config.EXTRA_COMMANDS
    [config.MONGODB[k] for k in ['HOST', 'PORT', 'DATABASE', 'USER', 'PSWD']]
except AttributeError as e:
    logerr(
        "Some field is missing from `gazouilleur/config.py`.\nERROR: Please edit it to fix the following issue:\nERROR: %s"
        % str(e).replace("'module' object", 'config'))
    exit(1)
except KeyError as e:
    logerr(
        "A field is missing from MONGODB config in `gazouilleur/config.py`: %s."
        % e)
    exit(1)
try:
    assert (len([
        1 for c in config.CHANNELS.values() if "MASTER" in c and c["MASTER"]
    ]) == 1)
    [c[k] for k in ['USERS', 'DISPLAY_RT'] for c in config.CHANNELS.values()]
except AssertionError:
    logerr(
        "One and only one channel must be set as MASTER in `gazouilleur/config.py`.\nERROR: Please edit it to fix this issue."
コード例 #4
0
ファイル: tests.py プロジェクト: wincelau/gazouilleur
    from gazouilleur import config
except ImportError:
    stderr.write(colorize("Could not find `gazouilleur/config.py`.\nERROR: Please run `bash bin/configure.sh` to create it, then edit it to prepare your bot.\n", 'red', style='bold'))
    exit(1)
except SyntaxError as e:
    stderr.write(colorize("Could not read `gazouilleur/config.py`.\nERROR: Please edit it to fix the following syntax issue:\nERROR: %s\n%s\n" % (e, "\n".join(format_exc().splitlines()[-3:-1])), 'red', style='bold'))
    exit(1)

#Load decorator
from gazouilleur.lib.log import logerr

try:
    config.BOTNAME, config.BOTPASS, config.HOST, config.PORT, config.MONGODB, config.GLOBAL_USERS, config.BACK_HOURS, config.COMMAND_CHARACTER, config.CHANNELS, config.DEBUG, config.ADMINS
    [config.MONGODB[k] for k in ['HOST', 'PORT', 'DATABASE', 'USER', 'PSWD']]
except AttributeError as e:
    logerr("Some field is missing from `gazouilleur/config.py`.\nERROR: Please edit it to fix the following issue:\nERROR: %s" % str(e).replace("'module' object", 'config'))
    exit(1)
except KeyError as e:
    logerr("A field is missing from MONGODB config in `gazouilleur/config.py`: %s." % e)
    exit(1)
try:
    assert(len([1 for c in config.CHANNELS.values() if "MASTER" in c and c["MASTER"]]) == 1)
    [c[k] for k in ['USERS', 'DISPLAY_RT'] for c in config.CHANNELS.values()]
except AssertionError:
    logerr("One and only one channel must be set as MASTER in `gazouilleur/config.py`.\nERROR: Please edit it to fix this issue.")
    exit(1)
except KeyError as e:
    logerr("A field is missing from one channel set in `gazouilleur/config.py`: %s." % e)
    exit(1)
try:
    [c['IDENTICA']['USER'] for c in config.CHANNELS.values() if "IDENTICA" in c]