META

RamMetaDataManager

A Class to get/set metadata from files.

Ramses will use a single sidecar file named _ramses_data.json (storing data in json) for all files located in a given folder;
thus the metadata used by Ramses is set on a per-folder basis, and is not copied when a file is copied/moved: it does not make sense for Ramses to have the same metadata when a file is moved.

The Meta-Data structure

The Meta-Data used by Ramses contains at least these attributes.

Key Name Type Default Value Description
MetaDataKeys.COMMENT string "" A comment associated to the file
MetaDataKeys.PIPE_TYPE int "" The type of the pipe associated to the file
MetaDataKeys.VERSION int -1 A version associated to the file
MetaDataKeys.VERSION_FILE string "" A version file associated to the file

Static Methods

Method Arguments Description
getComment
string
string: filePath Gets the comment associated to the file.
getDate
datetime
string: filePath Gets the date associated to the file.
getFileMetaData
object or dict
string: filePath Gets the meta-data of the given file.
getMetaData
object or dict
string: folderPath Gets the meta-data of all the files for the given folder.
Each file name is used as a key in the returned object.
getMetaDataFile
string
string: path Gets the path of the file containing the metadata for the given file or folder.
getPipeType
string
string: filePath Gets the type of the pipe which created this file (if it has previously been set by the addon using setPipeType()).
getState
string
string: filePath Gets the state short name of the file.
getValue
any
string: filePath,
string: key
Gets the value of a specific key for the file.
getVersion
int
string: filePath Gets the version associated to the file.
getVersionFilePath
string
string: filePath Gets the version file associated to the file.
setComment
string
string: filePath,
string: comment
Sets the comment associated to a file.
setDate
string
string: filePath,
date or datetime or int or string: date
Sets the date associated to a file.
setFileMetaData
string: filePath,
object or dict: fileData
Writes the given meta-data to the meta-data file associated to this file.
setMetaData
string: path,
object or dict: data
Writes the given meta-data to the meta-data file associated to this folder.
setPipeType
string: filePath,
string: pipeType
Sets the pipe which created the file. The value should be the short name of the pipe.
setState
string: filePath,
string: state
Sets the state for the file.
setValue string: filePath,
string: key,
any: value
Sets the value of a specific key for the file.
setVersion string: filePath,
int: version
Sets the version associated to the file.
setVersionFilePath string: filePath,
string: versionFilePath
Sets the version file associated to the file.