2003-03-12 07:26:59 +01:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
|
|
|
###
|
|
|
|
# Copyright (c) 2002, Jeremiah Fincher
|
|
|
|
# All rights reserved.
|
|
|
|
#
|
|
|
|
# Redistribution and use in source and binary forms, with or without
|
|
|
|
# modification, are permitted provided that the following conditions are met:
|
|
|
|
#
|
|
|
|
# * Redistributions of source code must retain the above copyright notice,
|
|
|
|
# this list of conditions, and the following disclaimer.
|
|
|
|
# * Redistributions in binary form must reproduce the above copyright notice,
|
|
|
|
# this list of conditions, and the following disclaimer in the
|
|
|
|
# documentation and/or other materials provided with the distribution.
|
|
|
|
# * Neither the name of the author of this software nor the name of
|
|
|
|
# contributors to this software may be used to endorse or promote products
|
|
|
|
# derived from this software without specific prior written consent.
|
|
|
|
#
|
|
|
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
|
|
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
|
|
|
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
|
|
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
|
|
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
# POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
###
|
|
|
|
|
2003-11-25 09:38:19 +01:00
|
|
|
__revision__ = "$Id$"
|
|
|
|
|
2003-10-05 14:47:19 +02:00
|
|
|
import fix
|
2003-03-12 07:26:59 +01:00
|
|
|
|
2003-12-01 16:38:42 +01:00
|
|
|
import os
|
2003-09-24 09:28:25 +02:00
|
|
|
import sys
|
|
|
|
|
2003-07-31 08:20:58 +02:00
|
|
|
import sets
|
2003-03-12 07:26:59 +01:00
|
|
|
import os.path
|
2003-11-26 19:21:12 +01:00
|
|
|
import logging
|
2003-03-12 07:26:59 +01:00
|
|
|
|
|
|
|
###
|
|
|
|
# Directions:
|
|
|
|
#
|
|
|
|
# Boolean values should be either True or False.
|
|
|
|
###
|
|
|
|
|
|
|
|
###
|
|
|
|
# Directories.
|
|
|
|
###
|
|
|
|
logDir = 'logs'
|
|
|
|
confDir = 'conf'
|
|
|
|
dataDir = 'data'
|
2003-09-24 09:28:25 +02:00
|
|
|
installDir = os.path.dirname(os.path.dirname(sys.modules[__name__].__file__))
|
|
|
|
pluginDirs = [os.path.join(installDir, s) for s in ('src', 'plugins')]
|
2003-03-12 07:26:59 +01:00
|
|
|
|
|
|
|
###
|
|
|
|
# Files.
|
|
|
|
###
|
2003-09-18 09:44:25 +02:00
|
|
|
userfile = 'users.conf'
|
|
|
|
channelfile = 'channels.conf'
|
2003-03-12 07:26:59 +01:00
|
|
|
|
2003-11-26 19:21:12 +01:00
|
|
|
###
|
|
|
|
# minimumLogPriority: The minimum priority that will be logged. Defaults to
|
|
|
|
# logging.INFO, which is probably a good value. Can also
|
|
|
|
# be usefully set to logging.{DEBUG,WARNING,ERROR,CRITICAL}
|
|
|
|
###
|
|
|
|
minimumLogPriority = logging.INFO
|
|
|
|
|
|
|
|
###
|
|
|
|
# stdoutLogging: Determines whether or not the bot logs to stdout.
|
|
|
|
###
|
|
|
|
stdoutLogging = True
|
|
|
|
|
2003-12-01 16:38:42 +01:00
|
|
|
###
|
|
|
|
# colorizedStdoutLogging: Determines whether or not the bot logs colored logs
|
|
|
|
# to stdout.
|
|
|
|
###
|
|
|
|
colorizedStdoutLogging = True
|
|
|
|
|
2003-03-12 07:26:59 +01:00
|
|
|
###
|
2003-08-26 13:15:15 +02:00
|
|
|
# logTimestampFormat: A format string defining how timestamps should be. Check
|
|
|
|
# the Python library reference for the "time" module to see
|
|
|
|
# what the various format specifiers mean.
|
2003-03-12 07:26:59 +01:00
|
|
|
###
|
2003-08-26 13:15:15 +02:00
|
|
|
logTimestampFormat = '[%d-%b-%Y %H:%M:%S]'
|
|
|
|
|
|
|
|
###
|
|
|
|
# humanTimestampFormat: A format string defining how timestamps should be
|
|
|
|
# formatted for human consumption. Check the Python
|
|
|
|
# library reference for the "time" module to see what the
|
|
|
|
# various format specifiers mean.
|
|
|
|
###
|
|
|
|
humanTimestampFormat = '%I:%M %p, %B %d, %Y'
|
2003-03-12 07:26:59 +01:00
|
|
|
|
|
|
|
###
|
|
|
|
# throttleTime: A floating point number of seconds to throttle queued messages.
|
|
|
|
# (i.e., messages will not be sent faster than once per
|
|
|
|
# throttleTime units.)
|
|
|
|
###
|
|
|
|
throttleTime = 1.0
|
|
|
|
|
2003-11-07 13:47:36 +01:00
|
|
|
###
|
|
|
|
# snarfThrottle: A floating point number of seconds to throttle snarfed URLs,
|
|
|
|
# in order to prevent loops between two bots.
|
|
|
|
###
|
|
|
|
snarfThrottle = 10.0
|
|
|
|
|
2003-03-12 07:26:59 +01:00
|
|
|
###
|
|
|
|
# allowEval: True if the owner (and only the owner) should be able to eval
|
|
|
|
# arbitrary Python code.
|
|
|
|
###
|
2003-08-29 09:23:14 +02:00
|
|
|
allowEval = False
|
2003-03-12 07:26:59 +01:00
|
|
|
|
2003-09-10 10:32:20 +02:00
|
|
|
###
|
|
|
|
# replyWhenNotCommand: True if you want the bot reply when someone apparently
|
|
|
|
# addresses him but there is no command. Otherwise he'll
|
|
|
|
# just remain silent.
|
|
|
|
###
|
|
|
|
replyWhenNotCommand = True
|
|
|
|
|
2003-10-20 12:10:46 +02:00
|
|
|
###
|
|
|
|
# replyWithPrivateNotice: True if replies to a user in a channel should be
|
|
|
|
# noticed to that user instead of sent to the channel
|
|
|
|
# itself.
|
2003-12-07 00:52:23 +01:00
|
|
|
###
|
2003-10-20 12:10:46 +02:00
|
|
|
replyWithPrivateNotice = False
|
|
|
|
|
2003-12-07 00:52:23 +01:00
|
|
|
###
|
|
|
|
# replyWithNickPrefix: True if the bot should always prefix the nick of the
|
|
|
|
# person giving the command to its reply.
|
|
|
|
###
|
|
|
|
replyWithNickPrefix = True
|
|
|
|
|
|
|
|
###
|
2003-12-07 01:17:01 +01:00
|
|
|
# replyWhenAddressedByNick: True if the bot should reply to messages of the
|
2003-12-07 00:52:23 +01:00
|
|
|
# form "botnick: foo" where "botnick" is the bot's
|
|
|
|
# nick.
|
|
|
|
###
|
2003-12-07 01:17:01 +01:00
|
|
|
replyWhenAddressedByNick = True
|
2003-12-07 00:52:23 +01:00
|
|
|
|
2003-12-17 14:22:21 +01:00
|
|
|
###
|
|
|
|
# replyWhenNotAddressed: True if the bot should reply to messages even if they
|
|
|
|
# don't address it at all. If you have this on, you'll
|
|
|
|
# almost certainly want to make sure replyWhenNotCommand
|
|
|
|
# is turned off.
|
|
|
|
###
|
|
|
|
replyWhenNotAddressed = False
|
|
|
|
|
2003-09-17 21:19:38 +02:00
|
|
|
###
|
|
|
|
# requireRegistration: Oftentimes a plugin will want to record who added or
|
|
|
|
# changed or messed with it last. Supybot's user database
|
|
|
|
# is an excellent way to determine who exactly someone is.
|
|
|
|
# You may, however, want something a little less
|
|
|
|
# "intrustive," so you can set this variable to False to
|
|
|
|
# tell such plugins that they should use the hostmask when
|
|
|
|
# the user isn't registered with the user database.
|
|
|
|
###
|
|
|
|
requireRegistration = False
|
|
|
|
|
2003-12-17 14:39:05 +01:00
|
|
|
###
|
|
|
|
# followIdentificationThroughNickChanges: By default the bot will simply
|
|
|
|
# unidentify someone when he changes
|
|
|
|
# his nick. Setting this to True will
|
|
|
|
# cause the bot to track such changes.
|
|
|
|
###
|
|
|
|
followIdentificationThroughNickChanges = False
|
|
|
|
|
2003-09-17 21:19:38 +02:00
|
|
|
###
|
|
|
|
# enablePipeSyntax: Supybot allows nested commands; generally, commands are
|
|
|
|
# nested via [square brackets]. Supybot can also use a
|
|
|
|
# syntax more similar to Unix pipes. What would be (and
|
|
|
|
# still can be; the pipe syntax doesn't disable the bracket
|
|
|
|
# syntax) "bot: bar [foo]" can now by "bot: foo | bar"
|
|
|
|
# This variable enables such syntax.
|
|
|
|
###
|
|
|
|
enablePipeSyntax = False
|
|
|
|
|
2003-10-24 13:31:09 +02:00
|
|
|
###
|
|
|
|
# showOnlySyntax : Supybot normally returns the full help whenever a user
|
|
|
|
# misuses a command. If this option is set to True, the bot
|
|
|
|
# will only return the syntax of the command (the first line
|
|
|
|
# of the docstring) rather than the full help.
|
|
|
|
###
|
|
|
|
showOnlySyntax = False
|
|
|
|
|
2003-03-12 07:26:59 +01:00
|
|
|
###
|
2003-04-21 05:04:40 +02:00
|
|
|
# defaultCapabilities: Capabilities allowed to everyone by default. You almost
|
|
|
|
# certainly want to have !owner and !admin in here.
|
2003-03-12 07:26:59 +01:00
|
|
|
###
|
2003-12-04 09:28:56 +01:00
|
|
|
defaultCapabilities = sets.Set(['-owner', '-admin', '-trusted'])
|
2003-03-12 07:26:59 +01:00
|
|
|
|
|
|
|
###
|
|
|
|
# reply%s: Stock replies for various reasons.
|
|
|
|
###
|
|
|
|
replyError = 'An error has occurred and has been logged.'
|
|
|
|
replyNoCapability = 'You don\'t have the "%s" capability.'
|
|
|
|
replySuccess = 'The operation succeeded.'
|
|
|
|
replyIncorrectAuth = 'Your hostmasks don\'t match or your password is wrong.'
|
|
|
|
replyNoUser = 'I can\'t find that user in my database.'
|
2003-09-08 10:46:23 +02:00
|
|
|
replyNotRegistered = 'You must be registered to use this command.'
|
2003-03-12 07:26:59 +01:00
|
|
|
replyInvalidArgument = 'I can\'t send \\r, \\n, or \\0 (\\x00).'
|
|
|
|
replyRequiresPrivacy = 'That can\'t be done in a channel.'
|
|
|
|
replyEvalNotAllowed = 'You must enable conf.allowEval for that to work.'
|
2003-10-28 00:45:15 +01:00
|
|
|
replyPossibleBug = 'This may be a bug. If you think it is, please file a bug '\
|
2003-10-22 22:26:54 +02:00
|
|
|
'report at <http://sourceforge.net/tracker/?' \
|
|
|
|
'func=add&group_id=58965&atid=489447>'
|
2003-03-12 07:26:59 +01:00
|
|
|
|
|
|
|
###
|
|
|
|
# errorReplyPrivate: True if errors should be reported privately so as not to
|
|
|
|
# bother the channel.
|
|
|
|
###
|
|
|
|
errorReplyPrivate = False
|
|
|
|
|
|
|
|
###
|
|
|
|
# telnetEnable: A boolean saying whether or not to enable the telnet REPL.
|
|
|
|
# This will allow a user with the 'owner' capability to telnet
|
|
|
|
# into the bot and see how it's working internally. A lifesaver
|
|
|
|
# for development.
|
|
|
|
###
|
2003-03-27 10:36:44 +01:00
|
|
|
telnetEnable = False
|
2003-03-12 07:26:59 +01:00
|
|
|
telnetPort = 31337
|
|
|
|
|
|
|
|
###
|
2003-04-17 12:07:43 +02:00
|
|
|
# poll: the length of a polling term.
|
|
|
|
# If asyncore drivers are all you're using, feel free to make
|
|
|
|
# this arbitrarily large -- be warned, however, that all other
|
|
|
|
# drivers are just sitting around while asyncore waits during
|
|
|
|
# this poll period (including the schedule). It'll take more
|
|
|
|
# CPU, but you probably don't want to set this more than 0.01
|
|
|
|
# when you've got non-asyncore drivers to worry about.
|
2003-03-12 07:26:59 +01:00
|
|
|
###
|
2003-04-17 12:07:43 +02:00
|
|
|
poll = 1
|
2003-03-12 07:26:59 +01:00
|
|
|
|
2003-12-20 08:01:09 +01:00
|
|
|
###
|
|
|
|
# pingServer: Determines whether the bot will send PINGs to the server it's
|
|
|
|
# connected to in order to keep the connection alive. Sometimes
|
|
|
|
# this seems to result in instability.
|
|
|
|
###
|
|
|
|
pingServer = True
|
|
|
|
|
2003-03-12 07:26:59 +01:00
|
|
|
###
|
2003-04-05 14:25:39 +02:00
|
|
|
# maxHistory: Maximum number of messages kept in an Irc object's state.
|
2003-03-12 07:26:59 +01:00
|
|
|
###
|
2003-09-07 07:27:24 +02:00
|
|
|
maxHistory = 1000
|
2003-03-12 07:26:59 +01:00
|
|
|
|
|
|
|
###
|
|
|
|
# pingInterval: Number of seconds between PINGs to the server.
|
|
|
|
# 0 means not to ping the server.
|
|
|
|
###
|
|
|
|
pingInterval = 120
|
|
|
|
|
|
|
|
###
|
|
|
|
# nickmods: List of ways to 'spice up' a nick so the bot doesn't run out of
|
|
|
|
# nicks if all his normal ones are taken.
|
|
|
|
###
|
|
|
|
nickmods = ['%s^', '^%s^', '__%s__', '%s_', '%s__', '__%s', '^^%s^^', '{%s}',
|
|
|
|
'[%s]', '][%s][', '}{%s}{', '}{}%s', '^_^%s', '%s^_^', '^_^%s^_^']
|
|
|
|
|
|
|
|
###
|
2003-04-21 05:04:40 +02:00
|
|
|
# defaultAllow: Are commands allowed by default?
|
2003-03-12 07:26:59 +01:00
|
|
|
###
|
2003-04-21 05:04:40 +02:00
|
|
|
defaultAllow = True
|
2003-03-12 07:26:59 +01:00
|
|
|
|
|
|
|
###
|
|
|
|
# defaultIgnore: True if users should be ignored by default.
|
|
|
|
# It's a really easy way to make sure that people who want to
|
|
|
|
# talk to the bot register first. (Of course, they can't
|
|
|
|
# register if they're ignored. We'll work on that.)
|
|
|
|
###
|
|
|
|
defaultIgnore = False
|
|
|
|
|
|
|
|
###
|
|
|
|
# ignores: Hostmasks to ignore.
|
|
|
|
###
|
|
|
|
ignores = []
|
|
|
|
|
|
|
|
###
|
|
|
|
# prefixChars: A string of chars that are valid prefixes to address the bot.
|
|
|
|
###
|
|
|
|
prefixChars = '@'
|
|
|
|
|
2003-11-22 07:53:34 +01:00
|
|
|
###
|
|
|
|
# validPrefixChars: A string of chars that are allowed to be used as
|
|
|
|
# prefixChars.
|
|
|
|
###
|
|
|
|
validPrefixChars = '`~!@#$%^&*()_-+=[{}]\\|\'";:,<.>/?'
|
|
|
|
|
2003-03-27 21:40:58 +01:00
|
|
|
###
|
|
|
|
# detailedTracebacks: A boolean describing whether or not the bot will give
|
|
|
|
# *extremely* detailed tracebacks. Be cautioned, this eats
|
|
|
|
# a lot of log file space.
|
|
|
|
###
|
|
|
|
detailedTracebacks = True
|
|
|
|
|
2003-04-20 01:53:47 +02:00
|
|
|
###
|
|
|
|
# driverModule: A string that is the module where the default driver for the
|
|
|
|
# bot will be found.
|
|
|
|
###
|
2003-09-01 19:35:09 +02:00
|
|
|
driverModule = 'socketDrivers'
|
|
|
|
#driverModule = 'asyncoreDrivers'
|
2003-07-31 08:20:58 +02:00
|
|
|
#driverModule = 'twistedDrivers'
|
2003-04-17 12:07:43 +02:00
|
|
|
|
2003-03-12 07:26:59 +01:00
|
|
|
###############################
|
|
|
|
###############################
|
|
|
|
###############################
|
|
|
|
# DO NOT EDIT PAST THIS POINT #
|
|
|
|
###############################
|
|
|
|
###############################
|
|
|
|
###############################
|
2003-12-12 20:03:22 +01:00
|
|
|
version ='0.76.1'
|
2003-08-28 15:59:07 +02:00
|
|
|
|
2003-08-29 02:34:05 +02:00
|
|
|
commandsOnStart = []
|
|
|
|
|
2003-09-22 10:36:12 +02:00
|
|
|
# This is a dictionary mapping names to converter functions for use in the
|
2003-10-21 08:03:57 +02:00
|
|
|
# Owner.setconf command.
|
2003-09-22 10:36:12 +02:00
|
|
|
def mybool(s):
|
2003-10-05 05:33:15 +02:00
|
|
|
"""Converts a string read from the user into a bool, fuzzily."""
|
2003-09-22 10:36:12 +02:00
|
|
|
if s.capitalize() == 'False' or s == '0':
|
|
|
|
return False
|
|
|
|
elif s.capitalize() == 'True' or s == '1':
|
|
|
|
return True
|
|
|
|
else:
|
|
|
|
raise ValueError, 'invalid literal for mybool()'
|
|
|
|
|
|
|
|
def mystr(s):
|
2003-10-05 05:33:15 +02:00
|
|
|
"""Converts a string read from the user into a real string."""
|
2003-09-22 10:36:12 +02:00
|
|
|
while s and s[0] in "'\"" and s[0] == s[-1]:
|
|
|
|
s = s[1:-1]
|
|
|
|
return s
|
|
|
|
|
|
|
|
types = {
|
|
|
|
'logDir': mystr,
|
|
|
|
'confDir': mystr,
|
|
|
|
'dataDir': mystr,
|
|
|
|
#'pluginDirs': (list, str),
|
|
|
|
'userfile': mystr,
|
|
|
|
'channelfile': mystr,
|
|
|
|
'logTimestampFormat': mystr,
|
|
|
|
'humanTimestampFormat': mystr,
|
|
|
|
'throttleTime': float,
|
2003-11-07 13:47:36 +01:00
|
|
|
'snarfThrottle': float,
|
2003-09-22 10:36:12 +02:00
|
|
|
#'allowEval': mybool,
|
|
|
|
'replyWhenNotCommand': mybool,
|
2003-10-20 22:48:19 +02:00
|
|
|
'replyWithPrivateNotice': mybool,
|
2003-12-07 00:52:23 +01:00
|
|
|
'replyWithNickPrefix': mybool,
|
2003-12-07 01:17:01 +01:00
|
|
|
'replyWhenAddressedByNick': mybool,
|
2003-09-22 10:36:12 +02:00
|
|
|
'requireRegistration': mybool,
|
|
|
|
'enablePipeSyntax': mybool,
|
|
|
|
'replyError': mystr,
|
|
|
|
'replyNoCapability': mystr,
|
|
|
|
'replySuccess': mystr,
|
|
|
|
'replyIncorrectAuth': mystr,
|
|
|
|
'replyNoUser': mystr,
|
|
|
|
'replyNotRegistered': mystr,
|
|
|
|
'replyInvalidArgument': mystr,
|
|
|
|
'replyRequiresPrivacy': mystr,
|
|
|
|
'replyEvalNotAllowed': mystr,
|
|
|
|
'errorReplyPrivate': mybool,
|
|
|
|
#'telnetEnable': mybool,
|
|
|
|
#'telnetPort': int,
|
|
|
|
'poll': float,
|
|
|
|
#'maxHistory': int,
|
|
|
|
'pingInterval': float,
|
|
|
|
#'nickmods': (list, str),
|
|
|
|
'defaultAllow': mybool,
|
|
|
|
'defaultIgnore': mybool,
|
|
|
|
#'ignores': (list, str),
|
|
|
|
'prefixChars': mystr,
|
|
|
|
'detailedTracebacks': mybool,
|
|
|
|
'driverModule': mystr,
|
2003-10-24 13:31:09 +02:00
|
|
|
'showOnlySyntax': mybool,
|
2003-12-20 08:01:09 +01:00
|
|
|
'pingServer': mybool,
|
2003-12-17 14:39:05 +01:00
|
|
|
'followIdentificationThroughNickChanges': mybool
|
2003-09-22 10:36:12 +02:00
|
|
|
}
|
|
|
|
|
2003-12-01 16:38:42 +01:00
|
|
|
if os.name == 'nt':
|
|
|
|
colorizedStdoutLogging = False
|
2003-09-22 10:36:12 +02:00
|
|
|
|
2003-08-22 09:20:31 +02:00
|
|
|
# vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78:
|