Includes wrappers for commands.

class supybot.commands.context(spec)[source]

Bases: object

class supybot.commands.any(spec, continueOnError=False)[source]

Bases: supybot.commands.context

class supybot.commands.many(spec, continueOnError=False)[source]

Bases: supybot.commands.any

class supybot.commands.optional(spec, default=None)[source]

Bases: supybot.commands.additional

class supybot.commands.additional(spec, default=None)[source]

Bases: supybot.commands.context


Bases: supybot.commands.context

class supybot.commands.getopts(getopts)[source]

Bases: supybot.commands.context

The empty string indicates that no argument is taken; None indicates that there is no converter for the argument.

class supybot.commands.first(*specs, **kw)[source]

Bases: supybot.commands.context

class supybot.commands.reverse(spec)[source]

Bases: supybot.commands.context

class supybot.commands.commalist(spec)[source]

Bases: supybot.commands.context

supybot.commands.addConverter(name, wrapper)[source]
supybot.commands.callConverter(name, irc, msg, args, state, *L)[source]

Protects the snarfer from loops (with other bots) and whatnot.


Makes sure a command spawns a thread when called.

supybot.commands.wrap(f, *args, **kwargs)[source]

Useful wrapper for plugin commands.

Valid converters are: admin, anything, banmask, boolean, callerInGivenChannel, capability, channel, channelDb, channelOrGlobal, channels, checkCapability, checkCapabilityButIgnoreOwner, checkChannelCapability, color, commandName, email, expiry, filename, float, glob, halfop, haveHalfop, haveHalfop+, haveOp, haveOp+, haveVoice, haveVoice+, hostmask, httpUrl, id, inChannel, index, int, ip, isGranted, letter, literal, long, lowered, matches, networkIrc, nick, nickInChannel, nonInt, nonNegativeInt, now, onlyInChannel, op, otherUser, owner, plugin, positiveInt, private, public, regexpMatcher, regexpMatcherMany, regexpReplacer, seenNick, something, somethingWithoutSpaces, text, to, url, user, validChannel, voice.

  • f – A command, taking (self, irc, msg, args, …) as arguments
  • specList – A list of converters and contexts
supybot.commands.process(f, *args, **kwargs)[source]

Runs a function <f> in a subprocess.

Several extra keyword arguments can be supplied. <pn>, the pluginname, and <cn>, the command name, are strings used to create the process name, for identification purposes. <timeout>, if supplied, limits the length of execution of target function to <timeout> seconds. <heap_size>, if supplied, limits the memory used by the target function.

supybot.commands.regexp_wrapper(s, reobj, timeout, plugin_name, fcn_name)[source]

A convenient wrapper to stuff regexp search queries through a subprocess.

This is used because specially-crafted regexps can use exponential time and hang the bot.

class supybot.commands.Spec(types, allowExtra=False)[source]

Bases: object