Package command_system :: Module framework :: Class CommandProcessor
[hide private]
[frames] | no frames]

Class CommandProcessor

source code


Command processor is an immediate command emitter. It does not participate in the dispatching process directly, but must define a host to bound to.

Bounding is controlled by the COMMAND_HOST variable, which must be defined in the body of the command processor. This variable should be set to a specific command host.

Instance Methods [hide private]
 
process_as_command(self, text)
Try to process text as a command.
source code
 
execute_command(self, name, arguments) source code
 
command_preprocessor(self, command, name, arguments, args, kwargs)
Redefine this method in the subclass to execute custom code before command gets executed.
source code
 
command_postprocessor(self, command, name, arguments, args, kwargs, value)
Redefine this method in the subclass to execute custom code after command gets executed.
source code
 
looks_like_command(self, text, body, name, arguments)
This hook is being called before any processing, but after it was determined that text looks like a command.
source code
 
get_command(self, name) source code
 
list_commands(self) source code

Inherited from object: __delattr__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Class Variables [hide private]
  COMMAND_PREFIX = '/'
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

process_as_command(self, text)

source code 
Try to process text as a command. Returns True if it has been processed as a command and False otherwise.

execute_command(self, name, arguments)

source code 

command_preprocessor(self, command, name, arguments, args, kwargs)

source code 

Redefine this method in the subclass to execute custom code before command gets executed.

If returns True then command execution will be interrupted and command will not be executed.

command_postprocessor(self, command, name, arguments, args, kwargs, value)

source code 
Redefine this method in the subclass to execute custom code after command gets executed.

looks_like_command(self, text, body, name, arguments)

source code 

This hook is being called before any processing, but after it was determined that text looks like a command.

If returns value other then None - then further processing will be interrupted and that value will be used to return from process_as_command.

get_command(self, name)

source code 

list_commands(self)

source code 

Class Variable Details [hide private]

COMMAND_PREFIX

Value:
'/'