Package command_system :: Package implementation :: Module middleware :: Class ChatCommandProcessor
[hide private]
[frames] | no frames]

Class ChatCommandProcessor

source code


A basic scaffolding to provide convenient interaction between the command system and chat controls. It will be merged directly into the controls, by ChatCommandProcessor being among superclasses of the controls.
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
 
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
 
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

Inherited from framework.CommandProcessor: get_command, list_commands

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

Class Variables [hide private]

Inherited from framework.CommandProcessor: 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.
Overrides: framework.CommandProcessor.process_as_command
(inherited documentation)

execute_command(self, name, arguments)

source code 
Overrides: framework.CommandProcessor.execute_command

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.

Overrides: framework.CommandProcessor.looks_like_command
(inherited documentation)

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.

Overrides: framework.CommandProcessor.command_preprocessor
(inherited documentation)

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.
Overrides: framework.CommandProcessor.command_postprocessor
(inherited documentation)