ftrack_api.accessor.disk
- class ftrack_api.accessor.disk.DiskAccessor(prefix, **kw)[source]
Provide disk access to a location.
Expect resource identifiers to refer to relative filesystem paths.
- __init__(prefix, **kw)[source]
Initialise location accessor.
prefix specifies the base folder for the disk based structure and will be prepended to any path. It should be specified in the syntax of the current OS.
- list(resource_identifier)[source]
Return list of entries in resource_identifier container.
Each entry in the returned list should be a valid resource identifier.
Raise
AccessorResourceNotFoundError
if resource_identifier does not exist orAccessorResourceInvalidError
if resource_identifier is not a container.
- is_container(resource_identifier)[source]
Return whether resource_identifier refers to a container.
- is_sequence(resource_identifier)[source]
Return whether resource_identifier refers to a file sequence.
- remove(resource_identifier)[source]
Remove resource_identifier.
Raise
AccessorResourceNotFoundError
if resource_identifier does not exist.
- make_container(resource_identifier, recursive=True)[source]
Make a container at resource_identifier.
If recursive is True, also make any intermediate containers.
- get_container(resource_identifier)[source]
Return resource_identifier of container for resource_identifier.
Raise
AccessorParentResourceNotFoundError
if container of resource_identifier could not be determined.
- get_filesystem_path(resource_identifier)[source]
Return filesystem path for resource_identifier.
For example:
>>> accessor = DiskAccessor('my.location', '/mountpoint') >>> print accessor.get_filesystem_path('test.txt') /mountpoint/test.txt >>> print accessor.get_filesystem_path('/mountpoint/test.txt') /mountpoint/test.txt
Raise
ftrack_api.exception.AccessorFilesystemPathError
if filesystem path could not be determined from resource_identifier.
- get_url(resource_identifier)
Return URL for resource_identifier.
Raise
AccessorFilesystemPathError
if URL could not be determined from resource_identifier orAccessorUnsupportedOperationError
if retrieving URL is not supported by this accessor.
- remove_container(resource_identifier)
Remove container at resource_identifier.