Exemple #1
0
 def testInteger(self):
     v = registry.Integer(1, 'help')
     self.assertEqual(v(), 1)
     v.setValue(10)
     self.assertEqual(v(), 10)
     v.set('100')
     self.assertEqual(v(), 100)
     v.set('-1000')
     self.assertEqual(v(), -1000)
Exemple #2
0
    path is given, the location of the file is assumed to be inside the
    data%sGateway%skeys directory""" % (os.sep, os.sep)))

conf.registerGlobalValue(Sshd.keys, 'rsaAuthorizedDir',
    registry.String('authorized_rsa',
                    """Name of the directory containing the authorized RSA public key files
    for use with Ssh. Unless a complete path is given, the location of the
    file is assumed to be inside the data%sGateway%skeys directory""" % \
    (os.sep, os.sep)))

shellGroup = conf.registerGroup(Sshd, 'shell')

conf.registerGlobalValue(
    shellGroup, 'defaultPort',
    registry.Integer(
        9022, """The port that the Sshd Shell server will start on if started
    automatically, or without port argument."""))

conf.registerGlobalValue(
    shellGroup, 'autoStart',
    registry.Boolean(
        True,
        """Determines whether the Sshd Shell server will start automatically when
    the Sshd plugin is loaded."""))

conf.registerGlobalValue(
    shellGroup, 'capability',
    registry.String(
        '',
        """Determines what capability users will require to connect to the protocol.
	If this value is an empty string, no capability will be checked."""))
Exemple #3
0
    halfop people with the <channel>,halfop capability when they join the
    channel.""")))
conf.registerChannelValue(
    AutoMode, 'voice',
    registry.Boolean(
        True,
        _("""Determines whether the bot will automatically
    voice people with the <channel>,voice capability when they join the
    channel.""")))
conf.registerChannelValue(
    AutoMode, 'ban',
    registry.Boolean(
        True,
        _("""Determines whether the bot will automatically
    ban people who join the channel and are on the banlist.""")))
conf.registerChannelValue(
    AutoMode.ban, 'period',
    registry.PositiveInteger(
        86400,
        _("""Determines how many seconds the bot
    will automatically ban a person when banning.""")))

conf.registerChannelValue(
    AutoMode, 'delay',
    registry.Integer(
        0,
        _("""Determines how many seconds the bot will wait
    before applying a mode. Has no effect on bans.""")))

# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
Exemple #4
0
# 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.
###

import supybot.conf as conf
import supybot.registry as registry
from supybot.i18n import PluginInternationalization, internationalizeDocstring
_ = PluginInternationalization('MoobotFactoids')

def configure(advanced):
    # This will be called by supybot to configure this module.  advanced is
    # a bool that specifies whether the user identified themself as an advanced
    # user or not.  You should effect your configuration by manipulating the
    # registry as appropriate.
    from supybot.questions import expect, anything, something, yn
    conf.registerPlugin('MoobotFactoids', True)


MoobotFactoids = conf.registerPlugin('MoobotFactoids')
conf.registerChannelValue(MoobotFactoids,
    'showFactoidIfOnlyOneMatch', registry.Boolean(True, _("""Determines whether
    or not the factoid value will be shown when a listkeys search returns only
    one factoid key.""")))
conf.registerChannelValue(MoobotFactoids,
    'mostCount', registry.Integer(10, _("""Determines how many items are shown
    when the 'most' command is called.""")))


# vim:set shiftwidth=4 softtabstop=8 expandtab textwidth=78
Exemple #5
0
    Trivia, 'flexibility',
    registry.PositiveInteger(
        8,
        _("""The flexibility of the trivia answer
        checker.  One typo will be allowed for every __ characters.""")))

conf.registerChannelValue(
    Trivia, 'color',
    registry.PositiveInteger(
        10, _("""The mIRC color to use for trivia
        questions""")))

conf.registerChannelValue(
    Trivia, 'inactiveShutoff',
    registry.Integer(
        6,
        _("""The number of questions that can go
        unanswered before the trivia stops automatically.""")))

conf.registerGlobalValue(
    Trivia, 'scoreFile',
    registry.String(
        'scores.txt',
        _("""The path to the scores file.
        If it doesn't exist, it will be created.""")))

conf.registerGlobalValue(
    Trivia, 'questionFile',
    registry.String(
        'questions.txt',
        _("""The path to the questions file.
        If it doesn't exist, it will be created.""")))
Exemple #6
0
conf.registerGlobalValue(
    Sigyn, 'logChannel',
    registry.String("", """channel where bot's actions is announced"""))
conf.registerGlobalValue(
    Sigyn, 'useNotice',
    registry.Boolean(False, """use notices for announces in logChannel"""))

conf.registerGlobalValue(
    Sigyn, 'resolverTimeout',
    registry.PositiveInteger(
        3, """max duration of dns request/resolve in seconds"""))

conf.registerGlobalValue(
    Sigyn, 'klineDuration',
    registry.Integer(
        -1,
        """kline duration, in minutes, with -1, bot will not kill or kline"""))
conf.registerGlobalValue(
    Sigyn, 'klineMessage',
    registry.String(
        "Please do not spam users or channels on freenode. If in error, please contact [email protected].",
        """default reason used in kline's message"""))
conf.registerChannelValue(
    Sigyn, 'killMessage',
    registry.String("Spam is off topic on freenode.", """kill reason"""))

conf.registerGlobalValue(
    Sigyn, 'operatorNick',
    registry.String("", """oper's nick, must be filled""", private=True))
conf.registerGlobalValue(
    Sigyn, 'operatorPassword',
Exemple #7
0
    registry.PositiveInteger(27007, """Port to connect to."""))
conf.registerGlobalValue(
    MarketMonitor, 'autostart',
    registry.Boolean(
        False, """If true, will autostart monitoring upon bot
    startup."""))
conf.registerGlobalValue(
    MarketMonitor, 'marketsWhitelist',
    registry.SpaceSeparatedListOfStrings(
        "", """Whitelist of markets you
    want to monitor, space separated list of short market names. Leave
    blank to include all."""))
conf.registerGlobalValue(
    MarketMonitor, 'collapseThreshold',
    registry.Integer(
        3, """Minimum number of transactions the bot will
    collapse together"""))


class Formats(registry.OnlySomeStrings):
    validStrings = ('raw', 'pretty')


conf.registerGlobalValue(
    MarketMonitor, 'format',
    Formats(
        'raw', """Format of the output. Choose between 'raw', to
    output messages as-is, and 'pretty', for prettified and aligned output.""")
)

# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
Exemple #8
0
    MessageParser, 'enable',
    registry.Boolean(
        True,
        _("""Determines whether the
    message parser is enabled.  If enabled, will trigger on regexps
    added to the regexp db.""")))
conf.registerChannelValue(
    MessageParser, 'keepRankInfo',
    registry.Boolean(
        True,
        _("""Determines whether we keep updating the usage
    count for each regexp, for popularity ranking.""")))
conf.registerChannelValue(
    MessageParser, 'rankListLength',
    registry.Integer(
        20,
        _("""Determines the number of regexps returned
    by the triggerrank command.""")))
conf.registerChannelValue(
    MessageParser, 'requireVacuumCapability',
    registry.String(
        'admin',
        _("""Determines the capability required (if any) to
    vacuum the database.""")))
conf.registerChannelValue(
    MessageParser, 'requireManageCapability',
    registry.String(
        'admin; channel,op',
        _("""Determines the
    capabilities required (if any) to manage the regexp database,
    including add, remove, lock, unlock. Use 'channel,capab' for
    channel-level capabilities.
Exemple #9
0
def configure(advanced):
    # This will be called by supybot to configure this module.  advanced is
    # a bool that specifies whether the user identified themself as an advanced
    # user or not.  You should effect your configuration by manipulating the
    # registry as appropriate.
    from supybot.questions import expect, anything, something, yn
    conf.registerPlugin('Aka', True)


Aka = conf.registerPlugin('Aka')
# This is where your configuration variables (if any) should go.  For example:
# conf.registerGlobalValue(Aka, 'someConfigVariableName',
#     registry.Boolean(False, _("""Help for someConfigVariableName.""")))
conf.registerGlobalValue(
    Aka, 'maximumWordsInName',
    registry.Integer(
        5,
        _("""The maximum number of words allowed in a
    command name. Setting this to an high value may slow down your bot
    on long commands.""")))

conf.registerGroup(Aka, 'web')
conf.registerGlobalValue(
    Aka.web, 'enable',
    registry.Boolean(
        False,
        _("""Determines whether the Akas will be
    browsable through the HTTP server.""")))

# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
Exemple #10
0
conf.registerChannelValue(
    Tweety,
    "hideRealName",
    registry.Boolean(False,
                     """Do not show real name when displaying tweets."""),
)
conf.registerChannelValue(
    Tweety,
    "addShortUrl",
    registry.Boolean(False,
                     """Whether or not to add a short URL to the tweets."""),
)
conf.registerChannelValue(
    Tweety,
    "woeid",
    registry.Integer(
        1, """Where On Earth ID. World Wide is 1. USA is 23424977."""),
)
conf.registerChannelValue(
    Tweety,
    "defaultSearchResults",
    registry.Integer(3,
                     """Default number of results to return on searches."""),
)
conf.registerChannelValue(
    Tweety,
    "maxSearchResults",
    registry.Integer(10,
                     """Maximum number of results to return on searches"""),
)
conf.registerChannelValue(
    Tweety,
Exemple #11
0
conf.registerChannelValue(
    Karma, 'simpleOutput',
    registry.Boolean(
        False,
        _("""Determines whether the bot will output shorter
    versions of the karma output when requesting a single thing's karma.""")))
conf.registerChannelValue(
    Karma, 'response',
    registry.Boolean(
        False,
        _("""Determines whether the bot will reply with a
    success message when something's karma is increased or decreased.""")))
conf.registerChannelValue(
    Karma, 'rankingDisplay',
    registry.Integer(
        3,
        _("""Determines how many highest/lowest karma things
    are shown when karma is called with no arguments.""")))
conf.registerChannelValue(
    Karma, 'mostDisplay',
    registry.Integer(
        25,
        _("""Determines how many karma things are shown when
    the most command is called.""")))
conf.registerChannelValue(
    Karma, 'allowSelfRating',
    registry.Boolean(
        False,
        _("""Determines whether users can adjust the karma
    of their nick.""")))
conf.registerChannelValue(
    Karma, 'allowUnaddressedKarma',
Exemple #12
0
    registry.String(
        '',
        _("""You shouldn't edit this configuration
        variable yourself, unless you know what you do. Use '@Github announce
        add' or '@Github announce remove' instead.""")))
conf.registerGlobalValue(
    GitHub.announces, 'secret',
    registry.SpaceSeparatedSetOfStrings(set(),
                                        _("""Set of space-separated
        secret payloads used to authenticate GitHub."""),
                                        private=True))
conf.registerChannelValue(
    GitHub, 'max_announce_commits',
    registry.Integer(
        3,
        _("""Determines the maximum number of commits that
        will be announced for a single push. Note that if the number of commits
        is only one over the limit, it will be announced anyway instead of
        saying "1 more commit".""")))

conf.registerGroup(GitHub, 'format')
conf.registerGroup(GitHub.format, 'before')
conf.registerChannelValue(
    GitHub.format.before, 'push',
    registry.String(
        '',
        _("""Format for an optional summary line before the individual commits
        in the push event.""")))

conf.registerChannelValue(GitHub.format, 'push',
        registry.String('echo ' +
        _('$repository__owner__name/\x02$repository__name\x02 '
Exemple #13
0
def configure(advanced):
    # This will be called by supybot to configure this module.  advanced is
    # a bool that specifies whether the user identified themself as an advanced
    # user or not.  You should effect your configuration by manipulating the
    # registry as appropriate.
    from supybot.questions import expect, anything, something, yn
    conf.registerPlugin('Cayenne', True)

Cayenne = conf.registerPlugin('Cayenne')

conf.registerChannelValue(Cayenne, 'enable',
                        registry.Boolean(True, _("""Turns on and off Cayenne.""")))

conf.registerGlobalValue(Cayenne, 'factChance',
                        registry.Integer(10, _("""0-100 chance to trigger a cat fact""")))

conf.registerGlobalValue(Cayenne, 'linkChance',
                        registry.Integer(10, _("""0-100 chance to trigger a link to a cat gif""")))

conf.registerGlobalValue(Cayenne, 'linkURL',
                        registry.String("http://edgecats.net/random", _("""URL to get cat gif links from""")))

conf.registerGlobalValue(Cayenne, 'throttleInSeconds',
                        registry.Integer(60, _("""Will only trigger if it has been X seconds since the last trigger""")))

conf.registerGlobalValue(Cayenne, 'triggerWords',
                        registry.CommaSeparatedListOfStrings(["meow","cat","aww","kitten","feline"], _("""List of words that may trigger facts or links""")))
         
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
Exemple #14
0
    registry.String(
        'nopunish',
        _("""If a user has this capability, they
    won't be punished by AttackProtector""")))
conf.registerGlobalValue(
    AttackProtector, 'kickmessage',
    registry.String(
        _('$kind flood detected'),
        _("""The kick message used
    when a user abuses the channel. $kind will be replaced with the kind
    of attack.""")))
conf.registerGlobalValue(
    AttackProtector, 'delay',
    registry.Integer(
        10,
        _("""Determines how long (in seconds) the plugin will
    wait before being enabled. A too low value makes the bot believe that
    its incoming messages 'flood' on connection is an attack.""")))

kinds = {
    'join': ['5p10', 'ban', ''],
    'knock': ['5p20', 'mode+K', ''],
    'part': ['4p5', 'ban', ''],
    'nick': ['7p300', 'ban', ''],
    'message': ['10p20', 'kick', ''],
    'kicked': ['5p60', 'kban',
               _('user has been kicked multiple times')],
    'groupjoin': ['20p10', 'mode+i', ''],
    'groupknock': ['7p20', 'mode+K', ''],
    'grouppart': ['20p10', 'mode+i', ''],
    'groupnick': ['20p10', 'mode+N', ''],
Exemple #15
0
conf.registerGlobalValue(
    ChannelLogger.directories, 'network',
    registry.Boolean(
        True, """Determines whether the bot will use a network
    directory if using directories."""))
conf.registerGlobalValue(
    ChannelLogger.directories, 'channel',
    registry.Boolean(
        True, """Determines whether the bot will use a channel
    directory if using directories."""))
conf.registerGlobalValue(
    ChannelLogger.directories, 'timestamp',
    registry.Boolean(
        False, """Determines whether the bot will use a timestamp
    (determined by supybot.plugins.ChannelLogger.directories.timestamp.format)
    if using directories."""))
conf.registerGlobalValue(
    ChannelLogger.directories.timestamp, 'format',
    registry.String(
        '%B', """Determines what timestamp format will be used in
    the directory stucture for channel logs if
    supybot.plugins.ChannelLogger.directories.timestamp is True."""))
conf.registerGlobalValue(
    ChannelLogger, 'lineslimit',
    registry.Integer('', """The number of lines before the bot will spam"""))
conf.registerGlobalValue(
    ChannelLogger, 'spammsg',
    registry.String('', """The message to spam the channel with"""))

# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
Exemple #16
0
def configure(advanced):
    # This will be called by supybot to configure this module.  advanced is
    # a bool that specifies whether the user identified himself as an advanced
    # user or not.  You should effect your configuration by manipulating the
    # registry as appropriate.
    from supybot.questions import expect, anything, something, yn
    conf.registerPlugin('Hubie', True)


Hubie = conf.registerPlugin('Hubie')
# This is where your configuration variables (if any) should go.  For example:
# conf.registerGlobalValue(Hubie, 'someConfigVariableName',
#     registry.Boolean(False, """Help for someConfigVariableName."""))

conf.registerChannelValue(
    Hubie, 'port', registry.Integer(8880, """The port on which Hubie runs."""))

# it is probably a good idea to really obfuscate your urls. Though it is also
# probably a good idea to use iptables or some firewall tools to limit access
# to the server on which you run this application.

# The pathmaps value below is a paired entry represented by the first entry,
# the uri or 'path' which will be appended to your host. The second entry will
# be the channel to which the messages will be sent. In the example below, if
# you posted json data to http://yourhost:8880/saltstack, whatever json you
# posted would be parsed and the resulting message would be displayed in the
# #salt-devel channel (assuming your bot was configured to connect to that
# channel).

conf.registerChannelValue(
    Hubie, 'pathmaps',
Exemple #17
0
    # registry as appropriate.
    from supybot.questions import expect, anything, something, yn
    conf.registerPlugin('GoodFrench', True)


GoodFrench = conf.registerPlugin('GoodFrench')
# This is where your configuration variables (if any) should go.  For example:
# conf.registerGlobalValue(GoodFrench, 'someConfigVariableName',
#     registry.Boolean(False, _("""Help for someConfigVariableName.""")))
conf.registerChannelValue(
    GoodFrench, 'kick',
    registry.Boolean(
        False, """Détermine si un utilisateur faisant une faute
    de Français sera kické (au lieu de recevoir un avertissement)."""))
conf.registerChannelValue(
    GoodFrench, 'level',
    registry.Integer(
        0, """Le niveau de filtrage. Le niveau N filtre
    ce que le niveau N-1 filtrait, avec des choses en plus.
    0 : pas de filtrage ;
    1 : filtre le langage SMS
    2 : filtre les erreurs de pluriel ;
    3 : filtre les fautes de conjugaison courantes ;
    4 : filtre les fautes d'orthographe courantes ;
    5 : filtre les abbréviations ("t'as" au lieu de "tu as") ;
    6 : filtre les 'lol'
    7 : filtre les erreurs de typographie (note : a tendance à avoir la
    gachette facile)"""))

# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
    # a bool that specifies whether the user identified himself as an advanced
    # user or not.  You should effect your configuration by manipulating the
    # registry as appropriate.
    from supybot.questions import expect, anything, something, yn
    conf.registerPlugin('DuckHunt', True)


DuckHunt = conf.registerPlugin('DuckHunt')
# This is where your configuration variables (if any) should go.  For example:
# conf.registerGlobalValue(Quote, 'someConfigVariableName',
#     registry.Boolean(False, """Help for someConfigVariableName."""))
conf.registerChannelValue(DuckHunt, 'autoRestart',
     registry.Boolean(False, """Does a new hunt automatically start when the previous one is over?"""))

conf.registerChannelValue(DuckHunt, 'ducks',
     registry.Integer(5, """Number of ducks during a hunt?"""))

conf.registerChannelValue(DuckHunt, 'minthrottle', 
     registry.Integer(30, """The minimum amount of time before a new duck may be launched (in seconds)"""))

conf.registerChannelValue(DuckHunt, 'maxthrottle', 
     registry.Integer(300, """The maximum amount of time before a new duck may be launched (in seconds)"""))

conf.registerChannelValue(DuckHunt, 'reloadTime', 
     registry.Integer(5, """The time it takes to reload your rifle once you have shot (in seconds)"""))

conf.registerChannelValue(DuckHunt, 'missProbability', 
     registry.Probability(0.2, """The probability to miss the duck"""))

conf.registerChannelValue(DuckHunt, 'kickMode',
     registry.Boolean(False, """If someone shoots when there is no duck, should he be kicked from the channel? (this requires the bot to be op on the channel)"""))
Exemple #19
0
        """Show all vowels on the third hint. If false, random letters will be shown instead"""
    ))

conf.registerChannelValue(
    TriviaTime.general, 'showStats',
    registry.Boolean(True, """Show player stats after correct answer?"""))

conf.registerChannelValue(
    TriviaTime.skip, 'skipThreshold',
    registry.Float(
        .5, """Percentage of active players who need to vote to skip"""))

conf.registerChannelValue(
    TriviaTime.skip, 'skipActiveTime',
    registry.Integer((
        10 * 60
    ), """Amount of time a user is considered active after answering a question"""
                     ))

conf.registerChannelValue(
    TriviaTime.skip, 'skipTime',
    registry.Integer(
        90,
        """Time a user must wait to skip a question again after skipping in seconds"""
    ))

conf.registerChannelValue(TriviaTime.questions, 'hintTime',
                          registry.Integer(10, """Time in between hints"""))

conf.registerChannelValue(TriviaTime.kaos, 'hintKAOS',
                          registry.Integer(15, """Time in between hints"""))
def configure(advanced):
    # This will be called by supybot to configure this module.  advanced is
    # a bool that specifies whether the user identified himself as an advanced
    # user or not.  You should effect your configuration by manipulating the
    # registry as appropriate.
    from supybot.questions import expect, anything, something, yn
    conf.registerPlugin('RatingSystem', True)


RatingSystem = conf.registerPlugin('RatingSystem')

conf.registerGlobalValue(
    RatingSystem, 'requirePositiveRating',
    registry.Boolean(
        True, """Only allow users with a positive rating to enter
    ratings."""))

conf.registerGlobalValue(
    RatingSystem, 'ratingMax',
    registry.PositiveInteger(
        10, """Maximum possible trust rating that can be
    given to a user."""))

conf.registerGlobalValue(
    RatingSystem, 'ratingMin',
    registry.Integer(
        -10, """Minimum possible trust rating that can be
    given to a user."""))

# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
Exemple #21
0

SupySnap = conf.registerPlugin('SupySnap')
# This is where your configuration variables (if any) should go.  For example:
# conf.registerGlobalValue(SupySnap, 'someConfigVariableName',
#     registry.Boolean(False, _("""Help for someConfigVariableName.""")))
conf.registerChannelValue(SupySnap, 'username',
                          registry.String('', """SnapChat username."""))
conf.registerChannelValue(
    SupySnap, 'password',
    registry.String('', """SnapChat password.""", private=True))
conf.registerChannelValue(
    SupySnap, 'address',
    registry.String('',
                    """Address to where the images will be made available."""))
conf.registerChannelValue(
    SupySnap, 'localpath',
    registry.String('',
                    """Local path to where the images will be stored.""",
                    private=True))
conf.registerChannelValue(
    SupySnap, 'interval',
    registry.Integer(60, """Interval between each check, in seconds."""))
conf.registerChannelValue(
    SupySnap, 'markasread',
    registry.Boolean(
        True,
        """If posted snaps should be marked as read. If they are marked as read they will not be available for download again."""
    ))
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
Exemple #22
0
    validStrings = ('cse', 'legacy')

GoogleCSE = conf.registerPlugin('GoogleCSE')
# This is where your configuration variables (if any) should go.  For example:
# conf.registerGlobalValue(GoogleCSE, 'someConfigVariableName',
#     registry.Boolean(False, _("""Help for someConfigVariableName.""")))
conf.registerGlobalValue(GoogleCSE, 'apikey',
    registry.String('', _("""API key provided by google for API access"""),
        private=True))
conf.registerGlobalValue(GoogleCSE, 'engines',
    registry.CommaSeparatedListOfStrings('', _("""List of available Custom
        Search Engines.""")))
conf.registerChannelValue(GoogleCSE, 'defaultEngine',
    registry.String('', _("""Default Custom Search Engine for channel."""),
        private=True))
conf.registerChannelValue(GoogleCSE, 'maxPageResults',
    registry.Integer(10, _("""Maximum number of page results to fetch.""")))
conf.registerChannelValue(GoogleCSE, 'maxPages',
    registry.Integer(1, _("""Maximum number of page results to fetch.""")))
conf.registerChannelValue(GoogleCSE, 'maxDisplayResults',
    registry.Integer(5, _("""Maximum number of page results to display.""")))
conf.registerChannelValue(GoogleCSE, 'includeSnippet',
    registry.Boolean(False, _("""Display search result snippet in the output.""")))
conf.registerChannelValue(GoogleCSE, 'safeLevel',
    SafeLevels('medium', _("""Search results safe level. Default: medium.""")))
conf.registerChannelValue(GoogleCSE, 'engineAPI',
    EngineAPI('cse', _("""Select google engine mode. \"legacy\" sets the
    old google API \"cse\" sets the latest CSE API. Default: cse.""")))

# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
Exemple #23
0
    registry.Boolean(
        False, """Determines whether the bot will list the 
    publication datetime stamp along with the title of the feed when the rss
    command is called.
    supybot.plugins.RSS.announce.showPubDate affects whether this will be
    listed when a feed is automatically announced."""))
conf.registerGlobalValue(
    RSS, 'defaultNumberOfHeadlines',
    registry.PositiveInteger(
        1,
        _("""Indicates how many headlines an rss feed
    will output by default, if no number is provided.""")))
conf.registerChannelValue(
    RSS, 'initialAnnounceHeadlines',
    registry.Integer(
        5,
        _("""Indicates how many headlines an rss feed
    will output when it is first added to announce for a channel.""")))
conf.registerChannelValue(
    RSS, 'keywordWhitelist',
    registry.SpaceSeparatedSetOfStrings([],
                                        _("""Space separated list of 
    strings, lets you filter headlines to those containing one or more items
    in this whitelist.""")))
conf.registerChannelValue(
    RSS, 'keywordBlacklist',
    registry.SpaceSeparatedSetOfStrings([],
                                        _("""Space separated list of 
    strings, lets you filter headlines to those not containing any items
    in this blacklist.""")))

conf.registerGroup(RSS, 'announce')
Exemple #24
0
#     registry.Boolean(False, """Help for someConfigVariableName."""))

conf.registerGroup(MegaHAL, 'learn')
conf.registerGlobalValue(
    MegaHAL.learn, 'commands',
    registry.Boolean(
        False,
        _("""Determines whether the bot answers to messages
    beginning by a non-alphanumeric char.""")))
conf.registerGroup(MegaHAL, 'answer')
conf.registerChannelValue(
    MegaHAL.answer, 'commands',
    registry.Boolean(
        False,
        _("""Determines whether messages beginning by a
    non-alphanumeric char are learned.""")))
conf.registerChannelValue(
    MegaHAL.answer, 'probability',
    registry.Integer(
        10,
        _("""Determines the percent of messages the bot will
    answer (zero is recommended if you have a tiny database).""")))
conf.registerChannelValue(
    MegaHAL.answer, 'probabilityWhenAddressed',
    registry.Integer(
        100,
        _("""Determines the percent of messages adressed to
    the bot the bot will answer.""")))

# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
Exemple #25
0
        _("""Determines whether the bot will reply to invalid
    commands by searching for a factoid; basically making the whatis
    unnecessary when you want all factoids for a given key.""")))
conf.registerChannelValue(
    Factoids, 'replyApproximateSearchKeys',
    registry.Boolean(
        True,
        _("""If you try to look up a nonexistent factoid,
    this setting make the bot try to find some possible matching keys through
    several approximate matching algorithms and return a list of matching keys,
    before giving up.""")))
conf.registerChannelValue(
    Factoids, 'format',
    FactoidFormat(
        _('$value'),
        _("""Determines the format of
    the response given when a factoid's value is requested.  All the standard
    substitutes apply, in addition to "$key" for the factoid's key and "$value"
    for the factoid's value.""")))
conf.registerChannelValue(
    Factoids, 'keepRankInfo',
    registry.Boolean(
        True, """Determines whether we keep updating the usage
    count for each factoid, for popularity ranking."""))
conf.registerChannelValue(
    Factoids, 'rankListLength',
    registry.Integer(
        20, """Determines the number of factoid keys returned
    by the factrank command."""))
# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
Exemple #26
0
        False, """Determines whether the bot will kick people with
    a warning when they use bad words."""))
conf.registerChannelValue(
    BadWords.kick, 'message',
    registry.NormalizedString(
        """You have been kicked for using a word
    prohibited in the presence of this bot.  Please use more appropriate
    language in the future.""", """Determines the kick message used by the bot
    when kicking users for saying bad words."""))

conf.registerChannelValue(
    BadWords, 'kickban',
    registry.Boolean(
        False, """Determines whether the bot will kickban people with
    a warning when they use bad words."""))
conf.registerChannelValue(
    BadWords.kickban, 'message',
    registry.NormalizedString(
        """You have been kicked for using a word
    prohibited in the presence of this bot.  Please use more appropriate
    language in the future.""", """Determines the kick message used by the bot
    when kicking users for saying bad words."""))

conf.registerChannelValue(
    BadWords.kickban, 'banexpire',
    registry.Integer(
        0, """How long a ban should last for BadWords
    kickban."""))

# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
Exemple #27
0
except:
    # This are useless functions that's allow to run the plugin on a bot
    # without the i18n plugin
    _ = lambda x: x
    internationalizeDocstring = lambda x: x


def configure(advanced):
    # This will be called by supybot to configure this module.  advanced is
    # a bool that specifies whether the user identified himself as an advanced
    # user or not.  You should effect your configuration by manipulating the
    # registry as appropriate.
    from supybot.questions import expect, anything, something, yn
    conf.registerPlugin('FortyTwo', True)


FortyTwo = conf.registerPlugin('FortyTwo')
# This is where your configuration variables (if any) should go.  For example:
# conf.registerGlobalValue(FortyTwo, 'someConfigVariableName',
#     registry.Boolean(False, _("""Help for someConfigVariableName.""")))
conf.registerGlobalValue(
    FortyTwo, 'lifetime',
    registry.Integer(60, _("""Defines the cache lifetime (in seconds).""")))

conf.registerGlobalValue(
    FortyTwo, 'source',
    registry.String('http://search.42/domains.xml',
                    _("""Defines where the XML data file is.""")))

# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
Exemple #28
0

def configure(advanced):
    # This will be called by supybot to configure this module.  advanced is
    # a bool that specifies whether the user identified themself as an advanced
    # user or not.  You should effect your configuration by manipulating the
    # registry as appropriate.
    from supybot.questions import expect, anything, something, yn
    conf.registerPlugin('SpiffyTitles', True)


SpiffyTitles = conf.registerPlugin('SpiffyTitles')

conf.registerGlobalValue(
    SpiffyTitles, 'maxRetries',
    registry.Integer(3, _("""Maximum retries upon failure""")))

conf.registerGlobalValue(
    SpiffyTitles, 'wallClockTimeoutInSeconds',
    registry.Integer(
        8,
        _("""Timeout for getting a title. If you set this too high, the bot will time out."""
          )))

# Language
conf.registerGlobalValue(SpiffyTitles, 'language',
                         registry.String("en-US", _("""Language code""")))

# imdb template
conf.registerGlobalValue(
    SpiffyTitles, 'imdbTemplate',
Exemple #29
0
#     registry.Boolean(False, """Help for someConfigVariableName."""))
conf.registerChannelValue(
    MessageParser, 'enable',
    registry.Boolean(
        True, """Determines whether the
    message parser is enabled.  If enabled, will trigger on regexps
    added to the regexp db."""))
conf.registerChannelValue(
    MessageParser, 'keepRankInfo',
    registry.Boolean(
        True, """Determines whether we keep updating the usage
    count for each regexp, for popularity ranking."""))
conf.registerChannelValue(
    MessageParser, 'rankListLength',
    registry.Integer(
        20, """Determines the number of regexps returned
    by the triggerrank command."""))
conf.registerChannelValue(
    MessageParser, 'requireVacuumCapability',
    registry.String(
        'admin', """Determines the capability required (if any) to 
    vacuum the database."""))
conf.registerChannelValue(
    MessageParser, 'requireManageCapability',
    registry.String(
        'admin; channel,op', """Determines the 
    capabilities required (if any) to manage the regexp database,
    including add, remove, lock, unlock. Use 'channel,capab' for 
    channel-level capabilities.
    Note that absence of an explicit anticapability means user has 
    capability."""))
Exemple #30
0
def configure(advanced):
    # This will be called by supybot to configure this module.  advanced is
    # a bool that specifies whether the user identified themself as an advanced
    # user or not.  You should effect your configuration by manipulating the
    # registry as appropriate.
    from supybot.questions import expect, anything, something, yn

    conf.registerPlugin("SpiffyTitles", True)


SpiffyTitles = conf.registerPlugin("SpiffyTitles")

conf.registerGlobalValue(
    SpiffyTitles,
    "maxRetries",
    registry.Integer(3, _("""Maximum retries upon failure""")),
)

conf.registerGlobalValue(
    SpiffyTitles,
    "timeout",
    registry.Integer(
        10, _("""Maximum time in seconds to try and retrieve a link""")),
)

# URL regex
conf.registerChannelValue(
    SpiffyTitles,
    "urlRegexp",
    registry.String(
        r"",