Esempio n. 1
0
 def testFloat(self):
     v = registry.Float(1.0, 'help')
     self.assertEqual(v(), 1.0)
     v.setValue(10)
     self.assertEqual(v(), 10.0)
     v.set('0')
     self.assertEqual(v(), 0.0)
Esempio n. 2
0
    registry.Integer(-1, """sasl attempts allowed, -1 to disable"""))
conf.registerGlobalValue(
    Sigyn, 'saslLife',
    registry.PositiveInteger(300, """life of messages to keep"""))
conf.registerGlobalValue(
    Sigyn, 'saslDuration',
    registry.PositiveInteger(240, """dline duration in minutes"""))
conf.registerGlobalValue(
    Sigyn, 'saslMessage',
    registry.String(
        "Banned due to too many failed login attempts in a short period, email [email protected] when corrected. Thanks!",
        """dline message"""))

conf.registerChannelValue(
    Sigyn, 'lastActionTaken',
    registry.Float(0.0, """store date of last action taken in a channel"""))

conf.registerGlobalValue(
    Sigyn, 'announcePermit',
    registry.Integer(
        -1,
        """number of announce permit in logChannel,if triggered the bot will stay quiet for alertPeriod, -1 to disable"""
    ))
conf.registerGlobalValue(
    Sigyn, 'announceLife',
    registry.PositiveInteger(1, """life of announce in memory (seconds)"""))

conf.registerGlobalValue(
    Sigyn, 'ipv4AbusePermit',
    registry.Integer(
        -1,
Esempio n. 3
0
        """,""", """The command for showing the remaining KAOS"""))

conf.registerChannelValue(
    TriviaTime.general, 'vowelsHint',
    registry.Boolean(
        True,
        """Show all vowels on the third hint. If false, random letters will be shown instead"""
    ))

conf.registerChannelValue(
    TriviaTime.general, 'showStats',
    registry.Boolean(True, """Show player stats after correct answer?"""))

conf.registerChannelValue(
    TriviaTime.skip, 'skipThreshold',
    registry.Float(
        .5, """Percentage of active players who need to vote to skip"""))

conf.registerChannelValue(
    TriviaTime.skip, 'skipActiveTime',
    registry.Integer((
        10 * 60
    ), """Amount of time a user is considered active after answering a question"""
                     ))

conf.registerChannelValue(
    TriviaTime.skip, 'skipTime',
    registry.Integer(
        90,
        """Time a user must wait to skip a question again after skipping in seconds"""
    ))
Esempio n. 4
0
    from supybot.questions import expect, anything, something, yn
    conf.registerPlugin('ASCII', True)

ASCII = conf.registerPlugin('ASCII')

conf.registerGlobalValue(ASCII, 'pasteAPI',
registry.String('', _("""Paste.ee API Key""")))

conf.registerGlobalValue(ASCII, 'imgurAPI',
registry.String('', _("""Imgur Client ID""")))

conf.registerChannelValue(ASCII, 'pasteEnable',
registry.Boolean(False, _("""Turns on and off paste.ee support""")))

conf.registerChannelValue(ASCII, 'delay',
registry.Float(1.0, _("""Set the time delay betwen lines. Not currently implemented.""")))

conf.registerChannelValue(ASCII, 'quantize',
registry.Boolean(False, _("""Enable quantizing to 256 colors before rendering. Results in much faster rendering at a slight decrease in quality. Default: False""")))

conf.registerChannelValue(ASCII, 'resize',
registry.Integer(3, _("""Set the resize algorithm. 0 = nearest, 1 = lanczos, 2 = bilinear, 3 = bicubic, 4 = box, 5 = hamming""")))

conf.registerChannelValue(ASCII, 'speed',
registry.String('Slow', _("""Set the speed of the color rendering. 'Slow' (default) to use CIEDE2000 color difference. 'Fast' to use Euclidean color difference.""")))

conf.registerChannelValue(ASCII, 'imgDefault',
registry.String('1/2', _("""Set the default art type for the img command. Options are 'ascii', '1/2' (default), '1/4', 'block', and 'no-color'""")))

conf.registerChannelValue(ASCII, 'asciiWidth',
registry.Integer(100, _("""Set the default column width for ascii art images""")))
Esempio n. 5
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('TranslationParty', True)


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

conf.registerGlobalValue(
    TranslationParty, 'delay',
    registry.Float(0.5, """Determines pause between translations."""))

# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
Esempio n. 6
0
conf.registerChannelValue(
    TriviaTime.hints, 'vowelsHint',
    registry.Boolean(
        True,
        """Show all vowels on the third hint. If false, random letters will be shown instead"""
    ))

conf.registerChannelValue(
    TriviaTime.general, 'showStats',
    registry.Boolean(True, """Show player stats after correct answer"""))

conf.registerChannelValue(
    TriviaTime.skip, 'skipThreshold',
    registry.Float(
        .5,
        """Percentage of active players who need to vote for a question to be skipped"""
    ))

conf.registerChannelValue(
    TriviaTime.skip, 'skipActiveTime',
    registry.Integer((
        10 * 60
    ), """Amount of seconds a user is considered active after answering a question"""
                     ))

conf.registerChannelValue(
    TriviaTime.skip, 'skipTime',
    registry.Integer(
        90,
        """Seconds a user must wait to skip a question again after skipping""")
)
Esempio n. 7
0
    registry.SpaceSeparatedListOfStrings(
        [],
        """Timestamps, senders and victims for previous bombs in the channel"""
    ))

conf.registerChannelValue(
    TimeBomb, 'rateLimitTime',
    registry.Integer(
        1800,
        """Time in seconds for which previous bombs are remembered and count towards the rate limit"""
    ))

conf.registerChannelValue(
    TimeBomb, 'rateLimitSender',
    registry.Float(
        5.0,
        """Mean bombs/hour allowed in the past rateLimitTime from each host""")
)

conf.registerChannelValue(
    TimeBomb, 'rateLimitVictim',
    registry.Float(
        3.0,
        """Mean bombs/hour allowed in the past rateLimitTime targeting a particular nick"""
    ))

conf.registerChannelValue(
    TimeBomb, 'rateLimitTotal',
    registry.Float(
        9.0, """Total mean bombs/hour allowed in the past rateLimitTime"""))
Esempio n. 8
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
    Mittag = conf.registerPlugin('Mittag', True)

    Mittag.apiKey.setValue(something("Please enter your API Key:"))
    Mittag.latitude.setValue(something("Latitude:"))
    Mittag.longitude.setValue(something("Longitude:"))
    Mittag.distance.setValue(something("Distance:", default=2.5))
    Mittag.prefixNick.setValue(yn("Prefix nickname in replies?",
                                  default=False))


Mittag = conf.registerPlugin('Mittag')

conf.registerChannelValue(
    Mittag, 'apiKey',
    registry.String('', 'Your Mittag.at API key', private=True))
conf.registerChannelValue(Mittag, 'latitude', registry.Float(0.0, 'Latitude'))
conf.registerChannelValue(Mittag, 'longitude',
                          registry.Float(0.0, 'Longitude'))
conf.registerChannelValue(Mittag, 'distance',
                          registry.PositiveFloat(2.5, 'Distance'))
conf.registerChannelValue(
    Mittag, 'prefixNick',
    registry.Boolean(False, 'Whether or not to prefix nickname in replies'))

# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
Esempio n. 9
0
registerChannelValue(
    supybot.replies, 'possibleBug',
    registry.NormalizedString(
        """This may be a bug.  If you think it is, please
    file a bug report at
    <http://sourceforge.net/tracker/?func=add&group_id=58965&atid=489447>.""",
        """Determines what message the bot sends when it thinks you've encountered
    a bug that the developers don't know about."""))
###
# End supybot.replies.
###

registerGlobalValue(
    supybot, 'snarfThrottle',
    registry.Float(
        10.0, """A floating point number of seconds to throttle
    snarfed URLs, in order to prevent loops between two bots snarfing the same
    URLs and having the snarfed URL in the output of the snarf message."""))

registerGlobalValue(
    supybot, 'upkeepInterval',
    registry.PositiveInteger(
        3600, """Determines the number of seconds between
    running the upkeep function that flushes (commits) open databases, collects
    garbage, and records some useful statistics at the debugging level."""))

registerGlobalValue(
    supybot, 'flush',
    registry.Boolean(
        True, """Determines whether the bot will periodically
    flush data and configuration files to disk.  Generally, the only time
    you'll want to set this to False is when you want to modify those
Esempio n. 10
0
    Jeopardy,
    "hintReduction",
    registry.Probability(
        0.5,
        _("""The percentage by which to reduce points with each hint reveal"""
          ),
    ),
)

conf.registerChannelValue(
    Jeopardy,
    "flexibility",
    registry.Float(
        0.94,
        _("""
            The minimum similarity score of the answer checker. Uses jaro-winkler
            distance, 1.0 is identical/disabled. (Sane values > 0.90)
            """),
    ),
)

conf.registerChannelValue(
    Jeopardy,
    "inactiveShutoff",
    registry.Integer(
        5,
        _("""
            The number of questions that can go
            unanswered before the game stops automatically.
            """),
    ),
Esempio n. 11
0
registerChannelValue(
    supybot.replies, 'possibleBug',
    registry.NormalizedString(
        """This may be a bug.  If you think it is, please
    file a bug report at
    <http://sourceforge.net/tracker/?func=add&group_id=58965&atid=489447>.""",
        """Determines what message the bot sends when it thinks you've encountered
    a bug that the developers don't know about."""))
###
# End supybot.replies.
###

registerGlobalValue(
    supybot, 'snarfThrottle',
    registry.Float(
        10.0, """A floating point number of seconds to throttle
    snarfed URLs, in order to prevent loops between two bots snarfing the same
    URLs and having the snarfed URL in the output of the snarf message."""))

registerGlobalValue(
    supybot, 'upkeepInterval',
    registry.PositiveInteger(
        3600, """Determines the number of seconds between
    running the upkeep function that flushes (commits) open databases, collects
    garbage, and records some useful statistics at the debugging level."""))

registerGlobalValue(
    supybot, 'flush',
    registry.Boolean(
        True, """Determines whether the bot will periodically
    flush data and configuration files to disk.  Generally, the only time
    you'll want to set this to False is when you want to modify those
Esempio n. 12
0
conf.registerChannelValue(
    Bantracker, 'request',
    registry.Boolean(False, "Enable message requests from bot"))
conf.registerChannelValue(
    Bantracker.request, 'type',
    SpaceSeparatedListOfTypes(
        ['removal', 'ban', 'quiet'],
        "List of events for which the bot should request a comment."))
conf.registerChannelValue(Bantracker.request, 'ignore',
        registry.SpaceSeparatedListOfStrings(['FloodBot?', 'FloodBotK?', 'ChanServ'],
            "List of nicks for which the bot won't request to comment or review."\
            " Is case insensible and wildcards * ? are accepted."))
conf.registerChannelValue(Bantracker.request, 'forward',
        registry.SpaceSeparatedListOfStrings([],
            "List of nicks for which the bot will forward the request to"\
            " the channels/nicks defined in forwards.channels option."\
            " Is case insensible and wildcards * ? are accepted."))
conf.registerChannelValue(
    Bantracker.request.forward, 'channels',
    registry.SpaceSeparatedListOfStrings(
        [],
        "List of channels/nicks to forward the request if the op is in the forward list."
    ))
conf.registerGlobalValue(
    Bantracker.request, 'review',
    registry.Float(
        7,
        "Days after which the bot will request for review a ban. Can be an integer or decimal"
        " value. Zero disables reviews."))