Commit 0e2febe1 authored by Georgios Dagkakis's avatar Georgios Dagkakis

EventGenerator to be able to get method as input

parent 7e652f69
...@@ -32,7 +32,7 @@ from ObjectInterruption import ObjectInterruption ...@@ -32,7 +32,7 @@ from ObjectInterruption import ObjectInterruption
class EventGenerator(ObjectInterruption): class EventGenerator(ObjectInterruption):
def __init__(self, id=id, name=None, start=0, stop=float('inf'), interval=1, def __init__(self, id=id, name=None, start=0, stop=float('inf'), interval=1,
duration=0, method=None, argumentDict=None, **kw): duration=0, method=None, argumentDict={}, **kw):
ObjectInterruption.__init__(self) ObjectInterruption.__init__(self)
self.id=id self.id=id
self.name=name self.name=name
...@@ -44,7 +44,8 @@ class EventGenerator(ObjectInterruption): ...@@ -44,7 +44,8 @@ class EventGenerator(ObjectInterruption):
self.argumentDict=argumentDict #the arguments of the method given in a dict self.argumentDict=argumentDict #the arguments of the method given in a dict
from Globals import G from Globals import G
G.EventGeneratorList.append(self) G.EventGeneratorList.append(self)
if method: self.method=method
if isinstance(method, basestring):
import Globals import Globals
self.method=Globals.getMethodFromName(method) self.method=Globals.getMethodFromName(method)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment