pyworkflow.config module

class pyworkflow.config.Config[source]

Bases: object

Main Config for pyworkflow. It contains the main Scipion configuration variables providing default values or, if present, taking them from the environment. Necessary value is SCIPION_HOME and has to be present in the environment

CONDA_ACTIVATION_CMD = ''
NO_COLOR = ''
class Root(root)[source]

Bases: object

Simple helper to return path from a root.

join(*path)[source]
SCIPION_BG_COLOR = 'white'
SCIPION_CANCEL_FASTCOPY = False
SCIPION_CONFIG = '/home/buildbot/devel/scipion/config/scipion.conf'
SCIPION_CONTRAST_COLOR = 'cyan'
SCIPION_CWD = '/tmp/tmp3_zv5ck7/312b5c19315fa5bad76b0a82429d7c9c7b8c3967'
SCIPION_DEFAULT_EXECUTION_ACTION = 1
SCIPION_DOMAIN = None
SCIPION_FONT_NAME = 'Helvetica'
SCIPION_FONT_SIZE = 10
SCIPION_GUI_CANCEL_AUTO_REFRESH = False
SCIPION_GUI_REFRESH_INITIAL_WAIT = 5
SCIPION_GUI_REFRESH_IN_THREAD = False
SCIPION_HOME = '/home/buildbot/devel/scipion'
SCIPION_HOME_DEFINED = True
SCIPION_HOSTS = '/home/buildbot/devel/scipion/config/hosts.conf'
SCIPION_ICON_ZOOM = 50
SCIPION_LOCAL_CONFIG = '/home/buildbot/.config/scipion/scipion_devel.conf'
SCIPION_LOG = '/home/buildbot/ScipionUserData/logs/scipion.log'
SCIPION_LOGS = '/home/buildbot/ScipionUserData/logs'
SCIPION_LOG_CONFIG = None
SCIPION_LOG_FORMAT = '%(message)s'
SCIPION_LOG_LEVEL = 'INFO'
SCIPION_MAIN_COLOR = 'Firebrick'
SCIPION_MAPPER_USE_TEMPLATE = True
SCIPION_NOTES_ARGS = None
SCIPION_NOTES_FILE = 'notes.txt'
SCIPION_NOTES_PROGRAM = None
SCIPION_NOTIFY = True
SCIPION_PLUGIN_JSON = 'plugins.json'
SCIPION_PLUGIN_REPO_URL = 'https://scipion.i2pc.es/getplugins/'
SCIPION_PRIORITY_PACKAGE_LIST = ''
SCIPION_PROTOCOLS = '/home/buildbot/devel/scipion/config/protocols.conf'
SCIPION_SCRATCH = None
SCIPION_SHOW_TEXT_IN_TOOLBAR = True
SCIPION_SOFTWARE = '/home/buildbot/devel/scipion/software'
SCIPION_SPRITES_FILE = '/home/buildbot/devel/scipion/scipion-pyworkflow/pyworkflow/resources/sprites.png'
SCIPION_STEPS_CHECK_SEC = 5
SCIPION_SUPPORT_EMAIL = 'scipion@cnb.csic.es'
SCIPION_TESTS = '/home/buildbot/devel/scipion/data/tests'
SCIPION_TESTS_CMD = '/home/buildbot/devel/scipion/scipion-pyworkflow/pyworkflow/apps/pw_run_tests.py'
SCIPION_TESTS_OUTPUT = '/home/buildbot/ScipionUserData/Tests'
SCIPION_TEST_NOSYNC = False
SCIPION_TEXT_EDITOR = ''
SCIPION_UPDATE_SET_ATTEMPTS = 3
SCIPION_UPDATE_SET_ATTEMPT_WAIT = 2
SCIPION_URL = 'https://scipion.cnb.csic.es/downloads/scipion'
SCIPION_URL_SOFTWARE = 'https://scipion.cnb.csic.es/downloads/scipion/software'
SCIPION_URL_TESTDATA = 'https://scipion.cnb.csic.es/downloads/scipion/data/tests'
SCIPION_USER_DATA = '/home/buildbot/ScipionUserData'
SCIPION_USE_QUEUE = False
VIEWERS = {}
classmethod colorsInTerminal()[source]

Returns true if colors are allowed. Based on NO_COLOR variable. Undefined or ‘’ colors are enabled

static debugOn()[source]

Returns a True if debug mode (SCIPION_DEBUG variable) is active

static debugSQLOn()[source]
classmethod getActiveColor()[source]

Returns a color lighter than the SCIPION_MAIN_COLOR

classmethod getBindingsFolder()[source]

Folder where bindings must be placed. This folder is added to sys.path at launching time. If the binding depends on a dynamic libraries, those must be placed at cls.getLibFolder() :return: The bindings folder

classmethod getDomain()[source]

Import domain module from path or name defined in SCIPION_DOMAIN.

classmethod getExternalJsonTemplates()[source]
classmethod getLibFolder()[source]
Returns

Folder where libraries must be placed in case a binding needs them

classmethod getLogsFolder()[source]

Folder where scipion logs must be placed. The folder is created

classmethod getPriorityPackageList()[source]
static getPythonLibFolder()[source]
classmethod getStepsCheckSeconds()[source]
classmethod getUpdateSetAttempts()[source]
classmethod getUpdateSetAttemptsWait()[source]
classmethod getVars()[source]

Return a dictionary with all variables defined in this Config.

classmethod getWizardMaskColor()[source]

Color is a name

classmethod isScipionRunning()[source]

Returns true if this execution is understood to be running Scipion. In some case, documentation inspection by sphynx or when packaging a plugin using setup.py this code could be reached but is not an actual execution. This is useful for cancelling some actions like registering FileHandlers or other stuff not needed when just importing modules.

classmethod refreshInThreads()[source]
classmethod setDomain(moduleOrNameOrPath)[source]
static toggleDebug()[source]
static toggleDebugSQL()[source]
class pyworkflow.config.VarTypes(value)[source]

Bases: Enum

An enumeration.

BOOLEAN = 1
DECIMAL = 4
FILENAME = 5
FOLDER = 6
INTEGER = 3
PATH = 2
STRING = 0
class pyworkflow.config.Variable(name, description, source, value, default, var_type: VarTypes = VarTypes.STRING, isDefault=None)[source]

Bases: object

setToDefault()[source]
setValue(new_value)[source]
class pyworkflow.config.VariablesRegistry[source]

Bases: object

classmethod register(variable: Variable)[source]
classmethod save(path)[source]

Saves the variables in the path specified

classmethod variables()[source]
pyworkflow.config.findResource(filename)[source]
pyworkflow.config.genNotesHeading()[source]
pyworkflow.config.getAppsPath(*paths)[source]
pyworkflow.config.getModuleFolder(moduleName)[source]

Returns the path of a module without importing it

pyworkflow.config.getPyworkflowPath()[source]

Returns the path where pyworkflow is

pyworkflow.config.getResourcesPath(file=None)[source]
pyworkflow.config.getScheduleScript()[source]
pyworkflow.config.getSyncDataScript()[source]
pyworkflow.config.getTestsScript()[source]
pyworkflow.config.getViewerScript()[source]
pyworkflow.config.join(*paths)[source]

join paths from HOME .

pyworkflow.config.validColor(colorname)[source]

If it can be converted to rgb is a valid color