The Virtual Brain Project

Table Of Contents

Previous topic

basic Package

Next topic

filters Package

This Page

config Package

environment

Environment related checks or operations are to be defined here.

class tvb.basic.config.environment.Environment[source]
IS_WORK_IN_PROGRESS = False
append_to_path(*paths)[source]

Set PATH :param paths: list of absolute folder paths to join and add BEFORE the current PATH

get_library_folder(default_mac)[source]

Return top level library folder. Will be use for setting paths

static is_development()[source]

Return True when TVB is used with Python installed natively.

is_framework_present()[source]
Returns:True when framework classes are present and can be imported.
is_linux()[source]
is_linux_deployment()[source]

Return True if current run is not development and is running on Linux.

static is_mac()[source]
is_mac_deployment()[source]

Return True if current run is not development and is running on Mac OS X

static is_windows()[source]
is_windows_deployment()[source]

Return True if current run is not development and is running on Windows.

setup_python_path(*paths)[source]

Set PYTHONPATH :param paths: list of absolute folder paths to join.

setup_tk_tcl_environ(root_folder)[source]

Given a root folder to look in, find the required configuration files for TCL/TK and set the proper environmental variables so everything works fine in the distribution package.

Parameters:root_folder – the top folder from which to start looking for the required configuration files

profile_settings

Prepare TVB settings to be grouped under various profile classes.

class tvb.basic.config.profile_settings.BaseSettingsProfile(web_enabled=True)[source]

Bases: object

ACCESS_MODE_TVB_FILES = 484
BIN_FOLDER[source]

Return path towards tvb_bin location. It will be used in some environment for determining the starting point

DEFAULT_STORAGE = '/home/tester/TVB/'
FIRST_RUN_STORAGE = '/home/tester/.tvb-temp'
LOGGER_CONFIG_FILE_NAME = 'logger_config.conf'
MAGIC_NUMBER = 9
PYTHON_INTERPRETER_PATH[source]

Get Python path, based on current environment.

TVB_CONFIG_FILE = '/home/tester/.tvb.configuration'
TVB_USER_HOME = '~'
initialize_for_deployment()[source]
initialize_profile()[source]

Make sure tvb folders are created.

prepare_for_operation_mode()[source]

Overwrite PostgreSQL number of connections when executed in the context of a node.

class tvb.basic.config.profile_settings.LibrarySettingsProfile[source]

Bases: tvb.basic.config.profile_settings.BaseSettingsProfile

Profile used when scientific library is used without storage and without web UI.

LOGGER_CONFIG_FILE_NAME = 'library_logger.conf'
TVB_STORAGE = '/home/tester/TVB/'
initialize_profile()[source]

Make sure some warning are thrown when trying to import from framework.

class tvb.basic.config.profile_settings.MATLABLibraryProfile[source]

Bases: tvb.basic.config.profile_settings.LibrarySettingsProfile

Profile use library use from MATLAB.

LOGGER_CONFIG_FILE_NAME = None
class tvb.basic.config.profile_settings.TestLibraryProfile[source]

Bases: tvb.basic.config.profile_settings.LibrarySettingsProfile

Profile for library unit-tests.

LOGGER_CONFIG_FILE_NAME = 'library_logger_test.conf'

settings

TVB Raw Settings are defined here, grouped by their category of usage (e.g. cluster related, web related, etc). Do not instantiate these classes directly, but rather use them through TvpProfile.current instance.

class tvb.basic.config.settings.ClusterSettings(manager)[source]

Bases: object

Cluster related settings.

CLUSTER_NODE_NAME[source]
:return the name of the cluster on which TVB code is executed.
If code is executed on a normal machine (not cluster node) returns None
IN_OPERATION_EXECUTION_PROCESS = False
IS_RUNNING_ON_CLUSTER_NODE[source]

Returns True if current execution happens on cluster node. Even when IS_DEPLOY is True, this call will return False for the web machine.

JOB_ID_STRING = 'OAR_JOB_ID='
NODE_ENV = 'OAR_NODEFILE'
SCHEDULE_COMMAND = 'oarsub -q tvb -S "/home/tvbadmin/clusterLauncher %s %s" -l walltime=%s'
STATUS_COMMAND = 'oarstat %s'
STOP_COMMAND = 'oardel %s'
class tvb.basic.config.settings.DBSettings(manager, default_storage, current_storage)[source]

Bases: object

ALLOW_NESTED_TRANSACTIONS = False
MAX_ASYNC_CONNECTIONS = 2
MAX_CONNECTIONS = 20
class tvb.basic.config.settings.VersionSettings(manager, bin_folder)[source]

Bases: object

Gather settings related to various version numbers of TVB application

BASE_VERSION = '1.5.4'
DATA_VERSION = 4
DATA_VERSION_ATTRIBUTE = 'Data_version'
DB_STRUCTURE_VERSION = 17
PROJECT_VERSION = 2
SVN_VERSION[source]

Current SVN version in the package running now.

class tvb.basic.config.settings.WebAdminSettings(manager)[source]

Bases: object

Setting related to the default users of web-tvb

ADMINISTRATOR_BLANK_PWD = 'pass'
DEFAULT_ADMIN_EMAIL = 'jira.tvb@gmail.com'
SYSTEM_USER_NAME = 'TVB system'
class tvb.basic.config.settings.WebSettings(manager, enabled)[source]

Bases: object

Web related specifications

ENABLED = False
LOCALHOST = '127.0.0.1'
RENDER_HTML = True
VISUALIZERS_ROOT = 'tvb.interfaces.web.templates.genshi.visualizers'
VISUALIZERS_URL_PREFIX = '/flow/read_datatype_attribute/'

stored

Manages reading and writing settings in file

class tvb.basic.config.stored.SettingsManager(config_file_location)[source]

Bases: object

add_entries_to_config_file(input_data)[source]

Add to the dictionary of settings already existent in the settings file.

Parameters:input_data – A dictionary of pairs that need to be added to the config file.
get_attribute(key, default=None, dtype=<type 'str'>)[source]

Get a cfg attribute that could also be found in the settings file.

is_first_run()[source]
write_config_data(config_dict)[source]

Overwrite anything already existent in the config file

utils

Helper tools, for the configuration area.

class tvb.basic.config.utils.EnhancedDictionary[source]

Bases: dict

A dictionary like class that provides easy access to configuration values.

exception tvb.basic.config.utils.LibraryImportError[source]

Bases: exceptions.ImportError

This is just a flag telling us at “reload” that a module was rejected due to our custom exception

class tvb.basic.config.utils.LibraryModulesFinder[source]

In case users run TVB in ‘library’ profile access should be restricted to some parts of tvb, to avoid errors from those parts (which are not excepted to run with library settings).

find_module(fullname, path=None)[source]
load_module(module_name)[source]
restricted_modules = ['tvb.interfaces', 'tvb.datatype_removers', 'tvb.core', 'tvb.config', 'tvb.adapters']