def configure(self): d = ConfigureDialog(self._state) d.setModal(True) if d.exec_(): self.serialize(self._location) self._state = d.getState() # When a PMR location is given we need to translate that into a # local path for passing into the ImageSourceData class local_dir = self._state.location() pmr_location = self._state.pmrLocation() if pmr_location and not len(local_dir): # Get login details: local_dir = os.path.join(self._location, self._state.identifier()) if not os.path.exists(local_dir): os.mkdir(local_dir) self._state.setLocation(local_dir) d.setState(self._state) if pmr_location and os.path.exists(local_dir): pmr_tool = PMRTool() pmr_tool.cloneWorkspace(pmr_location, local_dir) self._configured = d.validate() if self._configuredObserver is not None: self._configuredObserver()
def configure(self): d = ConfigureDialog(self._state, QtGui.QApplication.activeWindow().currentWidget()) d.setWorkflowLocation(self._location) d.setModal(True) if d.exec_(): self._state = d.getState() # When a PMR location is given we need to translate that into a # local path for passing into the ImageSourceData class local_dir = self._state.location() pmr_location = self._state.pmrLocation() if pmr_location and not len(local_dir): # Get login details: local_dir = self._location if not os.path.exists(local_dir): os.mkdir(local_dir) self._state.setLocation(local_dir) d.setState(self._state) if pmr_location and os.path.exists(local_dir): pmr_info = PMR() pmr_tool = PMRTool(pmr_info) pmr_tool.cloneWorkspace(pmr_location, local_dir) self._configured = d.validate() if self._configuredObserver is not None: self._configuredObserver()
def _cloneFromPMR(self, workspace_url, workflowDir): om = self._main_window.model().optionsManager() pmr_info = PMR() pmr_tool = PMRTool(pmr_info, use_external_git=om.getOption(USE_EXTERNAL_GIT)) pmr_tool.cloneWorkspace( remote_workspace_url=workspace_url, local_workspace_dir=workflowDir, )
def _importFromPMR(self, workspace_url, workflowDir): pmr_tool = PMRTool() pmr_tool.cloneWorkspace( remote_workspace_url=workspace_url, local_workspace_dir=workflowDir, ) logger.info('Analyze first before attempting load ...') try: m = self._mainWindow.model().workflowManager() m.load(workflowDir) m.setPreviousLocation(workflowDir) self._graphicsScene.updateModel() self._updateUi() except: self.close() raise