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
AccessorResourceNotFoundErrorif resource_identifier does not exist orAccessorResourceInvalidErrorif 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
AccessorResourceNotFoundErrorif 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
AccessorParentResourceNotFoundErrorif 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.AccessorFilesystemPathErrorif filesystem path could not be determined from resource_identifier.
- get_url(resource_identifier)
Return URL for resource_identifier.
Raise
AccessorFilesystemPathErrorif URL could not be determined from resource_identifier orAccessorUnsupportedOperationErrorif retrieving URL is not supported by this accessor.
- remove_container(resource_identifier)
Remove container at resource_identifier.