예제 #1
0
파일: plugin.py 프로젝트: Chalks/Supybot
 def addAlias(self, irc, name, alias, lock=False):
     if self._invalidCharsRe.search(name):
         raise AliasError, 'Names cannot contain spaces or square brackets.'
     if '|' in name:
         raise AliasError, 'Names cannot contain pipes.'
     realName = callbacks.canonicalName(name)
     if name != realName:
         s = format('That name isn\'t valid.  Try %q instead.', realName)
         raise AliasError, s
     name = realName
     if self.isCommandMethod(name):
         if realName not in self.aliases:
             s = 'You can\'t overwrite commands in this plugin.'
             raise AliasError, s
     if name in self.aliases:
         (currentAlias, locked, _) = self.aliases[name]
         if locked and currentAlias != alias:
             raise AliasError, format('Alias %q is locked.', name)
     try:
         f = makeNewAlias(name, alias)
         f = new.instancemethod(f, self, Alias)
     except RecursiveAlias:
         raise AliasError, 'You can\'t define a recursive alias.'
     aliasGroup = self.registryValue('aliases', value=False)
     if name in self.aliases:
         # We gotta remove it so its value gets updated.
         aliasGroup.unregister(name)
     conf.registerGlobalValue(aliasGroup, name, registry.String(alias, ''))
     conf.registerGlobalValue(aliasGroup.get(name), 'locked',
                              registry.Boolean(lock, ''))
     self.aliases[name] = [alias, lock, f]
예제 #2
0
 def addAlias(self, irc, name, alias, lock=False):
     if not self.isValidName(name):
         raise AliasError('Invalid alias name.')
     realName = callbacks.canonicalName(name)
     if name != realName:
         s = format(_('That name isn\'t valid.  Try %q instead.'), realName)
         raise AliasError(s)
     name = realName
     if self.isCommandMethod(name):
         if realName not in self.aliases:
             s = 'You can\'t overwrite commands in this plugin.'
             raise AliasError(s)
     if name in self.aliases:
         (currentAlias, locked, _) = self.aliases[name]
         if locked and currentAlias != alias:
             raise AliasError(format('Alias %q is locked.', name))
     f = makeNewAlias(name, alias)
     f = types.MethodType(f, self)
     if name in self.aliases:
         # We gotta remove it so its value gets updated.
         self.aliasRegistryRemove(name)
     aliasGroup = self.aliasRegistryGroup(name)
     if needsEscaping(name):
         confname = escapeAlias(name)
     else:
         confname = name
     conf.registerGlobalValue(aliasGroup, confname,
                              registry.String(alias, ''))
     conf.registerGlobalValue(aliasGroup.get(confname), 'locked',
                              registry.Boolean(lock, ''))
     self.aliases[name] = [alias, lock, f]
예제 #3
0
파일: plugin.py 프로젝트: Chalks/Supybot
 def __init__(self, irc):
     self.__parent = super(Alias, self)
     self.__parent.__init__(irc)
     # Schema: {alias: [command, locked, commandMethod]}
     self.aliases = {}
     # XXX This should go.  aliases should be a space separate list, etc.
     group = conf.supybot.plugins.Alias.aliases
     for (name, alias) in registry._cache.iteritems():
         name = name.lower()
         if name.startswith('supybot.plugins.alias.aliases.'):
             name = name[len('supybot.plugins.alias.aliases.'):]
             if '.' in name:
                 continue
             conf.registerGlobalValue(group, name, registry.String('', ''))
             conf.registerGlobalValue(group.get(name), 'locked',
                                      registry.Boolean(False, ''))
     for (name, value) in group.getValues(fullNames=False):
         name = name.lower() # Just in case.
         command = value()
         locked = value.locked()
         self.aliases[name] = [command, locked, None]
     for (alias, (command, locked, _)) in self.aliases.items():
         try:
             self.addAlias(irc, alias, command, locked)
         except Exception, e:
             self.log.exception('Exception when trying to add alias %s.  '
                                'Removing from the Alias database.', alias)
             del self.aliases[alias]
예제 #4
0
 def __init__(self, irc):
     self.__parent = super(Ottdcoop, self)
     self.__parent.__init__(irc)
     # Schema: {alias: [command, locked, commandMethod]}
     self.abbr = {}
     # XXX This should go.  aliases should be a space separate list, etc.
     group = conf.supybot.plugins.Ottdcoop.abbr
     for (name, text) in registry._cache.iteritems():
         name = name.lower()
         if name.startswith('supybot.plugins.ottdcoop.abbr.'):
             name = name[len('supybot.plugins.ottdcoop.abbr.'):]
             if '.' in name:
                 continue
             self.log.debug ('Name: %s, Value: %s', name, text)
             conf.registerGlobalValue(group, name, registry.String('', ''))
             conf.registerGlobalValue(group.get(name), 'url',
                                      registry.String('', ''))
     for (name, value) in group.getValues(fullNames=False):
         name = name.lower() # Just in case.
         text = value()
         url = value.url()
         self.log.debug ('Name: %s, Text: %s, URL: %s', name, text, url)
         self.abbr[name] = [text, url, None]
     for (name, (text, url, _)) in self.abbr.items():
         try:
             f = self.makeAbbrCommand(name)
             self.abbr[name] = [text, url, f]
         except Exception, e:
             self.log.exception('Exception when trying to add abbreviation %s.  '
                                'Removing from the database.', name)
             del self.abbr[name]
예제 #5
0
파일: plugin.py 프로젝트: gerdesas/Limnoria
 def addAlias(self, irc, name, alias, lock=False):
     if not self._validNameRe.search(name):
         raise AliasError('Names can only contain alphanumerical '
                 'characters, dots, pipes, and '
                 'exclamation/interrogatin marks '
                 '(and the first character cannot be a number).')
     realName = callbacks.canonicalName(name)
     if name != realName:
         s = format(_('That name isn\'t valid.  Try %q instead.'), realName)
         raise AliasError(s)
     name = realName
     if self.isCommandMethod(name):
         if realName not in self.aliases:
             s = 'You can\'t overwrite commands in this plugin.'
             raise AliasError(s)
     if name in self.aliases:
         (currentAlias, locked, _) = self.aliases[name]
         if locked and currentAlias != alias:
             raise AliasError(format('Alias %q is locked.', name))
     f = makeNewAlias(name, alias)
     f = types.MethodType(f, self)
     if '.' in name or '|' in name:
         aliasGroup = self.registryValue('escapedaliases', value=False)
         confname = escapeAlias(name)
     else:
         aliasGroup = self.registryValue('aliases', value=False)
         confname = name
     if name in self.aliases:
         # We gotta remove it so its value gets updated.
         aliasGroup.unregister(confname)
     conf.registerGlobalValue(aliasGroup, confname,
                              registry.String(alias, ''))
     conf.registerGlobalValue(aliasGroup.get(confname), 'locked',
                              registry.Boolean(lock, ''))
     self.aliases[name] = [alias, lock, f]
예제 #6
0
파일: plugin.py 프로젝트: zapster/cacaobot
def registerBugzilla(name, url=''):
    if (not re.match('\w+$', name)):
        s = utils.str.normalizeWhitespace(BugzillaName.__doc__)
        raise registry.InvalidRegistryValue("%s (%s)" % (s, name))

    install = conf.registerGroup(conf.supybot.plugins.Bugzilla.bugzillas,
                                 name.lower())
    conf.registerGlobalValue(install, 'url',
        registry.String(url, """Determines the URL to this Bugzilla
        installation. This must be identical to the urlbase (or sslbase)
        parameter used by the installation. (The url that shows up in
        emails.) It must end with a forward slash."""))
    conf.registerChannelValue(install, 'queryTerms',
        registry.String('',
        """Additional search terms in QuickSearch format, that will be added to
        every search done with "query" against this installation."""))
#    conf.registerGlobalValue(install, 'aliases',
#        BugzillaNames([], """Alternate names for this Bugzilla
#        installation. These must be globally unique."""))

    conf.registerGroup(install, 'watchedItems', orderAlphabetically=True)
    conf.registerChannelValue(install.watchedItems, 'product',
        registry.CommaSeparatedListOfStrings([],
        """What products should be reported to this channel?"""))
    conf.registerChannelValue(install.watchedItems, 'component',
        registry.CommaSeparatedListOfStrings([],
        """What components should be reported to this channel?"""))
    conf.registerChannelValue(install.watchedItems, 'changer',
        registry.SpaceSeparatedListOfStrings([],
        """Whose changes should be reported to this channel?"""))
    conf.registerChannelValue(install.watchedItems, 'all',
        registry.Boolean(False,
        """Should *all* changes be reported to this channel?"""))

    conf.registerChannelValue(install, 'reportedChanges',
        registry.CommaSeparatedListOfStrings(['newBug', 'newAttach', 'Flags',
        'Attachment Flags', 'Resolution', 'Product', 'Component'],
        """The names of fields, as they appear in bugmail, that should be
        reported to this channel."""))

    conf.registerGroup(install, 'traces')
    conf.registerChannelValue(install.traces, 'report',
        registry.Boolean(False, """Some Bugzilla installations have gdb
        stack traces in comments. If you turn this on, the bot will report
        some basic details of any trace that shows up in the comments of
        a new bug."""))
    conf.registerChannelValue(install.traces, 'ignoreFunctions',
        registry.SpaceSeparatedListOfStrings(['__kernel_vsyscall', 'raise',
        'abort', '??'], """Some functions are useless to report, from a stack trace.
        This contains a list of function names to skip over when reporting
        traces to the channel."""))
    #conf.registerChannelValue(install.traces, 'crashStarts',
    #    registry.CommaSeparatedListOfStrings([],
    #    """These are function names that indicate where a crash starts
    #    in a stack trace."""))
    conf.registerChannelValue(install.traces, 'frameLimit',
        registry.PositiveInteger(5, """How many stack frames should be
        reported from the crash?"""))
예제 #7
0
파일: plugin.py 프로젝트: nW44b/Limnoria
 def register_feed_config(self, name, url=''):
     self.registryValue('feeds').add(name)
     group = self.registryValue('feeds', value=False)
     conf.registerGlobalValue(group, name, registry.String(url, ''))
     feed_group = conf.registerGroup(group, name)
     conf.registerChannelValue(feed_group, 'format',
             registry.String('', _("""Feed-specific format. Defaults to
             supybot.plugins.RSS.format if empty.""")))
     conf.registerChannelValue(feed_group, 'announceFormat',
             registry.String('', _("""Feed-specific announce format.
             Defaults to supybot.plugins.RSS.announceFormat if empty.""")))
예제 #8
0
파일: config.py 프로젝트: leamas/supybot-bz
def watch_option(watchname, option):
    ''' Return a watch-specific option, registering on the fly. '''
    watches = global_option('watches')
    try:
        watch = watches.get(watchname)
    except registry.NonExistentRegistryEntry:
        watch = conf.registerGroup(watches, watchname)
    try:
        return watch.get(option)
    except registry.NonExistentRegistryEntry:
        conf.registerGlobalValue(watch, option, _WATCH_OPTIONS[option]())
        return watch.get(option)
예제 #9
0
def repo_option(reponame, option):
    ''' Return a repo-specific option, registering on the fly. '''
    repos = global_option('repos')
    try:
        repo = repos.get(reponame)
    except registry.NonExistentRegistryEntry:
        repo = conf.registerGroup(repos, reponame)
    try:
        return repo.get(option)
    except registry.NonExistentRegistryEntry:
        conf.registerGlobalValue(repo, option, _REPO_OPTIONS[option]())
        return repo.get(option)
예제 #10
0
파일: plugin.py 프로젝트: boamaod/Limnoria
def registerRename(plugin, command=None, newName=None):
    g = conf.registerGlobalValue(conf.supybot.commands.renames, plugin,
            registry.SpaceSeparatedSetOfStrings([], """Determines what commands
            in this plugin are to be renamed."""))
    if command is not None:
        g().add(command)
        v = conf.registerGlobalValue(g, command, registry.String('', ''))
        if newName is not None:
            v.setValue(newName) # In case it was already registered.
        return v
    else:
        return g
예제 #11
0
 def __init__(self, irc):
     self.__parent = super(SMBugs, self)
     self.__parent.__init__(irc)
     
     try:
         self.registryValue("refreshTime")
     except registry.NonExistentRegistryEntry:
         plugin = conf.registerPlugin('SMBugs')
         conf.registerGlobalValue(plugin, "refreshTime",
             registry.PositiveInteger(60 * 2,
                 "Time in seconds to refresh bugs list."))
     
     self.BugCheck(irc, time.localtime())
     self.MercurialCheck(irc, time.localtime())
예제 #12
0
파일: plugin.py 프로젝트: Ban3/Limnoria
 def register_feed_config(self, name, url=''):
     self.registryValue('feeds').add(name)
     group = self.registryValue('feeds', value=False)
     conf.registerGlobalValue(group, name, registry.String(url, ''))
     feed_group = conf.registerGroup(group, name)
     conf.registerChannelValue(feed_group, 'format',
             registry.String('', _("""Feed-specific format. Defaults to
             supybot.plugins.RSS.format if empty.""")))
     conf.registerChannelValue(feed_group, 'announceFormat',
             registry.String('', _("""Feed-specific announce format.
             Defaults to supybot.plugins.RSS.announceFormat if empty.""")))
     conf.registerGlobalValue(feed_group, 'waitPeriod',
             registry.NonNegativeInteger(0, _("""If set to a non-zero
             value, overrides supybot.plugins.RSS.waitPeriod for this
             particular feed.""")))
예제 #13
0
def registerBugtracker(name, url='', description='', trackertype=''):
    conf.supybot.plugins.Bugtracker.bugtrackers().add(name)
    group       = conf.registerGroup(conf.supybot.plugins.Bugtracker.bugtrackers, name)
    URL         = conf.registerGlobalValue(group, 'url', registry.String(url, ''))
    DESC        = conf.registerGlobalValue(group, 'description', registry.String(description, ''))
    TRACKERTYPE = conf.registerGlobalValue(group, 'trackertype', registry.String(trackertype, ''))
    if url:
        URL.setValue(url)
    if description:
        DESC.setValue(description)
    if trackertype:
        if defined_bugtrackers.has_key(trackertype.lower()):
            TRACKERTYPE.setValue(trackertype.lower())
        else:
            raise BugtrackerError("Unknown trackertype: %s" % trackertype)
예제 #14
0
파일: config.py 프로젝트: Athemis/Limnoria
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.registerGlobalValue(p, nick,
                                 registry.String(password, h, private=True))
    if password:
        v.setValue(password)
예제 #15
0
파일: plugin.py 프로젝트: Affix/Fedbot
def registerObserver(name, regexpString='',
                     commandString='', probability=1.0):
    g = conf.registerGlobalValue(conf.supybot.plugins.Observer.observers,
            name, registry.Regexp(regexpString, """Determines what regexp must
            match for this observer to be executed."""))
    if regexpString:
        g.set(regexpString) # This is in case it's been registered.
    conf.registerGlobalValue(g, 'command', registry.String('', """Determines
        what command will be run when this observer is executed."""))
    if commandString:
        g.command.setValue(commandString)
    conf.registerGlobalValue(g, 'probability', Probability(probability, """
        Determines what the probability of executing this observer is if it
        matches."""))
    g.probability.setValue(probability)
    conf.supybot.plugins.Observer.observers().add(name)
    return g
예제 #16
0
    def update(self):
        """update the geo files"""
        now=int(time.time())
        try:
            lastupdate=self.registryValue('datalastupdated')
            self.log.info('Last update: %s seconds ago.' % lastupdate)
        except registry.NonExistentRegistryEntry:
            self.log.info('supybot.plugins.%s.datalastupdate not set. Creating...' % self.name)
            conf.registerGlobalValue(conf.supybot.plugins.get(self.name), 'datalastupdated', registry.PositiveInteger(1, """An integer representing the time since epoch the .dat file was last updated."""))
            self.log.info('...success!')
            lastupdate=1
            self.log.info('Last update: Unknown/Never')

        #if (now-lastupdate)>604800: # updated weekly
        if 1==1:
            self.setRegistryValue('datalastupdated', now)
            self.log.info("Starting update of Geo data files...")
            self.getfile()
        return
예제 #17
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 output, expect, anything, something, yn
    Lookup = conf.registerPlugin('Lookup', True)
    lookups = Lookup.lookups
    output("""This module allows you to define commands that do a simple key
              lookup and return some simple value.  It has a command "add"
              that takes a command name and a file from the data dir and adds a
              command with that name that responds with the mapping from that
              file. The file itself should be composed of lines
              of the form key:value.""")
    while yn('Would you like to add a file?'):
        filename = something('What\'s the filename?')
        try:
            fd = file(filename)
        except EnvironmentError, e:
            output('I couldn\'t open that file: %s' % e)
            continue
        counter = 1
        try:
            try:
                for line in fd:
                    line = line.rstrip('\r\n')
                    if not line or line.startswith('#'):
                        continue
                    (key, value) = line.split(':', 1)
                    counter += 1
            except ValueError:
                output('That\'s not a valid file; '
                       'line #%s is malformed.' % counter)
                continue
        finally:
            fd.close()
        command = something('What would you like the command to be?')
        conf.registerGlobalValue(lookups,command, registry.String(filename,''))
        nokeyVal = yn('Would you like the key to be shown for random '
                      'responses?')
        conf.registerGlobalValue(lookups.get(command), 'nokey',
                                    registry.Boolean(nokeyVal, ''))
예제 #18
0
파일: plugin.py 프로젝트: Hoaas/Limnoria
 def register_feed_config(self, name, url=''):
     self.registryValue('feeds').add(name)
     group = self.registryValue('feeds', value=False)
     conf.registerGlobalValue(group, name,
                              registry.String(url, """The URL for the feed
                                              %s. Note that because
                                              announced lines are cached,
                                              you may need to reload this
                                              plugin after changing this
                                              option.""" % name))
     feed_group = conf.registerGroup(group, name)
     conf.registerChannelValue(feed_group, 'format',
             registry.String('', _("""Feed-specific format. Defaults to
             supybot.plugins.RSS.format if empty.""")))
     conf.registerChannelValue(feed_group, 'announceFormat',
             registry.String('', _("""Feed-specific announce format.
             Defaults to supybot.plugins.RSS.announceFormat if empty.""")))
     conf.registerGlobalValue(feed_group, 'waitPeriod',
             registry.NonNegativeInteger(0, _("""If set to a non-zero
             value, overrides supybot.plugins.RSS.waitPeriod for this
             particular feed.""")))
예제 #19
0
 def register_jira_install(self, handle):
     group = conf.registerGroup(conf.supybot.plugins.JIRA.installs, handle)
     conf.registerGlobalValue(group, "url",
             registry.String("", "URL of the JIRA install, e.g. " \
                     "http://issues.foresightlinux.org/jira"))
     conf.registerGlobalValue(group, "username",
             registry.String("", "Username to login the JIRA install",
                 private=True))
     conf.registerGlobalValue(group, "password",
             registry.String("", "Password to login the JIRA install",
                 private=True))
예제 #20
0
#
#
###

import supybot.conf as conf
import supybot.registry as registry
try:
    from supybot.i18n import PluginInternationalization
    _ = PluginInternationalization('MUD')
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('MUD', True)

MUD = conf.registerPlugin('MUD')

conf.registerGlobalValue(MUD, 'server',
registry.String('', _("""Server Address""")))

conf.registerGlobalValue(MUD, 'port',
registry.Integer('', _("""Port""")))
예제 #21
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('Flight', True)


Flight = conf.registerPlugin('Flight')
# This is where your configuration variables (if any) should go.  For example:
# conf.registerGlobalValue(Flight, 'someConfigVariableName',
#     registry.Boolean(False, """Help for someConfigVariableName."""))
conf.registerGlobalValue(
    Flight, 'flightapi_url',
    registry.String('http://localhost:5000/api', 'flightapi url',
                    private=True))

# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
예제 #22
0
        ' || ', """Determines what string is used
    to separate headlines in new feeds."""))
conf.registerChannelValue(
    RSS, 'announcementPrefix',
    registry.StringWithSpaceOnRight(
        'New news from ', """Determines what prefix
    is prepended (if any) to the new news item announcements made in the
    channel."""))
conf.registerChannelValue(
    RSS, 'announce',
    registry.SpaceSeparatedSetOfStrings([], """Determines which RSS feeds
    should be announced in the channel; valid input is a list of strings
    (either registered RSS feeds or RSS feed URLs) separated by spaces."""))
conf.registerGlobalValue(
    RSS, 'waitPeriod',
    registry.PositiveInteger(
        1800, """Indicates how many seconds the bot will
    wait between retrieving RSS feeds; requests made within this period will
    return cached results."""))
conf.registerGlobalValue(
    RSS, 'feeds',
    FeedNames([], """Determines what feeds should be accessible as
    commands."""))
conf.registerChannelValue(
    RSS, 'showLinks',
    registry.Boolean(
        False, """Determines whether the bot will list the link
    along with the title of the feed when the rss command is called.
    supybot.plugins.RSS.announce.showLinks affects whether links will be
    listed when a feed is automatically announced."""))
conf.registerGlobalValue(
    RSS, 'defaultNumberOfHeadlines',
예제 #23
0
conf.registerGlobalValue(
    TimeBomb, 'colors',
    registry.SpaceSeparatedListOfStrings([
        'AliceBlue', 'AntiqueWhite', 'Aqua', 'Aquamarine', 'Azure', 'Beige',
        'Bisque', 'Black', 'BlanchedAlmond', 'Blue', 'BlueViolet', 'Brown',
        'BurlyWood', 'CadetBlue', 'Chartreuse', 'Chocolate', 'Coral',
        'CornflowerBlue', 'Cornsilk', 'Crimson', 'Cyan', 'DarkBlue',
        'DarkCyan', 'DarkGoldenRod', 'DarkGray', 'DarkGreen', 'DarkKhaki',
        'DarkMagenta', 'DarkOliveGreen', 'DarkOrange', 'DarkOrchid', 'DarkRed',
        'DarkSalmon', 'DarkSeaGreen', 'DarkSlateBlue', 'DarkSlateGray',
        'DarkTurquoise', 'DarkViolet', 'DeepPink', 'DeepSkyBlue', 'DimGray',
        'DodgerBlue', 'FireBrick', 'FloralWhite', 'ForestGreen', 'Fuchsia',
        'Gainsboro', 'GhostWhite', 'Gold', 'GoldenRod', 'Gray', 'Green',
        'GreenYellow', 'HoneyDew', 'HotPink', 'IndianRed', 'Indigo', 'Ivory',
        'Khaki', 'Lavender', 'LavenderBlush', 'LawnGreen', 'LemonChiffon',
        'LightBlue', 'LightCoral', 'LightCyan', 'LightGoldenRodYellow',
        'LightGrey', 'LightGreen', 'LightPink', 'LightSalmon', 'LightSeaGreen',
        'LightSkyBlue', 'LightSlateGray', 'LightSteelBlue', 'LightYellow',
        'Lime', 'LimeGreen', 'Linen', 'Magenta', 'Maroon', 'MediumAquaMarine',
        'MediumBlue', 'MediumOrchid', 'MediumPurple', 'MediumSeaGreen',
        'MediumSlateBlue', 'MediumSpringGreen', 'MediumTurquoise',
        'MediumVioletRed', 'MidnightBlue', 'MintCream', 'MistyRose',
        'Moccasin', 'NavajoWhite', 'Navy', 'OldLace', 'Olive', 'OliveDrab',
        'Orange', 'OrangeRed', 'Orchid', 'PaleGoldenRod', 'PaleGreen',
        'PaleTurquoise', 'PaleVioletRed', 'PapayaWhip', 'PeachPuff', 'Peru',
        'Pink', 'Plum', 'PowderBlue', 'Purple', 'Red', 'RosyBrown',
        'RoyalBlue', 'SaddleBrown', 'Salmon', 'SandyBrown', 'SeaGreen',
        'SeaShell', 'Sienna', 'Silver', 'SkyBlue', 'SlateBlue', 'SlateGray',
        'Snow', 'SpringGreen', 'SteelBlue', 'Tan', 'Teal', 'Thistle', 'Tomato',
        'Turquoise', 'Violet', 'Wheat', 'White', 'WhiteSmoke', 'Yellow',
        'YellowGreen'
    ], """The set of possible timebomb wire colors"""))
예제 #24
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('IMDB', True)


IMDB = conf.registerPlugin('IMDB')

conf.registerGlobalValue(
    IMDB, 'template',
    registry.String(
        "$title ($year, $country, [$rated], $genre, $runtime) | IMDB: $imdbRating MC: $metascore% | $plot | Director: $director | Writer: $writer | Actors: $actors | http://imdb.com/title/$imdbID",
        _("""Template for the output of a search query.""")))

# alternative template:
#                     $title ($year - $director) :: [i:$imdbRating r:$tomatoMeter m:$metascore] $plot :: http://imdb.com/title/$imdbID

conf.registerGlobalValue(
    IMDB, 'noResultsMessage',
    registry.String("No results for that query.",
                    _("""This message is sent when there are no results""")))
conf.registerGlobalValue(IMDB, 'omdbAPI',
                         registry.String('', _("""OMDB API Key""")))

# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
예제 #25
0
_ = PluginInternationalization('WolframAlpha')


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


WolframAlpha = conf.registerPlugin('WolframAlpha')
conf.registerGlobalValue(
    WolframAlpha, 'apiKey',
    registry.String('', ("""Your Wolfram Alpha API key."""), private=True))
conf.registerGlobalValue(
    WolframAlpha, 'maxOutput',
    registry.Integer(4, ("""How many lines by default to output.""")))
conf.registerGlobalValue(
    WolframAlpha, 'useImperial',
    registry.Boolean(True, ("""Use imperial units? Defaults to yes.""")))
conf.registerGlobalValue(
    WolframAlpha, 'reinterpretInput',
    registry.Boolean(False, (
        """Reinterpret input string if WA API cannot understand. Best to leave false."""
    )))
conf.registerGlobalValue(
    WolframAlpha, 'disableANSI',
    registry.Boolean(False,
예제 #26
0
    from supybot.questions import expect, anything, something, yn
    conf.registerPlugin('Jira', True)
    user = something('What is your api username?')
    password = something('What is your password for that username?')
    api_url = something('What is your api url (eg. https://jira.com/api/v2)?')
    url = something('What is your domain (eg. https://jira.com)?')

    conf.supybot.plugins.Jira.apiUser.setValue(user)
    conf.supybot.plugins.Jira.apiPass.setValue(password)
    conf.supybot.plugins.Jira.apiUrl.setValue(api_url)
    conf.supybot.plugins.Jira.domain.setValue(url)


Jira = conf.registerPlugin('Jira')
# This is where your configuration variables (if any) should go.  For example:
# conf.registerGlobalValue(Jira, 'someConfigVariableName',
#     registry.Boolean(False, """Help for someConfigVariableName."""))
conf.registerGlobalValue(Jira, 'apiUser',
    registry.String('', """Defines the username used to access the API."""))
conf.registerGlobalValue(Jira, 'apiPass',
    registry.String('', """Defines the password used to access the API."""))
conf.registerGlobalValue(Jira, 'apiUrl',
    registry.String('', """Defines the full base api url to access the API.
    (eg. https://<instance>.Jira.com/api/v2)"""))
conf.registerGlobalValue(Jira, 'domain',
    registry.String('', """Defines the url to access.
    (eg. https://jira.com)"""))


# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
예제 #27
0
        should be revealed with each hint""")))

conf.registerChannelValue(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.""")))

conf.registerChannelValue(Trivia, 'defaultRoundLength',
        registry.PositiveInteger(10, _("""The default number of questions to
        be asked in a round of trivia.""")))

conf.registerGlobalValue(Trivia, 'questionFileSeparator',
        registry.String('*', _("""The separator used between the questions
        and answers in your trivia file.""")))

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


MCStatus = conf.registerPlugin('MCStatus')
# This is where your configuration variables (if any) should go.  For example:
# conf.registerGlobalValue(MCStatus, 'someConfigVariableName',
#     registry.Boolean(False, _("""Help for someConfigVariableName.""")))
conf.registerGlobalValue(MCStatus, 'statusURL',
        registry.String('http://status.mojang.com/check', _("""This is the URL
        that is queried for JSON data. You shouldn't change this unless you
        know what you are doing.""")))
conf.registerChannelValue(MCStatus, 'prefix',
        registry.String('', _("""This text is prepended to the mcstatus
        command's output.""")))
conf.registerChannelValue(MCStatus, 'suffix',
        registry.String('', _("""This text is appended to the mcstatus
        command's output.""")))
conf.registerChannelValue(MCStatus, 'separator',
        registry.StringSurroundedBySpaces('|', _("""This text is inserted between service-status
        pairs.""")))
conf.registerGroup(MCStatus, 'service')
conf.registerChannelValue(MCStatus.service, 'prefix',
        registry.String('', _("""This text is prepended to each service's
        name.""")))
conf.registerChannelValue(MCStatus.service, 'suffix',
예제 #29
0
import supybot.registry as registry
from supybot.i18n import PluginInternationalization, internationalizeDocstring

_ = PluginInternationalization('Weather')

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


Weather = conf.registerPlugin('Weather')
conf.registerGlobalValue(Weather,'apiKey', registry.String('', ("""Your wunderground.com API key."""), private=True))
conf.registerChannelValue(Weather,'useImperial', registry.Boolean(True, ("""Use imperial units? Defaults to yes.""")))
conf.registerChannelValue(Weather,'disableColoredTemp', registry.Boolean(False, """If True, this will disable coloring temperatures based on values."""))
# conf.registerChannelValue(Weather,'useWeatherSymbols', registry.Boolean(False, """Use unicode symbols with weather conditions and for wind direction."""))
conf.registerGlobalValue(Weather,'forecast', registry.Boolean(True, ("""Display forecast in output by default?""")))
conf.registerGlobalValue(Weather,'alerts', registry.Boolean(False, ("""Display alerts by default?""")))
conf.registerGlobalValue(Weather,'almanac', registry.Boolean(False, ("""Display almanac by default?""")))
conf.registerGlobalValue(Weather,'astronomy', registry.Boolean(False, ("""Display astronomy by default?""")))
conf.registerGlobalValue(Weather,'showPressure', registry.Boolean(False, ("""Show pressure in output?""")))
conf.registerGlobalValue(Weather,'showWind', registry.Boolean(False, ("""Show wind in output?""")))
conf.registerGlobalValue(Weather,'showUpdated', registry.Boolean(False, ("""Show updated in output?""")))
conf.registerChannelValue(Weather,'showImperialAndMetric', registry.Boolean(True, ("""In channel, display output with Imperial and Metric?""")))
conf.registerGlobalValue(Weather,'lang', registry.String('EN', ("""language to use. See docs for available codes.""")))


# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=250:
예제 #30
0
파일: config.py 프로젝트: zapster/cacaobot
# 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('Bitbucket', True)


Bitbucket = conf.registerPlugin('Bitbucket')
# This is where your configuration variables (if any) should go.  For example:
# conf.registerGlobalValue(Bitbucket, 'someConfigVariableName',
#     registry.Boolean(False, """Help for someConfigVariableName."""))
conf.registerGlobalValue(Bitbucket, 'accountname',
     registry.String('', """Bitbucket account name."""))
conf.registerGlobalValue(Bitbucket, 'repo_slug',
     registry.String('', """Bitbucket repository name."""))
conf.registerGlobalValue(Bitbucket, 'snarferTimeout',
    registry.PositiveInteger(300,
    """Time out for snarfer in seconds."""))


# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
예제 #31
0
    from supybot.i18n import internationalizeDocstring
    _ = PluginInternationalization('GUI')
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('GUI', True)


GUI = conf.registerPlugin('GUI')
# This is where your configuration variables (if any) should go.  For example:
# conf.registerGlobalValue(GUI, 'someConfigVariableName',
#     registry.Boolean(False, _("""Help for someConfigVariableName.""")))
conf.registerGlobalValue(
    GUI, 'host',
    registry.String('127.0.0.1', _("""The host the server will bind.""")))
conf.registerGlobalValue(
    GUI, 'port',
    registry.Integer(14789, _("""The port the server will bind.""")))

# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
예제 #32
0
    # 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('Factoids', True)

class FactoidFormat(registry.TemplatedString):
    """Value must include $value, otherwise the factoid's value would be left
    out."""
    requiredTemplates = ['value']

Factoids = conf.registerPlugin('Factoids')
conf.registerGroup(Factoids, 'web')
conf.registerGlobalValue(Factoids.web, 'enable',
    registry.Boolean(False, _("""Determines whether the Factoids plugins will
    be browsable on the HTTP server.""")))
conf.registerChannelValue(Factoids.web, 'channel',
    registry.Boolean(False, _("""Determines whether factoids can be displayed
    via the web server.""")))

conf.registerChannelValue(Factoids, 'requireVoice',
    registry.Boolean(False, _("""Only allows a user with voice or above on a
    channel to use the 'learn' and 'forget' commands.""")))
conf.registerChannelValue(Factoids, 'learnSeparator',
    registry.String('is', _("""Determines what separator must be used in 
    the learn command.  Defaults to 'is' -- learn <key> is <value>.  
    Users might want to change this to something else, so it's
    configurable.""")))
conf.registerChannelValue(Factoids, 'showFactoidIfOnlyOneMatch',
    registry.Boolean(True, _("""Determines whether the bot will reply with the
예제 #33
0
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('Mailbox', True)


Mailbox = conf.registerPlugin('Mailbox')
conf.registerGlobalValue(
    Mailbox, 'server',
    registry.String(
        '', """Determines what POP3 server to connect to in order
    to check for email."""))
conf.registerGlobalValue(
    Mailbox, 'user',
    registry.String(
        '', """Determines what username to give to the POP3 server
    when connecting."""))
conf.registerGlobalValue(
    Mailbox, 'password',
    registry.String('',
                    """Determines what password to give to the POP3 server
    when connecting.""",
                    private=True))
conf.registerGlobalValue(
    Mailbox, 'period',
예제 #34
0
# 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.

###

import supybot.conf as conf
import supybot.registry as registry
from supybot.i18n import PluginInternationalization, internationalizeDocstring
import os

_ = PluginInternationalization('SeattleIncidentResponse')

def configure(advanced):
    from supybot.questions import expect, anything, something, yn
    conf.registerPlugin('Seattle911')

SeattleIncidentResponse = conf.registerPlugin('SeattleIncidentResponse')

conf.registerGlobalValue(SeattleIncidentResponse, 'checkinterval',
    registry.NonNegativeInteger(1, """How often, in minutes, to check for new incidents"""))
    
conf.registerGlobalValue(SeattleIncidentResponse, 'postformat',
    registry.String("[911] [{incident_number}][{incident_type}] {address}", """How often, in minutes, to check for new incidents"""))

conf.registerChannelValue(SeattleIncidentResponse, 'enabled',
    registry.Boolean(False, """Determines whether the bot will announce 911 calls in this channel"""))
예제 #35
0
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('DomainChecker', True)


DomainChecker = conf.registerPlugin('DomainChecker')
# This is where your configuration variables (if any) should go.  For example:
conf.registerGlobalValue(DomainChecker, 'sandbox',
                         registry.Boolean(False, _("""Should we use the Namecheap sandbox?""")))

conf.registerGlobalValue(DomainChecker, 'ApiUser',
                         registry.String("", "Namecheap API username"))

conf.registerGlobalValue(DomainChecker, 'ApiKey',
                         registry.String("", "Namecheap API key"))

conf.registerGlobalValue(DomainChecker, 'affiliate_id',
                         registry.String("80599", "Namecheap affiliate ID"))

# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
예제 #36
0
import supybot.conf as conf
import supybot.registry as registry
from supybot.i18n import PluginInternationalization, internationalizeDocstring

_ = PluginInternationalization('RottenTomatoes')


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


RottenTomatoes = conf.registerPlugin('RottenTomatoes')
# This is where your configuration variables (if any) should go.  For example:
# conf.registerGlobalValue(RottenTomatoes, 'someConfigVariableName',
#     registry.Boolean(False, _("""Help for someConfigVariableName.""")))
conf.registerGlobalValue(
    RottenTomatoes, 'apikey',
    registry.String('Not set',
                    """API
    key to use Rotten Tomatoes REST API. A key can be requested at
    http://developer.rottentomatoes.com/.""",
                    private=True))

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


AQI = conf.registerPlugin('AQI')
conf.registerGlobalValue(
    AQI, 'apikey',
    registry.String(
        '',
        """Sets the API key for aqicn.org, see https://aqicn.org/api""",
        private=True))
conf.registerChannelValue(
    AQI, 'geocodeBackend',
    registry.String(
        'native',
        """Sets the default geocode backend. If set to 'native', this uses aqicn's built-in (but limited) city search.
                              Otherwise, you can use any value supported by NuWeather: https://github.com/jlu5/SupyPlugins/tree/master/NuWeather"""
    ))

# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
예제 #38
0
파일: config.py 프로젝트: jasonn85/Racebot
    username = something("""What iRacing user name (email address) should be used to query for users?
                            This account must watch or friend any user to be known to this bot.""")
    password = something("""What is the password for that iRacing account?""")

    Racebot.iRacingUsername.setValue(username)
    Racebot.iRacingPassword.setValue(password)



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

conf.registerGlobalValue(Racebot, 'iRacingUsername',
                         registry.String('', """iRacing account (email) that will have all relevat users watched or friended."""))
conf.registerGlobalValue(Racebot, 'iRacingPassword',
                         registry.String('', """Password for the iRacing account.  Hopefully we get OAuth some day :-/""", private=True))
conf.registerChannelValue(Racebot, 'raceRegistrationAlerts',
                          registry.Boolean(True, """Determines whether the bot will broadcast in this channel whenever
                          a user joins a race"""))
conf.registerChannelValue(Racebot, 'nonRaceRegistrationAlerts',
                          registry.Boolean(False, """Determines whether the bot will broadcast in this channel whenever
                          a user joins a session other than a race (practice, qual, etc.)"""))




# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
예제 #39
0
except:
    _ = lambda x: x


def configure(advanced):
    from supybot.questions import expect, anything, something, yn
    conf.registerPlugin('BotLibre', True)
    if advanced:
        output('The BotLibre Plugin allows you to interact with Bot Libre')


BotLibre = conf.registerPlugin('BotLibre')

conf.registerChannelValue(
    BotLibre, 'invalidCommand',
    registry.Boolean(False, _("""Should I be invoked on Invalid Commands?""")))
conf.registerGlobalValue(
    BotLibre, 'application',
    registry.String('',
                    _("""The BotLibre API Application String
	(required)"""),
                    private=True))
conf.registerGlobalValue(
    BotLibre, 'instance',
    registry.String('',
                    _("""The BotLibre API Instance String
	(required)"""),
                    private=True))

# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
예제 #40
0
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('TraktTV', True)


TraktTV = conf.registerPlugin('TraktTV')

conf.registerGlobalValue(
    TraktTV, 'apikey',
    registry.String('', """Determines what apikey to use with TraktTV"""))
conf.registerGlobalValue(
    TraktTV, 'maxSearchResults',
    registry.PositiveInteger(
        3,
        """Limits the number of results that will be displayed in the channel."""
    ))

# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
예제 #41
0
    _ = 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('TubeSleuth', True)


TubeSleuth = conf.registerPlugin('TubeSleuth')

conf.registerGlobalValue(
    TubeSleuth, 'developerKey',
    registry.String("", _("""Google API key. Required.""")))

conf.registerGlobalValue(
    TubeSleuth, 'sortOrder',
    registry.String(
        "relevance",
        _("""The order parameter specifies the method that will be used to order resources in the API response."""
          )))

conf.registerGlobalValue(
    TubeSleuth, 'template',
    registry.String("$yt_logo $link :: $title",
                    _("""Template used for search result replies""")))

conf.registerGlobalValue(TubeSleuth, 'useBold',
예제 #42
0
    # 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('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.registerGlobalValue(
    GitHub.announces, 'secret',
    registry.SpaceSeparatedSetOfStrings(set(),
                                        _("""Set of space-separated
        secret payloads used to authenticate GitHub."""),
예제 #43
0
파일: config.py 프로젝트: stephica/supybot
# 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
from supybot.i18n import PluginInternationalization, internationalizeDocstring

_ = PluginInternationalization('Random')

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


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

conf.registerGlobalValue(Random, 'maxCoins',
    registry.PositiveInteger(50000, _("""The maximum amount of coins that can be flipped""")))

# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
예제 #44
0
파일: config.py 프로젝트: nixfloyd/Limnoria
from supybot.i18n import PluginInternationalization, internationalizeDocstring
_ = PluginInternationalization('Owner')


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


Owner = conf.registerPlugin('Owner', True)
conf.registerGlobalValue(
    Owner, 'public',
    registry.Boolean(
        True, """Determines whether this plugin is publicly
    visible."""))
conf.registerGlobalValue(
    Owner, 'quitMsg',
    registry.String(
        '', """Determines what quit message will be used by default.
    If the quit command is called without a quit message, this will be used.  If
    this value is empty, the nick of the person giving the quit command will be
    used."""))

conf.registerGroup(conf.supybot.commands, 'renames', orderAlphabetically=True)

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

###

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


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

conf.registerGlobalValue(Hanzi, 'encoding',
    registry.String('utf-8',"""The charest used in the channels"""))

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


Jira = conf.registerPlugin('Jira')
# This is where your configuration variables (if any) should go.  For example:
# conf.registerGlobalValue(Jira, 'someConfigVariableName',
#     registry.Boolean(False, """Help for someConfigVariableName."""))
conf.registerGlobalValue(
    Jira, 'server',
    registry.String(
        "",
        """URL for the jira rpc server, such as https://issues.jboss.org/rpc/xmlrpc"""
    ))
conf.registerGlobalValue(
    Jira, 'user', registry.String("",
                                  """Username used to access jira server"""))
conf.registerGlobalValue(
    Jira, 'password',
    registry.String("", """Password used to access jira server"""))
conf.registerGlobalValue(
    Jira, 'browseurl',
    registry.String(
        "",
        """URL for browsing the issues by key, such as https://issues.jboss.org/browse/; the key is appended to the url"""
    ))
conf.registerGlobalValue(
예제 #47
0
    # 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('TwitterLite', True)

    consumer_key = something("consumer_key")
    consumer_secret = something("consumer_secret")
    access_token_key = something("access_token_key")
    access_token_secret = something("access_token_secret")

    conf.supybot.plugins.TwitterLite.consumer_key.set(consumer_key)
    conf.supybot.plugins.TwitterLite.consumer_secret.set(consumer_secret)
    conf.supybot.plugins.TwitterLite.access_token_key.set(access_token_key)
    conf.supybot.plugins.TwitterLite.access_token_secret.set(
        access_token_secret)


TwitterLite = conf.registerPlugin('TwitterLite')

conf.registerGlobalValue(TwitterLite, 'consumer_key',
                         registry.String('', """Consumer key."""))
conf.registerGlobalValue(TwitterLite, 'consumer_secret',
                         registry.String('', """Consumer secret."""))
conf.registerGlobalValue(TwitterLite, 'access_token_key',
                         registry.String('', """Access token key."""))
conf.registerGlobalValue(TwitterLite, 'access_token_secret',
                         registry.String('', """Access token secret."""))

# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
예제 #48
0
class FeedNames(registry.SpaceSeparatedListOfStrings):
    List = callbacks.CanonicalNameSet


class FeedItemSortOrder(registry.OnlySomeStrings):
    """Valid values include 'asInFeed', 'oldestFirst', 'newestFirst'."""
    validStrings = ('asInFeed', 'oldestFirst', 'newestFirst', 'outdatedFirst',
                    'updatedFirst')


RSS = conf.registerPlugin('RSS')

conf.registerGlobalValue(
    RSS, 'feeds',
    FeedNames([],
              _("""Determines what feeds should be accessible as
    commands.""")))

########
# Format

conf.registerChannelValue(
    RSS, 'headlineSeparator',
    registry.StringSurroundedBySpaces(
        '|',
        _("""Determines what string is
    used to separate headlines in new feeds.""")))
conf.registerChannelValue(
    RSS, 'format',
    registry.String(
예제 #49
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('Rebrandly')

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


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


# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
예제 #50
0
    # 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('ChannelLogger', True)


ChannelLogger = conf.registerPlugin('ChannelLogger')
conf.registerChannelValue(
    ChannelLogger, 'enable',
    registry.Boolean(True, _("""Determines whether logging is enabled.""")))
conf.registerGlobalValue(
    ChannelLogger, 'flushImmediately',
    registry.Boolean(
        False,
        _("""Determines whether channel logfiles will be
    flushed anytime they're written to, rather than being buffered by the
    operating system.""")))
conf.registerChannelValue(
    ChannelLogger, 'stripFormatting',
    registry.Boolean(
        True,
        _("""Determines whether formatting characters (such
    as bolding, color, etc.) are removed when writing the logs to disk.""")))
conf.registerChannelValue(
    ChannelLogger, 'timestamp',
    registry.Boolean(
        True,
        _("""Determines whether the logs for this channel are
    timestamped with the timestamp in supybot.log.timestampFormat.""")))
예제 #51
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('AutoMode', True)


AutoMode = conf.registerPlugin('AutoMode')
conf.registerChannelValue(AutoMode, 'enable',
    registry.Boolean(True, _("""Determines whether this plugin is enabled.
    """)))
conf.registerGlobalValue(AutoMode, 'owner',
    registry.Boolean(True, _("""Determines whether this plugin will automode
    owners even if they don't have op/halfop/voice/whatever capability.""")))
conf.registerChannelValue(AutoMode, 'alternativeCapabilities',
    registry.Boolean(False, _("""Determines whether the bot will
    check for 'alternative capabilities' (ie. autoop, autohalfop,
    autovoice) in addition to/instead of classic ones.""")))
conf.registerChannelValue(AutoMode, 'fallthrough',
    registry.Boolean(False, _("""Determines whether the bot will "fall
    through" to halfop/voicing when auto-opping is turned off but
    auto-halfopping/voicing are turned on.""")))
conf.registerChannelValue(AutoMode, 'op',
    registry.Boolean(True, _("""Determines whether the bot will automatically
    op people with the <channel>,op capability when they join the channel.
    """)))
conf.registerChannelValue(AutoMode, 'halfop',
    registry.Boolean(True, _("""Determines whether the bot will automatically
예제 #52
0
    from supybot.questions import expect, anything, something, yn
    conf.registerPlugin('Twitter', True)


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

helpGetToken = _('running get_access_token.py is a way to get it')

conf.registerGroup(Twitter.accounts, 'bot')
conf.registerGlobalValue(
    Twitter.accounts.bot, 'key',
    registry.String(
        '',
        _("""The Twitter Access Token key for the bot's
        account (%s)""") % helpGetToken))
conf.registerGlobalValue(
    Twitter.accounts.bot, 'secret',
    registry.String('',
                    _("""The Twitter Access Token secret for the bot's
        account (%s)""") % helpGetToken,
                    private=True))

conf.registerGroup(Twitter.accounts, 'channel')
conf.registerChannelValue(
    Twitter.accounts.channel, 'key',
    registry.String(
        '',
        _("""The Twitter Access Token key for this
예제 #53
0
from .local import accountsdb

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


NuWeather = conf.registerPlugin('NuWeather')
conf.registerGroup(NuWeather, 'apikeys')
conf.registerGroup(NuWeather, 'units')
conf.registerGlobalValue(NuWeather, accountsdb.CONFIG_OPTION_NAME, accountsdb.CONFIG_OPTION)

class NuWeatherTemperatureDisplayMode(registry.OnlySomeStrings):
    validStrings = ('F/C', 'C/F', 'F', 'C')

conf.registerChannelValue(NuWeather.units, 'temperature',
    NuWeatherTemperatureDisplayMode('F/C', _("""Determines how temperatures will be displayed.
        F/C means show "50F/10C", C means display only Celsius, and so on.""")))

BACKENDS = ('darksky', 'apixu')
GEOCODE_BACKENDS = ('nominatim', 'googlemaps', 'opencage')
class NuWeatherBackend(registry.OnlySomeStrings):
    validStrings = BACKENDS
class NuWeatherGeocode(registry.OnlySomeStrings):
    validStrings = GEOCODE_BACKENDS
예제 #54
0
    registry.Regexp(
        None,
        _("""Determines what URLs matching the given regexp
    will not be snarfed.  Give the empty string if you have no URLs that you'd
    like to exclude from being snarfed.""")))
conf.registerChannelValue(
    Web, 'checkIgnored',
    registry.Boolean(
        True,
        _("""Determines whether the title snarfer checks
    if the author of a message is ignored.""")))

conf.registerGlobalValue(
    Web, 'urlWhitelist',
    registry.SpaceSeparatedListOfStrings([],
                                         """If set, bot will only fetch data
    from urls in the whitelist, i.e. starting with http://domain/optionalpath/. This will
    apply to all commands that retrieve data from user-supplied URLs,
    including fetch, headers, title, doctype."""))

conf.registerGlobalValue(
    Web, 'timeout',
    registry.NonNegativeInteger(
        5, """Determines the maximum number of
    seconds the bot will wait for the site to respond, when using a command
    in this plugin other than 'fetch'. If 0, will use socket.defaulttimeout""")
)

conf.registerGroup(Web, 'fetch')
conf.registerGlobalValue(
    Web.fetch, 'maximum',
예제 #55
0
파일: plugin.py 프로젝트: boamaod/Limnoria
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)
예제 #56
0
_ = PluginInternationalization('Owner')


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


Owner = conf.registerPlugin('Owner', True)
conf.registerGlobalValue(
    Owner, 'public',
    registry.Boolean(
        True, """Determines whether this plugin is publicly
    visible."""))
conf.registerGlobalValue(
    Owner, 'quitMsg',
    registry.String(
        '$version', """Determines what quit message will be used by default.
    If the quit command is called without a quit message, this will be used.  If
    this value is empty, the nick of the person giving the quit command will be
    used.  The standard substitutions ($version, $nick, etc.) are all handled
    appropriately."""))

conf.registerGroup(conf.supybot.commands, 'renames', orderAlphabetically=True)

# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
예제 #57
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('TelegramBridge', True)

TelegramBridge = conf.registerPlugin('TelegramBridge')
conf.registerGlobalValue(TelegramBridge, 'tgToken',
    registry.String("TelegramUser", "ID of the telegram bot"
                   "(as shown by BotFather during creation)"))
conf.registerGlobalValue(TelegramBridge, 'tgChatId',
               registry.Integer("666", "ID of the telegram chat"))
conf.registerGlobalValue(TelegramBridge, 'tgTimeout',
               registry.Integer("120", "API timeout for waiting for "
                   "updates"))

# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
예제 #58
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)
예제 #59
0
        cur.close()
        con.close()

Encyclopedia = conf.registerPlugin('Encyclopedia')

conf.registerChannelValue(Encyclopedia, 'enabled',
    registry.Boolean(True, "Enable Encyclopedia"))

conf.registerChannelValue(Encyclopedia, 'database',
    registry.String('ubuntu', 'Name of database to use'))

conf.registerChannelValue(Encyclopedia, 'relaychannel',
    registry.String('#ubuntu-ops', 'Relay channel for unauthorized edits'))

conf.registerGlobalValue(Encyclopedia, 'editchannel',
        registry.SpaceSeparatedListOfStrings(['#ubuntu-ops'], 
            'Channels where unauthorised edits are allowed.'))

conf.registerGlobalValue(Encyclopedia, 'notfoundmsg',
    registry.String('Factoid %s not found', 'Reply when factoid isn\'t found'))

conf.registerChannelValue(Encyclopedia,'prefixchar',
    registry.String('!','Prefix character for factoid display/editing'))

conf.registerGlobalValue(Encyclopedia, 'datadir',
    conf.Directory(conf.supybot.directories.data(), 'Path to dir containing factoid databases', private=True))

conf.registerChannelValue(Encyclopedia, 'alert',
    registry.SpaceSeparatedListOfStrings(['ops', 'op', 'kops', 'calltheops'], 'factoid name(s) used for alerts', private=True))

conf.registerChannelValue(Encyclopedia, 'remotedb',
예제 #60
0
파일: config.py 프로젝트: mogad0n/Limnoria
    def set(self, v):
        if not v.strip():
            self.setValue(set())
        else:
            super().set(v)

    def setValue(self, v):
        self.lastModified = time.time()
        registry.CommaSeparatedListOfStrings.setValue(self, v)


BadWords = conf.registerPlugin('BadWords')
conf.registerGlobalValue(
    BadWords, 'words',
    LastModifiedSpaceSeparatedSetOfStrings([],
                                           _("""Determines what words are
    considered to be 'bad' so the bot won't say them.""")))
conf.registerChannelValue(
    BadWords, 'requireWordBoundaries',
    registry.Boolean(
        False,
        _("""Determines whether the bot will require bad
    words to be independent words, or whether it will censor them within other
    words.  For instance, if 'darn' is a bad word, then if this is true, 'darn'
    will be censored, but 'darnit' will not.  You probably want this to be
    false. After changing this setting, the BadWords regexp needs to be
    regenerated by adding/removing a word to the list, or reloading the
    plugin.""")))
conf.registerGlobalValue(
    BadWords, 'phrases',