class MainApplication(object): """ This object is the main application object for the framework. """ def __init__(self): self._size = QtCore.QSize(600, 400) self._pos = QtCore.QPoint(100, 150) self._pluginManager = PluginManager() self._workflowManager = WorkflowManager() self._undoManager = UndoManager() self._threadCommandManager = ThreadCommandManager() def setSize(self, size): self._size = size def size(self): return self._size def setPos(self, pos): self._pos = pos def pos(self): return self._pos def undoManager(self): return self._undoManager def workflowManager(self): return self._workflowManager def pluginManager(self): return self._pluginManager def threadCommandManager(self): return self._threadCommandManager def writeSettings(self): settings = QtCore.QSettings() settings.beginGroup("MainWindow") settings.setValue("size", self._size) settings.setValue("pos", self._pos) settings.endGroup() self._pluginManager.writeSettings(settings) self._workflowManager.writeSettings(settings) def readSettings(self): settings = QtCore.QSettings() settings.beginGroup("MainWindow") self._size = settings.value("size", self._size) self._pos = settings.value("pos", self._pos) settings.endGroup() self._pluginManager.readSettings(settings) self._workflowManager.readSettings(settings)
def __init__(self): self._size = QtCore.QSize(600, 400) self._pos = QtCore.QPoint(100, 150) self._pluginManager = PluginManager() self._workflowManager = WorkflowManager() self._undoManager = UndoManager() self._threadCommandManager = ThreadCommandManager()
def testLoadPlugins(self): redirectstdout = ConsumeOutput() redirect_handler = logging.StreamHandler(redirectstdout) logger = logging.getLogger('mapclient.core.pluginframework') logger.setLevel(logging.INFO) for handler in logger.handlers: logger.removeHandler(handler) logger.addHandler(redirect_handler) pm = PluginManager() pm.load() redirect_handler.flush() features = [True for msg in redirectstdout.messages if "Loaded plugin 'pointcloudserializerstep' version [0.3.0] by Hugh Sorby" in msg] self.assertEqual(1, len(features)) logger.removeHandler(redirect_handler) redirect_handler.close()