def dropEvent(self, event): """ Execute the pipeline at the particular location """ mimeData = event.mimeData() if (hasattr(mimeData, 'versionId') and hasattr(mimeData, 'controller')): event.accept() versionId = mimeData.versionId controller = mimeData.controller pipeline = controller.vistrail.getPipeline(versionId) inspector = PipelineInspector() inspector.inspect_spreadsheet_cells(pipeline) inspector.inspect_ambiguous_modules(pipeline) if len(inspector.spreadsheet_cells)==1: localPos = self.sheet.viewport().mapFromGlobal(QtGui.QCursor.pos()) row = self.sheet.rowAt(localPos.y()) col = self.sheet.columnAt(localPos.x()) if (row!=-1 and col!=-1): pipeline = self.setPipelineToLocateAt(row, col, pipeline) executePipelineWithProgress(pipeline, 'Execute Cell', controller=controller, locator=controller.locator, current_version=versionId, reason='Drop Version') else: event.ignore()
def dropEvent(self, event): """ Execute the pipeline at the particular location """ mimeData = event.mimeData() if (hasattr(mimeData, 'versionId') and hasattr(mimeData, 'controller')): event.accept() versionId = mimeData.versionId controller = mimeData.controller pipeline = controller.vistrail.getPipeline(versionId) inspector = PipelineInspector() inspector.inspect_spreadsheet_cells(pipeline) inspector.inspect_ambiguous_modules(pipeline) if len(inspector.spreadsheet_cells) == 1: localPos = self.sheet.viewport().mapFromGlobal( QtGui.QCursor.pos()) row = self.sheet.rowAt(localPos.y()) col = self.sheet.columnAt(localPos.x()) if (row != -1 and col != -1): pipeline = self.setPipelineToLocateAt(row, col, pipeline) executePipelineWithProgress(pipeline, 'Execute Cell', controller=controller, locator=controller.locator, current_version=versionId, reason='Drop Version') else: event.ignore()
def executePipelineToCell(self, pInfo, row, col, reason=''): """ executePipelineToCell(p: tuple, row: int, col: int) -> None p: (locator, version, actions, pipeline) Execute a pipeline and put all of its cell to (row, col). This need to be fixed to layout all cells inside the pipeline """ pipeline = self.setPipelineToLocateAt(row, col, pInfo[3]) executePipelineWithProgress(pipeline, 'Execute Cell', locator=pInfo[0], current_version=pInfo[1], actions=pInfo[2], reason=reason)
def executePipelineToCell(self, pInfo, row, col, reason=''): """ executePipelineToCell(p: tuple, row: int, col: int) -> None p: (locator, version, actions, pipeline) Execute a pipeline and put all of its cell to (row, col). This need to be fixed to layout all cells inside the pipeline """ pipeline = self.setPipelineToLocateAt(row, col, pInfo[3]) executePipelineWithProgress(pipeline, 'Execute Cell', locator=pInfo[0], controller=pInfo[4], current_version=pInfo[1], actions=pInfo[2], reason=reason)
def executeCell(self, checked=False): from spreadsheet_execute import executePipelineWithProgress #cell = self.sheet.getCell(self.row, self.col) info = self.sheet.getCellPipelineInfo(self.row, self.col) if info: info = info[0] mId = info['moduleId'] pipeline = self.sheet.setPipelineToLocateAt(self.row, self.col, info['pipeline'], [mId]) executePipelineWithProgress(pipeline, 'Re-execute Cell', current_version=info['version'], actions=info['actions'], reason=info['reason'], locator=info['locator'], controller=info['controller'], sinks=[mId])
def executeCell(self, checked=False): from spreadsheet_execute import executePipelineWithProgress #cell = self.sheet.getCell(self.row, self.col) info = self.sheet.getCellPipelineInfo(self.row, self.col) if info: info = info[0] mId = info['moduleId'] pipeline = self.sheet.setPipelineToLocateAt( self.row, self.col, info['pipeline'], [mId]) executePipelineWithProgress(pipeline, 'Re-execute Cell', current_version=info['version'], actions=info['actions'], reason=info['reason'], locator=info['locator'], controller=info['controller'], sinks=[mId])
def copyCell(self, row, col, newSheet, newRow, newCol): """ copyCell(row, col: int, newSheet: Sheet, newRow, newCol: int) -> None Copy the (row, col) of this sheet to (newRow, newCol) of newSheet """ info = self.getCellPipelineInfo(row, col) if info: info = info[0] mId = info['moduleId'] pipeline = newSheet.setPipelineToLocateAt(newRow, newCol, info['pipeline'], [mId]) executePipelineWithProgress(pipeline, 'Copy Cell', current_version=info['version'], actions=info['actions'], reason=info['reason'], locator=info['locator'], sinks=[mId])
def copyCell(self, row, col, newSheet, newRow, newCol): """ copyCell(row, col: int, newSheet: Sheet, newRow, newCol: int) -> None Copy the (row, col) of this sheet to (newRow, newCol) of newSheet """ info = self.getCellPipelineInfo(row, col) if info: info = info[0] mId = info['moduleId'] pipeline = newSheet.setPipelineToLocateAt(newRow, newCol, info['pipeline'], [mId]) executePipelineWithProgress(pipeline, 'Copy Cell', current_version=info['version'], actions=info['actions'], reason=info['reason'], locator=info['locator'], controller=info['controller'], sinks=[mId])