Beispiel #1
0
NoLatin1 = conf.registerPlugin('NoLatin1')
# This is where your configuration variables (if any) should go.  For example:
# conf.registerGlobalValue(NoLatin1, 'someConfigVariableName',
#     registry.Boolean(False, _("""Help for someConfigVariableName.""")))
conf.registerChannelValue(
    NoLatin1, 'enable',
    registry.Boolean(
        False,
        _("""Determines whether or not the bot will
        notice chatters they have to use Unicode instead of Latin-1.""")))
conf.registerChannelValue(
    NoLatin1, 'remember',
    registry.Integer(
        3600,
        _("""After this time (in seconds), the number
        of warnings will be reset.""")))
conf.registerChannelValue(
    NoLatin1, 'maxWarningsBeforeAlert',
    registry.Integer(
        5,
        _("""After a certain number of warning, the bot
        will call someone (defined in supybot.plugins.NoLatin1.operator)""")))
conf.registerChannelValue(
    NoLatin1, 'operator',
    registry.String(
        'KwisatzHaderach',
        _("""The person the bot will alert
        when a user insists in using Latin-1""")))

# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
Beispiel #2
0
import supybot.conf as conf
import supybot.registry as registry
from supybot.i18n import PluginInternationalization, internationalizeDocstring
_ = PluginInternationalization('User')


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('User', True)


User = conf.registerPlugin('User')
conf.registerChannelValue(
    User, 'listInPrivate',
    registry.Boolean(
        True,
        _("""Determines whether the output of 'user list'
    will be sent in private. This prevents mass-highlights of people who use
    their nick as their bot username.""")))
conf.registerGlobalValue(
    User, 'customWhoamiError',
    registry.String(
        "",
        _("""Determines what message the bot sends
    when a user isn't identified or recognized.""")))
# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
Beispiel #3
0
    def splitter(self, s):
        return re.split(r'\s*,\s*', s)

    joiner = ', '.join


MarketMonitorTicker = conf.registerPlugin('MarketMonitorTicker')

conf.registerGlobalValue(
    MarketMonitorTicker, 'channels',
    CommaSeparatedListOfChannels(
        "", """List of channels that should
    receive monitoring output."""))
conf.registerGlobalValue(
    MarketMonitorTicker, 'network',
    registry.String("freenode", """Network that should
    receive monitoring output."""))
conf.registerGlobalValue(
    MarketMonitorTicker, 'tickerUrl',
    registry.String("https://mtgox.com/code/ticker.php", """Url with 
    the ticker data."""))
conf.registerGlobalValue(
    MarketMonitorTicker, 'autostart',
    registry.Boolean(
        False, """If true, will autostart monitoring upon bot
    startup."""))
conf.registerGlobalValue(
    MarketMonitorTicker, 'pollInterval',
    registry.PositiveInteger(30, """Poll interval, in seconds."""))

#conf.registerGlobalValue(MarketMonitorTicker, 'colors',
#    registry.Boolean(False, """If true, upticks will be green and downticks
Beispiel #4
0
    conf.registerPlugin('Sigyn', True)


Sigyn = conf.registerPlugin('Sigyn')

conf.registerGlobalValue(
    Sigyn, 'enable',
    registry.Boolean(
        False,
        """set to True to enable kill and klines, otherwise bot will only report to logChannel"""
    ))

conf.registerGlobalValue(
    Sigyn, 'mainChannel',
    registry.String(
        "#freenode",
        """main channel, where bot stay opped and op staffer on +z"""))

conf.registerGlobalValue(
    Sigyn, 'snoopChannel',
    registry.String("", """channel where services stuff are announced"""))

conf.registerGlobalValue(
    Sigyn, 'mxbl',
    registry.CommaSeparatedListOfStrings([''], """patterns to match"""))

conf.registerGlobalValue(
    Sigyn, 'wordsList',
    registry.CommaSeparatedListOfStrings(
        [''], """paths of files contains one word per line"""))
conf.registerGlobalValue(
Beispiel #5
0
        return s

class NumSearchResults(registry.PositiveInteger):
    """Value must be 1 <= n <= 8"""
    def setValue(self, v):
        if v > 8:
            self.error()
        super(self.__class__, self).setValue(v)

class SafeSearch(registry.OnlySomeStrings):
    validStrings = ['active', 'moderate', 'off']

Google = conf.registerPlugin('Google')
conf.registerGlobalValue(Google, 'referer',
    registry.String('', _("""Determines the URL that will be sent to Google for
    the Referer field of the search requests.  If this value is empty, a
    Referer will be generated in the following format:
    http://$server/$botName""")))
conf.registerChannelValue(Google, 'baseUrl',
    registry.String('google.com', _("""Determines the base URL used for
    requests.""")))
conf.registerChannelValue(Google, 'searchSnarfer',
    registry.Boolean(False, _("""Determines whether the search snarfer is
    enabled.  If so, messages (even unaddressed ones) beginning with the word
    'google' will result in the first URL Google returns being sent to the
    channel.""")))
conf.registerChannelValue(Google, 'colorfulFilter',
    registry.Boolean(False, _("""Determines whether the word 'google' in the
    bot's output will be made colorful (like Google's logo).""")))
conf.registerChannelValue(Google, 'bold',
    registry.Boolean(True, _("""Determines whether results are bolded.""")))
conf.registerChannelValue(Google, 'oneToOne',
Beispiel #6
0
    conf.registerPlugin("WorldTime", True)


WorldTime = conf.registerPlugin("WorldTime")
# This is where your configuration variables (if any) should go.  For example:
conf.registerChannelValue(
    WorldTime,
    "disableANSI",
    registry.Boolean(
        False,
        _("""Disable color/bolding for WorldTime output in channel.""")),
)
conf.registerChannelValue(
    WorldTime,
    "format",
    registry.String(
        "%a, %H:%M",
        _("""Sets the output time format (using an strftime-formatted string)."""
          ),
    ),
)
conf.registerGlobalValue(
    WorldTime,
    "mapsAPIkey",
    registry.String("",
                    """Sets the Google Maps Places API key""",
                    private=True),
)

# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
Beispiel #7
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('Herald', True)


Herald = conf.registerPlugin('Herald')
conf.registerChannelValue(Herald, 'heralding',
    registry.Boolean(True, _("""Determines whether messages will be sent to the
    channel when a recognized user joins; basically enables or disables the
    plugin.""")))
conf.registerGlobalValue(Herald, 'requireCapability',
    registry.String('', _("""Determines what capability (if any) is required to
    add/change/remove the herald of another user.""")))
conf.registerChannelValue(Herald, 'throttle',
    registry.PositiveInteger(600, _("""Determines the minimum number of seconds
    between heralds.""")))
conf.registerChannelValue(Herald.throttle, 'afterPart',
    registry.NonNegativeInteger(0, _("""Determines the minimum number of seconds
    after parting that the bot will not herald the person when he or she
    rejoins.""")))
conf.registerChannelValue(Herald.throttle, 'afterSplit',
    registry.NonNegativeInteger(60, _("""Determines the minimum number of seconds
    after a netsplit that the bot will not herald the users that split.""")))
conf.registerChannelValue(Herald, 'default',
    registry.String('', _("""Sets the default herald to use.  If a user has a
    personal herald specified, that will be used instead.  If set to the empty
    string, the default herald will be disabled.""")))
conf.registerChannelValue(Herald.default, 'notice',
Beispiel #8
0
    # user or not.  You should effect your configuration by manipulating the
    # registry as appropriate.
    from supybot.questions import expect, anything, something, yn

    conf.registerPlugin("IMDb", True)


IMDb = conf.registerPlugin("IMDb")

conf.registerChannelValue(
    IMDb,
    "template",
    registry.String(
        "$logo :: $title ($year, $country, [$rated], $genre, $runtime) "
        ":: IMDb: $imdbRating | MC: $metascore | RT: $tomatoMeter :: "
        "http://imdb.com/title/$imdbID :: $plot :: Director: $director :: "
        "Cast: $actors :: Writer: $writer",
        _("""IMDb reply template."""),
    ),
)

conf.registerChannelValue(
    IMDb,
    "logo",
    registry.String("\x02\x031,8 IMDb \x0F",
                    _("""Logo used with {{logo}} in template""")),
)

conf.registerChannelValue(
    IMDb,
    "noResultsMessage",
Beispiel #9
0
# Config groups
conf.registerGroup(TriviaTime, 'kaos')
conf.registerGroup(TriviaTime, 'admin')
conf.registerGroup(TriviaTime, 'questions')
conf.registerGroup(TriviaTime, 'general')
conf.registerGroup(TriviaTime, 'commands')
conf.registerGroup(TriviaTime, 'voice')
conf.registerGroup(TriviaTime, 'skip')
conf.registerGroup(TriviaTime, 'hints')

# CONFIGURATION
# file locations for database and question
conf.registerChannelValue(
    TriviaTime.admin, 'db',
    registry.String("""plugins/TriviaTime/storage/db/trivia.db""",
                    """Location of sqlite database file"""))

conf.registerChannelValue(
    TriviaTime.admin, 'file',
    registry.String(
        """plugins/TriviaTime/storage/questions""",
        """Location of question file. Reload the plugin if changed."""))

# timeout, number of hints, values
conf.registerChannelValue(
    TriviaTime.commands, 'extraHint',
    registry.NormalizedString(
        """~""", """The command to show extra hints and remaining KAOS"""))

conf.registerChannelValue(
    TriviaTime.general, 'logGames',
Beispiel #10
0
    # registry as appropriate.
    ### from supybot.questions import expect, anything, something, yn
    conf.registerPlugin('Irccat', True)


def global_option(option):
    ''' Return a overall plugin option (registered at load time). '''
    return conf.supybot.plugins.get('irccat').get(option)


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

Irccat = conf.registerPlugin('Irccat')

conf.registerGlobalValue(Irccat, 'sectionspath',
    registry.String('sections.pickle', 'Pickled section data'))

conf.registerGlobalValue(Irccat, 'port',
    registry.NonNegativeInteger(12345,
                                "The TCP port irccat will listen to."))

conf.registerGlobalValue(Irccat, 'privmsg',
    registry.Boolean(False, 'Use privmsgs instead of the default notices'))

conf.registerGlobalValue(Irccat, 'topicRegex',
    registry.String('', 'String to replace in channel topic (disables privmsgs/notices)'))

# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
Beispiel #11
0
# POSSIBILITY OF SUCH DAMAGE.
###

import supybot.conf as conf
import supybot.registry as registry


def configure(advanced):
    from supybot.questions import output, expect, anything, something, yn
    conf.registerPlugin('Dict', True)
    output('The default dictd server is dict.org.')
    if yn('Would you like to specify a different dictd server?'):
        server = something('What server?')
        conf.supybot.plugins.Dict.server.set(server)


Dict = conf.registerPlugin('Dict')
conf.registerGlobalValue(
    Dict, 'server',
    registry.String(
        'dict.org', """Determines what server the bot will
    retrieve definitions from."""))
conf.registerChannelValue(
    Dict, 'default',
    registry.String(
        '', """Determines the default dictionary the bot will
    ask for definitions in.  If this value is '*' (without the quotes) the bot
    will use all dictionaries to define words."""))

# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
Beispiel #12
0
        '$topic',
        _("""Determines what format is used to add
    topics in the topic.  All the standard substitutes apply, in addition to
    "$topic" for the topic itself.""")))
conf.registerChannelValue(
    Topic, 'recognizeTopiclen',
    registry.Boolean(
        True,
        _("""Determines whether the bot will recognize the
    TOPICLEN value sent to it by the server and thus refuse to send TOPICs
    longer than the TOPICLEN.  These topics are likely to be truncated by the
    server anyway, so this defaults to True.""")))
conf.registerChannelValue(
    Topic, 'default',
    registry.String(
        '',
        _("""Determines what the default topic for the channel
    is.  This is used by the default command to set this topic.""")))
conf.registerChannelValue(
    Topic, 'setOnJoin',
    registry.Boolean(
        True,
        _("""Determines whether the bot will automatically
    set the topic on join if it is empty.""")))
conf.registerChannelValue(
    Topic, 'alwaysSetOnJoin',
    registry.Boolean(
        False,
        _("""Determines whether the bot will set the topic
    every time it joins, or only if the topic is empty. Requires 'config
    plugins.topic.setOnJoin' to be set to True.""")))
conf.registerGroup(Topic, 'undo')
Beispiel #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 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('EVESpai', True)


EVESpai = conf.registerPlugin('EVESpai')
# This is where your configuration variables (if any) should go.  For example:
# conf.registerGlobalValue(EVESpai, 'someConfigVariableName',
#     registry.Boolean(False, """Help for someConfigVariableName."""))
conf.registerGlobalValue(EVESpai, 'stationspinner_host',
                         registry.String('localhost', 'Database IP or \
                         hostname'))
conf.registerGlobalValue(EVESpai, 'stationspinner_port',
                         registry.String('5432', 'Database port'))
conf.registerGlobalValue(EVESpai, 'stationspinner_database',
                         registry.String('stationspinner', 'Database name'))
conf.registerGlobalValue(EVESpai, 'stationspinner_user',
                         registry.String('stationspinner_read', 'Database \
                         username'))
conf.registerGlobalValue(EVESpai, 'stationspinner_password',
                         registry.String('stationspinner', 'Database \
                         user password'))
conf.registerGlobalValue(EVESpai, 'sde_host',
                         registry.String('localhost', 'Database IP or \
                         hostname'))
conf.registerGlobalValue(EVESpai, 'sde_port',
                         registry.String('5432', 'Database port'))
Beispiel #14
0
import supybot.conf as conf
import supybot.registry as registry
try:
    from supybot.i18n import PluginInternationalization
    _ = PluginInternationalization('Ericpedia')
except:
    # Placeholder that allows to run the plugin on a bot
    # without the i18n module
    _ = 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 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('Ericpedia', True)


Ericpedia = conf.registerPlugin('Ericpedia')
# This is where your configuration variables (if any) should go.  For example:
conf.registerChannelValue(Ericpedia, 'replaceString',
    registry.String("$nick", _("""Replaces random part of the title with this string or $nick for the nick of the person issuing the command.""")))

conf.registerChannelValue(Ericpedia, 'wikipediaRandomPageURL',
    registry.String("https://en.wikipedia.org/wiki/Special:Random", _("""URL used to find a random Wikipedia page""")))

# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
Beispiel #15
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('Wordgames', True)


Wordgames = conf.registerPlugin('Wordgames')

conf.registerGlobalValue(
    Wordgames, 'wordFile',
    registry.String('/usr/share/dict/american-english',
                    'Path to the dictionary file.'))

conf.registerGlobalValue(
    Wordgames, 'wordRegexp',
    registry.String(
        '^[a-z]+$', 'Regular expression defining what a valid word looks ' +
        'like (i.e. ignore proper names, contractions, etc. ' +
        'Modify this if you need to allow non-English chars.'))

conf.registerGlobalValue(
    Wordgames, 'worddleDelay',
    registry.NonNegativeInteger(
        15, 'Delay (in seconds) before a Worddle game ' + 'begins.'))

conf.registerGlobalValue(
    Wordgames, 'worddleDuration',
Beispiel #16
0
    # user or not.  You should effect your configuration by manipulating the
    # registry as appropriate.
    from supybot.questions import expect, anything, something, yn
    conf.registerPlugin('GitHub', True)


GitHub = conf.registerPlugin('GitHub')
# This is where your configuration variables (if any) should go.  For example:
# conf.registerGlobalValue(GitHub, 'someConfigVariableName',
#     registry.Boolean(False, _("""Help for someConfigVariableName.""")))
conf.registerGroup(GitHub, 'api')
conf.registerGlobalValue(
    GitHub.api, 'url',
    registry.String(
        'https://api.github.com',
        _("""The URL of the
        GitHub API to use. You probably don't need to edit it, but I let it
        there, just in case.""")))
conf.registerGlobalValue(
    GitHub, 'announces',
    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.registerGroup(GitHub, 'format')
conf.registerChannelValue(GitHub.format, 'push',
        registry.String(
        _('$repository__owner__name/\x02$repository__name\x02 '
        '(in \x02$ref__branch\x02): $__commit__author__name committed '
Beispiel #17
0
# 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.
###

import supybot.conf as conf
import supybot.registry as registry


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('Time', True)


Time = conf.registerPlugin('Time')
conf.registerChannelValue(
    Time, 'format',
    registry.String(
        str(conf.supybot.reply.format.time()), """Determines the
    format string for timestamps.  Refer to the Python documentation for the
    time module to see what formats are accepted. If you set this variable to
    the empty string, the timestamp will not be shown."""))

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

###

import supybot.conf as conf
import supybot.registry as registry


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('StockCN', True)


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

conf.registerGlobalValue(
    StockCN, 'encode',
    registry.String('gbk', """The charset used in the channels"""))

# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=200:
Beispiel #19
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('Wikipedia', True)


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

conf.registerChannelValue(
    Wikipedia, 'url',
    registry.String(
        _('en.wikipedia.org'),
        _("""URL of the website from
        where you want to pull pages (usually: your language's
        wikipedia)""")))
conf.registerChannelValue(
    Wikipedia, 'showRedirects',
    registry.Boolean(
        True,
        _("""Determines whether redirect paths will
        be shown in the output.)""")))

# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
Beispiel #20
0
    from supybot.i18n import PluginInternationalization

    _ = PluginInternationalization("AzuraCast")
except:
    # Placeholder that allows to run the plugin on a bot
    # without the i18n module
    _ = 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 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("AzuraCast", True)


AzuraCast = conf.registerPlugin("AzuraCast")
# This is where your configuration variables (if any) should go.  For example:
# conf.registerGlobalValue(AzuraCast, 'someConfigVariableName',
#     registry.Boolean(False, _("""Help for someConfigVariableName.""")))
conf.registerGlobalValue(AzuraCast, "AzuraAPI",
                         registry.String("", _("""AzuraCast local API URL""")))
conf.registerGlobalValue(
    AzuraCast, "PublicURL",
    registry.String("", _("""Public URL for your radio""")))

# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
Beispiel #21
0
    # Placeholder that allows to run the plugin on a bot
    # without the i18n module
    _ = 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("Geo", True)


Geo = conf.registerPlugin("Geo")
conf.registerGlobalValue(
    Geo,
    "datalastupdated",
    registry.PositiveInteger(
        1,
        """An integer representing the time since epoch the .dat file was last updated.""",
    ),
)

conf.registerGlobalValue(
    Geo, "licenseKey",
    registry.String("", """MaxMind license key.""", private=True))

# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
Beispiel #22
0
import supybot.conf as conf
import supybot.registry as registry
try:
    from supybot.i18n import PluginInternationalization
    _ = PluginInternationalization('WolframAlpha')
except:
    # Placeholder that allows to run the plugin on a bot
    # without the i18n module
    _ = 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 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('WolframAlpha', True)


WolframAlpha = conf.registerPlugin('WolframAlpha')

conf.registerGlobalValue(
    WolframAlpha,
    "apikey",
    registry.String("", _("""Wolfram Alpha API key."""))
)

# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
Beispiel #23
0
    output(
        _("""The "progstats" command can reveal potentially sensitive
              information about your machine. Here's an example of its output:

              %s\n""") % progstats())
    if yn(_('Would you like to disable this command for non-owner users?'),
          default=True):
        conf.supybot.commands.disabled().add('Unix.progstats')


Unix = conf.registerPlugin('Unix')
conf.registerGroup(Unix, 'fortune')
conf.registerGlobalValue(
    Unix.fortune, 'command',
    registry.String(
        utils.findBinaryInPath('fortune') or '',
        _("""Determines
    what command will be called for the fortune command.""")))
conf.registerChannelValue(
    Unix.fortune, 'short',
    registry.Boolean(
        True,
        _("""Determines whether only short fortunes will be
    used if possible.  This sends the -s option to the fortune program.""")))
conf.registerGlobalValue(
    Unix.fortune, 'equal',
    registry.Boolean(
        True,
        _("""Determines whether fortune will give equal
    weight to the different fortune databases.  If false, then larger
    databases will be given more weight.  This sends the -e option to the
    fortune program.""")))
Beispiel #24
0
    # user or not.  You should effect your configuration by manipulating the
    # registry as appropriate.
    from supybot.questions import expect, anything, something, yn
    conf.registerPlugin('GitHub', True)


GitHub = conf.registerPlugin('GitHub')
# This is where your configuration variables (if any) should go.  For example:
# conf.registerGlobalValue(GitHub, 'someConfigVariableName',
#     registry.Boolean(False, _("""Help for someConfigVariableName.""")))
conf.registerGroup(GitHub, 'api')
conf.registerGlobalValue(
    GitHub.api, 'url',
    registry.String(
        'https://api.github.com',
        _("""The URL of the
        GitHub API to use. You probably don't need to edit it, but I let it
        there, just in case.""")))
conf.registerGlobalValue(
    GitHub, 'announces',
    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.registerGroup(GitHub, 'format')
conf.registerChannelValue(GitHub.format, 'push',
        registry.String('echo ' +
        _('$repository__owner__name/\x02$repository__name\x02 '
        '(in \x02$ref__branch\x02): $__commit__author__name committed '
Beispiel #25
0
import supybot.conf as conf
import supybot.registry as registry
try:
    from supybot.i18n import PluginInternationalization
    _ = PluginInternationalization('Coinmarketcap')
except:
    # Placeholder that allows to run the plugin on a bot
    # without the i18n module
    _ = 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 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('Coinmarketcap', True)


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

conf.registerGlobalValue(Coinmarketcap, 'api_key',
                         registry.String('', _("""CoinMarketCap API Key""")))

# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
Beispiel #26
0
import supybot.conf as conf
import supybot.registry as registry
try:
    from supybot.i18n import PluginInternationalization
    from supybot.i18n import internationalizeDocstring
    _ = PluginInternationalization('Wikifetch')
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('Wikifetch', True)


Wikifetch = conf.registerPlugin('Wikifetch')
conf.registerChannelValue(Wikifetch, 'url',
        registry.String(_('en.wikipedia.org'), _("""Default URL of the
        website to pull from.""")))
conf.registerChannelValue(Wikifetch, 'showRedirects',
        registry.Boolean(True, _("""Determines whether redirect paths will
        be shown in the output.""")))

# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
Beispiel #27
0
###
# Ctcp plugin configuration variables.
###
Ctcp = conf.registerPlugin('Ctcp')
conf.registerGlobalValue(
    Ctcp, 'versionWait',
    registry.PositiveInteger(
        10, """Determines how many seconds the bot will
    wait after getting a version command (not a CTCP VERSION, but an actual
    call of the command in this plugin named "version") before replying with
    the results it has collected."""))
conf.registerGlobalValue(
    Ctcp, 'userinfo',
    registry.String(
        '', """Determines what will be sent when a
    USERINFO query is received."""))

###
# supybot.abuse configuration variables.
###
conf.registerGlobalValue(
    conf.supybot.abuse.flood, 'ctcp',
    registry.Boolean(
        True, """Determines whether the bot will defend itself
    against CTCP flooding."""))
conf.registerGlobalValue(
    conf.supybot.abuse.flood.ctcp, 'maximum',
    registry.PositiveInteger(
        5, """Determines how many CTCP messages (not
    including actions) the bot will reply to from a given user in a minute.
Beispiel #28
0
 def testWith(self):
     v = registry.String('foo', 'help')
     self.assertEqual(v(), 'foo')
     with v.context('bar'):
         self.assertEqual(v(), 'bar')
     self.assertEqual(v(), 'foo')
Beispiel #29
0
def registerDefaultPlugin(command, plugin):
    command = callbacks.canonicalName(command)
    conf.registerGlobalValue(conf.supybot.commands.defaultPlugins, command,
                             registry.String(plugin, ''))
    # This must be set, or the quotes won't be removed.
    conf.supybot.commands.defaultPlugins.get(command).set(plugin)
Beispiel #30
0
    # without the i18n module
    _ = 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 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('GoogleCSE', True)

GoogleCSE = conf.registerPlugin('GoogleCSE')

# Google API key. Required.
conf.registerGlobalValue(GoogleCSE, 'apiKey',
     registry.String("", _("""Google API key""")))

# Google search engine ID. Required.
conf.registerGlobalValue(GoogleCSE, 'searchEngineID',
     registry.String("", _("""Google search engine ID""")))

# Safe search filter.
conf.registerGlobalValue(GoogleCSE, 'searchFilter',
     registry.String("medium", _("""Safe search filter""")))

# This is the baseURL used, verbatim. No protocols are prepended.
# I set it up this way so that if the URL needs to change in the future
# for some reason, it would be easy to do that.
conf.registerGlobalValue(GoogleCSE, 'baseURL',
     registry.String("https://www.googleapis.com/customsearch/v1", _("""Base search URL including protocol.""")))