def __setstate__(self, dd):
     # Update the object's dict
     self.__dict__.update(dd)
     # Then, re-initialize the method handle and the object's execution thread
     from src.controller import ScriptEngine
     self.callback = ScriptEngine.get(self.methodname)
     self.map = None
     self._conclude()
 def __init__(self, name, rect, callback, m, _1=0, _2=0):
     # Init attributes
     self.name = name
     self.rect = rect
     self.methodname = callback
     self.map = m
     # Get the actual method handle from the string name
     from src.controller import ScriptEngine
     self.callback = ScriptEngine.get(callback)
     # Init the execution thread
     self._conclude()