VersionFile

vtool.util_file.VersionFile(filepath) Convenience to version a file or folder.
class VersionFile(filepath)

Convenience to version a file or folder.

Parameters:filepath (str) – The path to the file to version.
save_comment(comment=None, version_file=None)

Save a comment to a log file.

Parameters:
  • comment (str) –
  • version_file (str) – The corresponding version file.
save(comment=None)

Save a version.

Parameters:comment (str) – The comment to add to the version.
Returns:The new version file name
Return type:str
has_versions()
set_version_folder(folder_path)

Set the folder where the version folder should be created.

Parameters:folder_path (str) – Full path to where the version folder should be created.
set_version_folder_name(name)

Set the name of the version folder.

Parameters:name (str) –
set_version_name(name)

Set the version name.

Parameters:name (str) – The name of the version.
get_version_path(version_int)

Get the path to a version.

Parameters:version_int (int) – The version number.
Returns:The path to the version.
Return type:str
get_version_comment(version_int)

Get the version comment.

Parameters:version_int (int) – The version number.
Returns:The version comment.
Return type:str
get_organized_version_data()
get_version_data(version_int)

Get the version data. Comment and user.

Parameters:version_int (int) – The version number.
Returns:(comment, user)
Return type:tuple
get_version_numbers()
get_versions(return_version_numbers_also=False)

Get filepaths of all versions.

Returns:List of version filepaths.
Return type:list
get_latest_version()

Get the filepath to the latest version.

Returns:Filepath to latest version.
Return type:str