def __init__(self, window): super(MPMcontroller, self).__init__() self._window = window self._actionMgr = ActionManager(self) rc = self._window.rootContext() rc.setContextProperty('mpmController', self) rc.setContextProperty('actionMgr', self._actionMgr)
class MPMcontroller(QObject): def __init__(self, window): super(MPMcontroller, self).__init__() self._window = window self._actionMgr = ActionManager(self) rc = self._window.rootContext() rc.setContextProperty('mpmController', self) rc.setContextProperty('actionMgr', self._actionMgr) def release(self): self._actionMgr.release() @QtCore.Slot(str, str) def store_config(self, file, data): try: os.makedirs(frontend.MPM_USER_CONFIG_DIR) except OSError, e: if e.errno != errno.EEXIST: raise with open(frontend.MPM_USER_CONFIG_DIR + file, 'w') as f: f.write(data);