def setupDefaultFolders(self): """ setupDefaultFolders() -> None Give default values to folders when there are no values specified """ if self.configuration.has('rootDirectory'): system.set_vistrails_root_directory(self.configuration.rootDirectory) if self.configuration.has('dataDirectory'): system.set_vistrails_data_directory( \ self.configuration.dataDirectory) if self.configuration.has('fileDirectory'): system.set_vistrails_file_directory( \ self.configuration.fileDirectory) if (self.configuration.has('verbosenessLevel') and self.configuration.verbosenessLevel != -1): dbg = debug.DebugPrint verbose = self.configuration.verbosenessLevel if verbose < 0: msg = ("""Don't know how to set verboseness level to %s - " "setting tothe lowest one I know of: 0""" % verbose) dbg.critical(msg) verbose = 0 if verbose > 2: msg = ("""Don't know how to set verboseness level to %s - " "setting to the highest one I know of: 2""" % verbose) dbg.critical(msg) verbose = 2 levels = [dbg.Critical, dbg.Warning, dbg.Log] dbg.set_message_level(levels[verbose]) dbg.log("Set verboseness level to %s" % verbose) if not self.configuration.has('userPackageDirectory'): s = os.path.join(core.system.default_dot_vistrails(), 'userpackages') self.configuration.userPackageDirectory = s
def setupDefaultFolders(self): """ setupDefaultFolders() -> None Give default values to folders when there are no values specified """ if self.temp_configuration.has('rootDirectory'): system.set_vistrails_root_directory(self.temp_configuration.rootDirectory) if self.temp_configuration.has('dataDirectory'): system.set_vistrails_data_directory( \ self.temp_configuration.dataDirectory) if self.temp_configuration.has('fileDirectory'): system.set_vistrails_file_directory( \ self.temp_configuration.fileDirectory) if (self.temp_configuration.has('verbosenessLevel') and self.temp_configuration.verbosenessLevel != -1): verbose = self.temp_configuration.verbosenessLevel if verbose < 0: msg = ("""Don't know how to set verboseness level to %s - " "setting to the lowest one I know of: 0""" % verbose) debug.critical(msg) verbose = 0 if verbose > 2: msg = ("""Don't know how to set verboseness level to %s - " "setting to the highest one I know of: 2""" % verbose) debug.critical(msg) verbose = 2 dbg = debug.DebugPrint.getInstance() levels = [dbg.Critical, dbg.Warning, dbg.Log] dbg.set_message_level(levels[verbose]) debug.log("Set verboseness level to %s" % verbose) #these checks may need to update the persistent configuration, so # we have to change both objects #userpackages directory if not self.temp_configuration.check('userPackageDirectory'): s = os.path.join(self.temp_configuration.dotVistrails, 'userpackages') self.temp_configuration.userPackageDirectory = s if not self.configuration.check('userPackageDirectory'): s = os.path.join(self.configuration.dotVistrails, 'userpackages') self.configuration.userPackageDirectory = s #abstractions directory if not self.temp_configuration.check('abstractionsDirectory') or \ self.temp_configuration.abstractionsDirectory == \ os.path.join(self.temp_configuration.userPackageDirectory, 'abstractions'): s = os.path.join(self.temp_configuration.dotVistrails, 'subworkflows') self.temp_configuration.abstractionsDirectory = s if not self.configuration.check('abstractionsDirectory') or \ self.configuration.abstractionsDirectory == \ os.path.join(self.configuration.userPackageDirectory, 'abstractions'): s = os.path.join(self.configuration.dotVistrails, 'subworkflows') self.configuration.abstractionsDirectory = s #thumbnails directory if self.temp_configuration.has('thumbs'): if not self.temp_configuration.thumbs.check('cacheDirectory'): s = os.path.join(self.temp_configuration.dotVistrails,'thumbs') self.temp_configuration.thumbs.cacheDirectory = s if self.configuration.has('thumbs'): if not self.configuration.thumbs.check('cacheDirectory'): s = os.path.join(self.configuration.dotVistrails, 'thumbs') self.configuration.thumbs.cacheDirectory = s
def setupDefaultFolders(self): """ setupDefaultFolders() -> None Give default values to folders when there are no values specified """ if self.temp_configuration.has('rootDirectory'): system.set_vistrails_root_directory( self.temp_configuration.rootDirectory) if self.temp_configuration.has('dataDirectory'): system.set_vistrails_data_directory( \ self.temp_configuration.dataDirectory) if self.temp_configuration.has('fileDirectory'): system.set_vistrails_file_directory( \ self.temp_configuration.fileDirectory) if (self.temp_configuration.has('verbosenessLevel') and self.temp_configuration.verbosenessLevel != -1): verbose = self.temp_configuration.verbosenessLevel if verbose < 0: msg = ("""Don't know how to set verboseness level to %s - " "setting to the lowest one I know of: 0""" % verbose) debug.critical(msg) verbose = 0 if verbose > 2: msg = ("""Don't know how to set verboseness level to %s - " "setting to the highest one I know of: 2""" % verbose) debug.critical(msg) verbose = 2 dbg = debug.DebugPrint.getInstance() levels = [dbg.Critical, dbg.Warning, dbg.Log] dbg.set_message_level(levels[verbose]) debug.log("Set verboseness level to %s" % verbose) #these checks may need to update the persistent configuration, so # we have to change both objects #userpackages directory if not self.temp_configuration.check('userPackageDirectory'): s = os.path.join(self.temp_configuration.dotVistrails, 'userpackages') self.temp_configuration.userPackageDirectory = s if not self.configuration.check('userPackageDirectory'): s = os.path.join(self.configuration.dotVistrails, 'userpackages') self.configuration.userPackageDirectory = s #abstractions directory if not self.temp_configuration.check('abstractionsDirectory') or \ self.temp_configuration.abstractionsDirectory == \ os.path.join(self.temp_configuration.userPackageDirectory, 'abstractions'): s = os.path.join(self.temp_configuration.dotVistrails, 'subworkflows') self.temp_configuration.abstractionsDirectory = s if not self.configuration.check('abstractionsDirectory') or \ self.configuration.abstractionsDirectory == \ os.path.join(self.configuration.userPackageDirectory, 'abstractions'): s = os.path.join(self.configuration.dotVistrails, 'subworkflows') self.configuration.abstractionsDirectory = s #thumbnails directory if self.temp_configuration.has('thumbs'): if not self.temp_configuration.thumbs.check('cacheDirectory'): s = os.path.join(self.temp_configuration.dotVistrails, 'thumbs') self.temp_configuration.thumbs.cacheDirectory = s if self.configuration.has('thumbs'): if not self.configuration.thumbs.check('cacheDirectory'): s = os.path.join(self.configuration.dotVistrails, 'thumbs') self.configuration.thumbs.cacheDirectory = s