Пример #1
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
    conf.registerPlugin('Sourceforge', True)
    output("""The Sourceforge plugin has the functionality to watch for URLs
              that match a specific pattern (we call this a snarfer). When
              supybot sees such a URL, he will parse the web page for
              information and reply with the results.""")
    if yn('Do you want this snarfer to be enabled by default?'):
        conf.supybot.plugins.Sourceforge.trackerSnarfer.setValue(True)

    output("""The bugs and rfes commands of the Sourceforge plugin can be set
              to query a default project when no project is specified.  If this
              project is not set, calling either of those commands will display
              the associated help.  With the default project set, calling
              bugs/rfes with no arguments will find the most recent bugs/rfes
              for the default project.""")
    if yn('Do you want to specify a default project?'):
        project = anything('Project name:')
        if project:
            conf.supybot.plugins.Sourceforge.defaultProject.set(project)

    output("""Sourceforge is quite the word to type, and it may get annoying
              typing it all the time because Supybot makes you use the plugin
              name to disambiguate calls to ambiguous commands (i.e., the bug
              command is in this plugin and the Bugzilla plugin; if both are
              loaded, you\'ll have you type "sourceforge bug ..." to get this
              bug command).  You may save some time by making an alias for
              "sourceforge".  We like to make it "sf".""")
Пример #2
0
def configure(advanced):
    from supybot.questions import output, expect, anything, something, yn
    conf.registerPlugin('BadWords', True)
    if yn(_('Would you like to add some bad words?')):
        words = anything(_('What words? (separate individual words by '
                         'spaces)'))
        conf.supybot.plugins.BadWords.words.set(words)
Пример #3
0
def configure(advanced):
    from supybot.questions import something, anything, yn, output
    output("""Here you can set which channels and who the bot has to send log
              messages to. Note that by default in order to log to a channel
              the channel has to have mode +s set. Logging to a user requires
              the user to have the Owner capability.""")
    targets = ''
    while not targets:
        try:
            targets = anything('Which channels or users would you like to '
                               'send log messages to?')
            conf.supybot.plugins.LogToIrc.targets.set(targets)
        except registry.InvalidRegistryValue as e:
            output(str(e))
            targets = ''
    colorized = yn('Would you like these messages to be colored?')
    conf.supybot.plugins.LogToIrc.color.setValue(colorized)
    if advanced:
        level = ''
        while not level:
            try:
                level = something('What would you like the minimum priority '
                                  'level to be which will be logged to IRC?')
                conf.supybot.plugins.LogToIrc.level.set(level)
            except registry.InvalidRegistryValue as e:
                output(str(e))
                level = ''
Пример #4
0
def configure(advanced):
    from supybot.questions import output, expect, anything, something, yn
    conf.registerPlugin('BadWords', True)
    if yn(_('Would you like to add some bad words?')):
        words = anything(_('What words? (separate individual words by '
                         'spaces)'))
        conf.supybot.plugins.BadWords.words.set(words)
Пример #5
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
    conf.registerPlugin('Sourceforge', True)
    output("""The Sourceforge plugin has the functionality to watch for URLs
              that match a specific pattern (we call this a snarfer). When
              supybot sees such a URL, he will parse the web page for
              information and reply with the results.""")
    if yn('Do you want this snarfer to be enabled by default?'):
        conf.supybot.plugins.Sourceforge.trackerSnarfer.setValue(True)

    output("""The bugs and rfes commands of the Sourceforge plugin can be set
              to query a default project when no project is specified.  If this
              project is not set, calling either of those commands will display
              the associated help.  With the default project set, calling
              bugs/rfes with no arguments will find the most recent bugs/rfes
              for the default project.""")
    if yn('Do you want to specify a default project?'):
        project = anything('Project name:')
        if project:
            conf.supybot.plugins.Sourceforge.defaultProject.set(project)

    output("""Sourceforge is quite the word to type, and it may get annoying
              typing it all the time because Supybot makes you use the plugin
              name to disambiguate calls to ambiguous commands (i.e., the bug
              command is in this plugin and the Bugzilla plugin; if both are
              loaded, you\'ll have you type "sourceforge bug ..." to get this
              bug command).  You may save some time by making an alias for
              "sourceforge".  We like to make it "sf".""")
Пример #6
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('Figlet', True)
    directory = anything("""What directory are your Figlet font files in?""")
    Figlet.fontDirectory.setValue(directory)
Пример #7
0
def configure(advanced):
    from supybot.questions import output, expect, anything, something, yn
    conf.registerPlugin('Relay', True)
    if yn(_('Would you like to relay between any channels?')):
        channels = anything(_('What channels?  Separate them by spaces.'))
        conf.supybot.plugins.Relay.channels.set(channels)
    if yn(_('Would you like to use color to distinguish between nicks?')):
        conf.supybot.plugins.Relay.color.setValue(True)
    output("""Right now there's no way to configure the actual connection to
    the server.  What you'll need to do when the bot finishes starting up is
    use the 'start' command followed by the 'connect' command.  Use the 'help'
    command to see how these two commands should be used.""")
Пример #8
0
def configure(advanced):
    from supybot.questions import output, expect, anything, something, yn
    conf.registerPlugin('Relay', True)
    if yn(_('Would you like to relay between any channels?')):
        channels = anything(_('What channels?  Separated them by spaces.'))
        conf.supybot.plugins.Relay.channels.set(channels)
    if yn(_('Would you like to use color to distinguish between nicks?')):
        conf.supybot.plugins.Relay.color.setValue(True)
    output("""Right now there's no way to configure the actual connection to
    the server.  What you'll need to do when the bot finishes starting up is
    use the 'start' command followed by the 'connect' command.  Use the 'help'
    command to see how these two commands should be used.""")
Пример #9
0
def configure(advanced):
    # This will be called by supybot to configure this module.  advanced is
    # a bool that specifies whether the user identified 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
    MediaWikiShortLinks = conf.registerPlugin('MediaWikiShortLinks', True)
    r = anything("""If you want to enable the MediaWiki Title Snarfer, give """
      """the URL which is prepended to the page title. For example, for the """
      """English Wikipedia, this could be http://en.wikipedia.org/wiki/ or """
      """http://en.wikipedia.org/w/index.php?title=. If you do not want to """
      """enable the snarfer, leave this blank.""")
    MediaWikiShortLinks.mediaWikiUrl.setValue(r)
Пример #10
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
    output('To use Amazon\'s Web Services, you must have a license key.')
    if yn('Do you have a license key?'):
        key = anything('What is it?')
        conf.registerPlugin('Amazon', True)
        conf.supybot.plugins.Amazon.licenseKey.set(key)
    else:
        output("""You'll need to get a key before you can use this plugin.
                  You can apply for a key at
                  http://www.amazon.com/webservices/""")
Пример #11
0
    output("""Now we're going to run you through plugin configuration. There's
           a variety of plugins in supybot by default, but you can create and
           add your own, of course. We'll allow you to take a look at the known
           plugins' descriptions and configure them
           if you like what you see.""")

    # bulk
    addedBulk = False
    if advanced and yn('Would you like to add plugins en masse first?'):
        addedBulk = True
        output(format("""The available plugins are: %L.""", plugins))
        output("""What plugins would you like to add?  If you've changed your
        mind and would rather not add plugins in bulk like this, just press
        enter and we'll move on to the individual plugin configuration.""")
        massPlugins = anything('Separate plugin names by spaces or commas:')
        for name in re.split(r',?\s+', massPlugins):
            module = loadPlugin(name)
            if module is not None:
                configurePlugin(module, advanced)
                clearLoadedPlugins(plugins, conf.supybot.plugins)

    # individual
    if yn('Would you like to look at plugins individually?'):
        output("""Next comes your opportunity to learn more about the plugins
        that are available and select some (or all!) of them to run in your
        bot.  Before you have to make a decision, of course, you'll be able to
        see a short description of the plugin and, if you choose, an example
        session with the plugin.  Let's begin.""")
        # until we get example strings again, this will default to false
        #showUsage =yn('Would you like the option of seeing usage examples?')
Пример #12
0
def configure(advanced):

    from supybot.questions import expect, anything, something, yn
    conf.registerPlugin('Phabricator', True)

    Phabricator.phabricatorURL.setValue(
        something("Specify the URL of the Phabricator location.",
                  default="code.wildfiregames.com"))

    Phabricator.phabricatorToken.setValue(
        something("Specify the token to access the Phabricator conduit API.",
                  default="code.wildfiregames.com"))

    Phabricator.acceptInvalidSSLCert.setValue(
        something("Accept invalid SSL certificates?", default=False))

    Phabricator.httpTimeout.setValue(something("HTTP timeout", default=40))

    Phabricator.channels.setValue(
        anything(
            "On which irc channels the bot should post Phabricator updates. If empty, prints on each joined channel.",
            default="",
            acceptEmpty=True))

    Phabricator.storyLimit.setValue(
        something("Number of stories to pull at most per HTTP request",
                  default=5))

    Phabricator.historyForwards.setValue(
        yn("Traverse history chronologically forwards (or backwards)?",
           default=True))

    Phabricator.timestampAfter.setValue(
        anything("To ignore messages after this date, type a timestamp",
                 default=0))

    Phabricator.timestampBefore.setValue(
        anything("To ignore messages before this date, type a timestamp",
                 default=0))

    Phabricator.sleepTime.setValue(
        something(
            "Number of seconds between consecutive HTTP request for phabricator stories",
            default=30))

    Phabricator.newsPrefix.setValue(
        anything("Enter string to be preceeeded with Phabricator updates"),
        default="News from the project:")

    Phabricator.printDate.setValue(yn(
        "Whether to print a human readable timestamp in front of each update notification"
    ),
                                   default=False)

    Phabricator.chronokeyFile.setValue(
        something(
            "Filename to store the most recently processed chronological key",
            default="chronokey.txt"))

    Phabricator.ignoredUsers.setValue(
        anything("Updates of these usernames will remain hidden.",
                 default="Harbormaster Vulcan",
                 acceptEmpty=True))

    Phabricator.filteredUsers.setValue(
        anything("Only updates of these usernames will be shown.",
                 default="Harbormaster Vulcan",
                 acceptEmpty=True))

    Phabricator.notifyRetitle.setValue(
        yn("Notify if differentials are retitled?", default=True))

    Phabricator.notifyCommit.setValue(
        yn("Notify if a developer committed a patch?", default=True))

    Phabricator.obscureUsernames.setValue(
        yn("Prevent the bot from pinging irc users in updates by inserting invisible whitespace in the username?",
           default=True))

    Phabricator.verbose.setValue(
        yn("Display spammy, verbose debug output?", default=False))
Пример #13
0
    output("""Now we're going to run you through plugin configuration. There's
           a variety of plugins in supybot by default, but you can create and
           add your own, of course. We'll allow you to take a look at the known
           plugins' descriptions and configure them
           if you like what you see.""")

    # bulk
    addedBulk = False
    if advanced and yn('Would you like to add plugins en masse first?'):
        addedBulk = True
        output(format("""The available plugins are: %L.""", plugins))
        output("""What plugins would you like to add?  If you've changed your
        mind and would rather not add plugins in bulk like this, just press
        enter and we'll move on to the individual plugin configuration.""")
        massPlugins = anything('Separate plugin names by spaces or commas:')
        for name in re.split(r',?\s+', massPlugins):
            module = loadPlugin(name)
            if module is not None:
                configurePlugin(module, advanced)
                clearLoadedPlugins(plugins, conf.supybot.plugins)

    # individual
    if yn('Would you like to look at plugins individually?'):
        output("""Next comes your opportunity to learn more about the plugins
        that are available and select some (or all!) of them to run in your
        bot.  Before you have to make a decision, of course, you'll be able to
        see a short description of the plugin and, if you choose, an example
        session with the plugin.  Let's begin.""")
        # until we get example strings again, this will default to false
        #showUsage =yn('Would you like the option of seeing usage examples?')
Пример #14
0
def configure(advanced):
    from supybot.questions import output, expect, anything, something, yn
    conf.registerPlugin('Cpp', True)
    if yn('Would you like to serve cpp channels?'):
        channels = anything('What channels?  Separated them by spaces.')
        conf.supybot.plugins.Cpp.channels.set(channels)