An example plugin that allows instances of PetriNet
to
say hello. The source code can be used as a starting
example.
Extensions
Extends module
Class PetriNet
class PetriNet (module.PetriNet) :
Extension of the class PetriNet
in module
Method PetriNet.__init__
def __init__ (self, name, **args) :
Add new keyword argument hello
>>> PetriNet('N').hello()
Hello from N
>>> PetriNet('N', hello='Hi! This is %s...').hello()
Hi! This is N...
Call API
object name
object args
: plugin options- keyword
hello
: the message to print, with%s
where the net name should appear.
Method PetriNet.hello
def hello (self) :
Ask the net to say hello