TheVirtualBrain:

TheDocumentationwebsite.

Table Of Contents

Previous topic

entities Package

Next topic

file_update_scripts Package

This Page

file Package

files_update_manager

Manager for the file storage version updates.

class tvb.core.entities.file.files_update_manager.FilesUpdateManager[source]

Bases: tvb.core.code_versions.base_classes.UpdateManager

Manager for updating H5 files version, when code gets changed.

DATA_TYPES_PAGE_SIZE = 500
MESSAGE = 'Done'
PROJECTS_PAGE_SIZE = 20
STATUS = True
UPDATE_SCRIPTS_SUFFIX = '_update_files'
static get_all_h5_paths()[source]

This method returns a list of all h5 files and it is used in the migration from version 4 to 5. The h5 files inside a certain project are retrieved in numerical order (1, 2, 3 etc.).

get_file_data_version(file_path)[source]

Return the data version for the given file.

Parameters:file_path – the path on disk to the file for which you need the TVB data version
Returns:a number representing the data version for which the input file was written
is_file_up_to_date(file_path)[source]

Returns True only if the data version of the file is equal with the data version specified into the TVB configuration file.

run_all_updates()[source]

Upgrades all the data types from TVB storage to the latest data version.

Returns:a two entry tuple (status, message) where status is a boolean that is True in case the upgrade was successfully for all DataTypes and False otherwise, and message is a status update message.
upgrade_file(input_file_name, datatype=None, burst_match_dict=None)[source]

Upgrades the given file to the latest data version. The file will be upgraded sequentially, up until the current version from tvb.basic.config.settings.VersionSettings.DB_STRUCTURE_VERSION

:param input_file_name the path to the file which needs to be upgraded :return True when update was successful and False when it resulted in an error.