Exemple #1
0
def registerNick(nick, password=''):
    p = conf.supybot.plugins.Services.Nickserv.get('password')
    h = _('Determines what password the bot will use with NickServ when ' \
        'identifying as %s.') % nick
    v = conf.registerNetworkValue(p, nick,
                                  registry.String(password, h, private=True))
    if password:
        v.setValue(password)
Exemple #2
0
class ValidNickOrEmptyString(registry.String):
    def setValue(self, v):
        if v and not ircutils.isNick(v):
            raise registry.InvalidRegistryValue(
                'Value must be a valid nick or the empty string.')
        registry.String.setValue(self, v)


class ValidNickSet(conf.ValidNicks):
    List = ircutils.IrcSet


Services = conf.registerPlugin('Services')
conf.registerNetworkValue(
    Services, 'nicks',
    ValidNickSet([],
                 _("""Determines what nicks the bot will use with
    services.""")))


class Networks(registry.SpaceSeparatedSetOfStrings):
    List = ircutils.IrcSet


conf.registerGlobalValue(
    Services, 'disabledNetworks',
    Networks(
        _('QuakeNet').split(),
        _("""Determines what networks this plugin
    will be disabled on.""")))
Exemple #3
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('Redditt', True)


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

conf.registerNetworkValue(Redditt, 'client_id',
    registry.string("", _("""Guide to obtaining credentials can be found at
        https://praw.readthedocs.io/en/latest/getting_started/authentication.html""")))

conf.registerNetworkValue(Redditt, 'client_secret',
    registry.string("", _("""Guide to obtaining credentials can be found at
        https://praw.readthedocs.io/en/latest/getting_started/authentication.html""")))

conf.registerNetworkValue(Redditt, 'username',
    registry.string("", _("""Guide to obtaining credentials can be found at
        https://praw.readthedocs.io/en/latest/getting_started/authentication.html""")))

conf.registerNetworkValue(Redditt, 'password',
    registry.string("", _("""Guide to obtaining credentials can be found at
        https://praw.readthedocs.io/en/latest/getting_started/authentication.html""")))

conf.registerNetworkValue(Redditt, 'user_agent',
Exemple #4
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('Ombi', True)


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

conf.registerNetworkValue(
    Ombi, 'UseSSL',
    registry.Boolean(True, """ Is it configured to use SSL""", private=True))

conf.registerNetworkValue(
    Ombi, 'Host',
    registry.string('',
                    """ Enter the IP address for Ombi listener""",
                    private=True))

conf.registerNetworkValue(
    Ombi, 'Port',
    registry.string('', """ Enter the port for Ombi listener""", private=True))

conf.registerNetworkValue(
    Ombi, 'UrlBase',
    registry.string(
Exemple #5
0
class Targets(registry.SpaceSeparatedListOfStrings):
    Value = ValidChannelOrNick


conf.registerPlugin('LogToIrc')
conf.registerChannelValue(conf.supybot.plugins.LogToIrc,
                          'level',
                          IrcLogLevel(
                              logging.WARNING,
                              """Determines what the minimum priority
    level logged will be to IRC. See supybot.log.level for possible
    values.  DEBUG is disabled due to the large quantity of output."""),
                          opSettable=False)
conf.registerNetworkValue(
    conf.supybot.plugins.LogToIrc, 'targets',
    Targets([], """Space-separated list of channels/nicks the bot should
    log to.  If no channels/nicks are set, this plugin will effectively be
    turned off."""))
conf.registerGlobalValue(
    conf.supybot.plugins.LogToIrc, 'networks',
    registry.SpaceSeparatedSetOfStrings([], """Determines what networks the
    bot should log to.  If no networks are set, the bot will log on one network
    (whichever happens to be around at the time it feels like logging)."""))
conf.registerNetworkValue(
    conf.supybot.plugins.LogToIrc, 'channelModesRequired',
    registry.String(
        's', """Determines what channel modes a channel will be
    required to have for the bot to log to the channel.  If this string is
    empty, no modes will be checked."""))
conf.registerGlobalValue(
    conf.supybot.plugins.LogToIrc, 'userCapabilityRequired',