o.s.c.botService(service.MultiService) : class documentation

Part of otfbot.services.control View Source View In Hierarchy

allows to control the behaviour of the bot during runtime

this class only does the work, you need another class, most suitable is a bot-module, to have a userinterface

Method __init__ Undocumented
Method register_command Add a command to the control service
Method handle_command parse the commandstring and handle the command
Method help get help information for arguments *args (parsed strings from a command, i.e. "ircClient", "disconnect")
Method getlog get the n most recent loglines, of specify an offset to get earlier lines
Method _exec execute function f with *args or return a usage info if the arguments were wrong (too much/too little)
Method _get_usage get a usage info for function f
Method _cmd_config Undocumented
Method _cmd_config_reload Undocumented
Method _cmd_config_set set a configvalue.
Method _cmd_config_get get a configvalue

Inherited from MultiService:

Method privilegedStartService Do preparation work for starting the service.
Method startService Start the service.
Method stopService Stop the service.
Method getServiceNamed Get the child service with a given name.
Method __iter__ Get an iterator over all child services.
Method addService Add a child service.
Method removeService Remove a child service.

Inherited from Service (via MultiService):

Method __getstate__ Undocumented
Method setName Set the name of the service.
Method setServiceParent Set the parent of the service.
Method disownServiceParent Use this API to remove an IService from an IServiceCollection.
def __init__(self, root, parent): (source)
Undocumented
def register_command(self, f, namespace=None, name=None): (source)
Add a command to the control service
Parametersfthe callable to be called, when the command is issued (type: callable )
def handle_command(self, string): (source)
parse the commandstring and handle the command

the string is parsed into commands, and they are searched in the commandList-tree the function returns an answerstring or that the command was ambigious

def _exec(self, f, args): (source)
execute function f with *args or return a usage info if the arguments were wrong (too much/too little)
def _get_usage(self, f): (source)
get a usage info for function f
def help(self, *args): (source)
get help information for arguments *args (parsed strings from a command, i.e. "ircClient", "disconnect")
def getlog(self, numlines=3, offset=0): (source)
get the n most recent loglines, of specify an offset to get earlier lines
def _cmd_config(self, argument): (source)
Undocumented
def _cmd_config_reload(self, argument): (source)
Undocumented
def _cmd_config_set(self, argument): (source)
set a configvalue. syntax for argument: [network=net] [channel=chan] module.setting newvalue
def _cmd_config_get(self, argument): (source)
get a configvalue
API Documentation for OtfBot, generated by pydoctor at 2011-05-03 16:14:29.