Package horizons :: Package command :: Class GenericCommand
[hide private]
[frames] | no frames]

Class GenericCommand

source code

Command --+
          |
         GenericCommand

Code generator for trivial commands on an object.
It saves an object's world id, and executes a method specified as string on it in __call__

NOTE: Do not use floats! 2.6 and 2.7 handle them differently.
Use like this to call obj.mymethod(42, 1337):

class MyCommand(GenericCommand):
  def __init__(self, obj):
    super(MyCommand, self).__init__(obj, "mymethod", 42, 1337)
 

Instance Methods [hide private]
 
__init__(self, obj, method, *args, **kwargs) source code
 
__call__(self, issuer) source code
 
_get_object(self) source code
 
__str__(self) source code
    Inherited from Command
 
execute(self, session, local=False)
Execute command.
source code
Class Methods [hide private]
    Inherited from Command
 
allow_network(cls, klass)
NOTE: this is a security related method and may lead to execution of arbritary code if used in a wrong way see documentation inside horizons.network.packets.SafeUnpickler
source code
 
get_all_commands(cls) source code
Class Variables [hide private]
    Inherited from Command
  log = logging.getLogger("command")