def __init__(self, *args, **kargs): OrigCanvasItem.__init__(self, *args, **kargs) if 'handle' not in self.opts: self.opts['handle'] = None ## reload user transform from disk if possible if self.opts['handle'] is not None: trans = self.opts['handle'].info().get('userTransform', None) if trans is not None: self.restoreTransform(trans) elif 'defaultUserTransform' in self.opts: self.restoreTransform(self.opts['defaultUserTransform']) if self.opts['name'] is None: self.opts['name'] = self.opts['handle'].shortName()
def saveState(self, relativeTo=None): state = OrigCanvasItem.saveState(self) state['filename'] = None if self.handle is None else self.handle.name( relativeTo=relativeTo) return state