def default(): """ default() -> ConfigurationObject Returns the default configuration of VisTrails """ base_dir = { 'abstractionsDirectory': (None, str), 'alwaysShowDebugPopup': False, 'autosave': True, 'dataDirectory': (None, str), 'dbDefault': False, # 'debugSignals': False, 'defaultFileType':system.vistrails_default_file_type(), 'detachHistoryView': False, 'dotVistrails': system.default_dot_vistrails(), 'executeWorkflows': False, 'fileDirectory': (None, str), # 'evolutionGraph': (None, str), 'interactiveMode': True, 'logFile': (None, str), 'logger': default_logger(), 'maxMemory': (None, int), 'maximizeWindows': False, 'maxRecentVistrails': 5, 'migrateTags': False, 'minMemory': (None, int), 'multiHeads': False, 'nologger': True, 'packageDirectory': (None, str), 'pythonPrompt': False, 'recentVistrailList': (None, str), 'repositoryLocalPath': (None, str), 'repositoryHTTPURL': "http://www.vistrails.org/packages", 'reviewMode': False, 'rootDirectory': (None, str), 'shell': default_shell(), 'showScrollbars': True, 'showMovies': True, 'showSplash': True, 'showSpreadsheetOnly': False, 'spreadsheetDumpCells': (None, str), 'spreadsheetDumpPDF': False, 'staticRegistry': (None, str), 'thumbs': default_thumbs(), 'upgradeOn': True, 'upgradeDelay': True, 'upgradeModuleFailPrompt': True, 'useCache': True, 'userPackageDirectory': (None, str), 'verbosenessLevel': (None, int), # 'workflowGraph': (None, str), # 'workflowInfo': (None, str), 'webRepositoryLogin': (None, str), 'webRepositoryURL': "http://www.crowdlabs.org", 'isInServerMode': False, } specific_dir = add_specific_config(base_dir) return ConfigurationObject(**specific_dir)
def untitled_locator(): basename = 'untitled' + vistrails_default_file_type() config = get_vistrails_configuration() if config: dot_vistrails = config.dotVistrails else: dot_vistrails = default_dot_vistrails() fullname = os.path.join(dot_vistrails, basename) return FileLocator(fullname)
def __new__(self, filename=None, **kwargs): if filename: if filename.endswith('.vt'): return ZIPFileLocator(filename, **kwargs) elif filename.endswith('.vtl'): return FileLocator.from_link_file(filename) else: return XMLFileLocator(filename, **kwargs) else: #return class based on default file type if vistrails_default_file_type() == '.vt': return ZIPFileLocator else: return XMLFileLocator
def __new__(self, *args): if len(args) > 0: filename = args[0] if filename.endswith('.vt'): return ZIPFileLocator(filename) elif filename.endswith('.vtl'): return DBLocator.from_link_file(filename) else: return XMLFileLocator(filename) else: #return class based on default file type if vistrails_default_file_type() == '.vt': return ZIPFileLocator else: return XMLFileLocator
def stateChanged(self): """ stateChanged() -> None Handles 'stateChanged' signal from VistrailController Update the window and tab title """ title = self.controller.name if title=='': title = 'untitled%s'%vistrails_default_file_type() if self.controller.changed: title += '*' self.setWindowTitle(title) # propagate the state change to the version prop # maybe in the future we should propagate as a signal versionId = self.controller.current_version self.versionTab.versionProp.updateVersion(versionId)
def default(): """ default() -> ConfigurationObject Returns the default configuration of VisTrails """ base_dir = { 'autosave': True, 'dataDirectory': (None, str), 'dbDefault': False, 'debugSignals': False, 'dotVistrails': system.default_dot_vistrails(), 'fileDirectory': (None, str), 'defaultFileType':system.vistrails_default_file_type(), 'interactiveMode': True, 'logger': default_logger(), 'maxMemory': (None, int), 'maximizeWindows': False, 'minMemory': (None, int), 'multiHeads': False, 'nologger': True, 'packageDirectory': (None, str), 'pythonPrompt': False, 'rootDirectory': (None, str), 'shell': default_shell(), 'showMovies': True, 'showSplash': True, 'useCache': True, 'userPackageDirectory': (None, str), 'verbosenessLevel': (None, int), 'spreadsheetDumpCells': (None, str), 'executeWorkflows': False, 'showSpreadsheetOnly': False, } specific_dir = add_specific_config(base_dir) return ConfigurationObject(**specific_dir)
def __init__(self, parent=None): """ QVistrailItem(parent: QWidget) -> QVistrailItem Make it a main window with dockable area """ QDockContainer.__init__(self, parent) # The window title is the name of the vistrail file self.setWindowTitle('untitled%s'%vistrails_default_file_type()) # Create the views self.pipelineTab = QPipelineTab() self.versionTab = QVersionTab() self.connect(self.versionTab.versionProp, QtCore.SIGNAL('textQueryChange(bool)'), self.setQueryMode) self.pipelineTab.pipelineView.setPIPScene( self.versionTab.versionView.scene()) self.versionTab.versionView.setPIPScene( self.pipelineTab.pipelineView.scene()) self.versionTab.versionView.scene()._pipeline_scene = self.pipelineTab.pipelineView.scene() self.queryTab = QQueryTab() self.peTab = QParameterExplorationTab() self.peTab.annotatedPipelineView.setScene( self.pipelineTab.pipelineView.scene()) # Setup a central stacked widget for pipeline view and version # tree view self.stackedWidget = QtGui.QStackedWidget() self.setCentralWidget(self.stackedWidget) self.stackedWidget.addWidget(self.pipelineTab) self.stackedWidget.addWidget(self.versionTab) self.stackedWidget.addWidget(self.queryTab) self.stackedWidget.addWidget(self.peTab) self.stackedWidget.setCurrentIndex(1) # Initialize the vistrail controller self.controller = VistrailController() self.controller.vistrail_view = self self.connect(self.controller, QtCore.SIGNAL('stateChanged'), self.stateChanged) self.connect(self.controller, QtCore.SIGNAL('new_action'), self.new_action) self.connect(self.versionTab.versionView.scene(), QtCore.SIGNAL('versionSelected(int,bool)'), self.versionSelected) self.connect(self.versionTab, QtCore.SIGNAL('twoVersionsSelected(int,int)'), self.twoVersionsSelected) self.connect(self.queryTab, QtCore.SIGNAL('queryPipelineChange'), self.queryPipelineChange) self.connect(self.peTab, QtCore.SIGNAL('exploreChange(bool)'), self.exploreChange) # We also keep track where this vistrail comes from # So we can save in the right place self.locator = None self.closeEventHandler = None # the redo stack stores the undone action ids # (undo is automatic with us, through the version tree) self.redo_stack = [] # Keep the state of the execution button and menu items for the view self.execQueryEnabled = False self.execDiffEnabled = False self.execExploreEnabled = False self.execPipelineEnabled = False self.execDiffId1 = -1 self.execDiffId2 = -1