Beispiel #1
0
def configure(advanced):
    from supybot.questions import expect, anything, something, yn
    UbuntuMan = conf.registerPlugin('UbuntuMan', True)

    if advanced == False:
        return

    baseurl = something("""What value should be used for base URL?""",
                        default="http://manpages.ubuntu.com/manpages")

    release = expect("""What value should be used as the default Ubuntu release?""",
                     possibilities=['dapper', 'hardy', 'intrepid', 'jaunty',
                         'karmic', 'lucid'],
                     default='karmic')

    sections = something("""What manual page sections should be enabled?""",
                         default='1 5 8')

    language = expect("""Which language should be used by default?""",
                      possibilities=['en', 'es', 'de', 'fi'],
                      default='en')

    UbuntuMan.baseurl.setValue(baseurl)
    UbuntuMan.release.setValue(release)
    UbuntuMan.sections.setValue(sections)
    UbuntuMan.language.setValue(language)
Beispiel #2
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
    Pastebin2cpaste = conf.registerPlugin('Pastebin2cpaste', True)
    curl = expect("""Curl Command (%s will be replaced by the URL):""", [],
                  default="""curl '%s'""")
    cpaste = expect(
        """Cpaste Command:""", [],
        default="""cpaste -a "CentOS Project Repaste Service" -p -s -e 1440""")
    Pastebin2cpaste.curl.setValue(curl)
    Pastebin2cpaste.cpaste.setValue(cpaste)
Beispiel #3
0
def configure(advanced):
    # This will be called by supybot to configure this module.  advanced is
    # a bool that specifies whether the user identified 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
    botPort = conf.registerPlugin(PluginName, True)
    
    if yn("""The Beatport plugin rocks.  Would you like these commands to
             be enabled for everyone?""", default = False):
        botPort.userLevelRequires.setValue("")
    else:
        cap = something("""What capability would you like to require for
                           this command to be used?""", default = "Admin")
        botPort.userLevelRequires.setValue(cap)
    
    perPage = something("""How many results would you like returned per search?
                           """, default = 5)
    botPort.numResults.setValue(perPage)
    
    sortBy = expect("""In what order would you like results displayed?
                       See http://api.beatport.com/catalog-search.html for
                       options.""",
                       ["releaseDate", "publishDate", "releaseId", "trackName",
                        "trackId", "labelName", "genreName"],
                       default = "releaseDate")
    botPort.sortBy.setValue(sortBy)
Beispiel #4
0
def configure(advanced):
    # This will be called by supybot to configure this module.  advanced is
    # a bool that specifies whether the user identified 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('NagiosLogger', True)
    listenurl = expect('What is the ZeroMQ URL for receiving alert notifications?')
    conf.supybot.plugins.NagiosLogger.ZmqURL.setValue(listenurl)
Beispiel #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 expect, anything, something, yn
    Jira = conf.registerPlugin('Jira', True)
    server = expect("""What is the URL for the Jira instance?""")
    user = expect("""What is the username for the Jira user?""")
    password = expect("""What is the password for the Jira user?""")
    if yn("""Would you like the plugin to verify your Jira instance's
            SSL certificate?""", default=False):
        Jira.verifySSL.setValue("True")
    else:
        Jira.verifySSL.setValue("False")
    #snarfRegex = expect("""What is the regex for your Jira ticket IDs?""", 
    #                        default="JRA-[0-9]+")
    Jira.server.setValue(server)
    Jira.user.setValue(user)
    Jira.password.setValue(password)
Beispiel #6
0
 def anything(prompt, default=None):
     """Because supybot is pure fail"""
     from supybot.questions import expect
     return expect(prompt, [], default=default)
Beispiel #7
0
            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?')
        showUsage = False
        name = expect('What plugin would you like to look at?',
                      plugins,
                      acceptEmpty=True)
        while name:
            module = loadPlugin(name)
            if module is not None:
                describePlugin(module, showUsage)
                if yn('Would you like to load this plugin?', default=True):
                    configurePlugin(module, advanced)
                    clearLoadedPlugins(plugins, conf.supybot.plugins)
            if not yn('Would you like add another plugin?'):
                break
            name = expect('What plugin would you like to look at?', plugins)

    ###
    # Sundry
    ###
Beispiel #8
0
            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?')
        showUsage = False
        name = expect('What plugin would you like to look at?',
                      plugins, acceptEmpty=True)
        while name:
            module = loadPlugin(name)
            if module is not None:
                describePlugin(module, showUsage)
                if yn('Would you like to load this plugin?', default=True):
                    configurePlugin(module, advanced)
                    clearLoadedPlugins(plugins, conf.supybot.plugins)
            if not yn('Would you like add another plugin?'):
                break
            name = expect('What plugin would you like to look at?', plugins)

    ###
    # Sundry
    ###
    output("""Although supybot offers a supybot-adduser script, with which