supybot.commands¶
Includes wrappers for commands.
- 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.
- 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.
- 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