Package topo :: Package base :: Module simulation :: Class CommandEvent
[hide private]
[frames] | no frames]

Class CommandEvent

source code


An Event consisting of a command string to execute.
Instance Methods [hide private]
 
__init__(self, time, command_string)
Add the event to the simulation.
source code
 
__repr__(self)
x.__repr__() <==> repr(x)
source code
 
script_repr(self, imports=[], prefix=' ')
Generate a runnable command for creating this CommandEvent.
source code
 
__call__(self, sim)
exec's the command_string in __main__.__dict__.
source code
 
__test(self)
Check for SyntaxErrors in the command.
source code

Inherited from Event: __cmp__

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, time, command_string)
(Constructor)

source code 

Add the event to the simulation.

Raises an exception if the command_string contains a syntax error.

Overrides: object.__init__

__repr__(self)
(Representation operator)

source code 
x.__repr__() <==> repr(x)
Overrides: object.__repr__
(inherited documentation)

__call__(self, sim)
(Call operator)

source code 

exec's the command_string in __main__.__dict__.

Be sure that any required items will be present in __main__.__dict__; in particular, consider what will be present after the network is saved and restored. For instance, results of scripts you have run, or imports they make---all currently available in __main__.__dict__---will not be saved with the network.

Overrides: Event.__call__