supybot.commands

Includes wrappers for commands.

class supybot.commands.context(spec)[source]
class supybot.commands.Spec(types, allowExtra=False)[source]
supybot.commands.addConverter(name, wrapper)[source]
class supybot.commands.additional(spec, default=None)[source]
class supybot.commands.any(spec, continueOnError=False)[source]
supybot.commands.callConverter(name, irc, msg, args, state, *L)[source]
class supybot.commands.commalist(spec)[source]
class supybot.commands.first(*specs, **kw)[source]
supybot.commands.getConverter(name)[source]
class supybot.commands.getopts(getopts)[source]

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

class supybot.commands.many(spec, continueOnError=False)[source]
class supybot.commands.optional(spec, default=None)[source]
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.rest(spec)[source]
class supybot.commands.reverse(spec)[source]
supybot.commands.thread(f)[source]

Makes sure a command spawns a thread when called.

supybot.commands.urlSnarfer(f)[source]

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

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, extbanmasks, filename, float, glob, halfop, haveHalfop, haveHalfop+, haveOp, haveOp+, haveVoice, haveVoice+, hostmask, httpIri, httpUrl, id, inChannel, index, int, ip, iri, 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.

Parameters:
  • f – A command, taking (self, irc, msg, args, …) as arguments

  • specList – A list of converters and contexts