Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions stubs/ftrack_api/__init__.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from ._version import __version__ as __version__
from .session import Session as Session
from _typeshed import Incomplete

def mixin(instance, mixin_class, name: Incomplete | None = None) -> None: ...
25 changes: 25 additions & 0 deletions stubs/ftrack_api/_centralized_storage_scenario.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from _typeshed import Incomplete

scenario_name: str

class ConfigureCentralizedStorageScenario:
logger: Incomplete
def __init__(self) -> None: ...
@property
def storage_scenario(self): ...
@property
def existing_centralized_storage_configuration(self): ...
def configure_scenario(self, event): ...
def discover_centralized_scenario(self, event): ...
session: Incomplete
def register(self, session) -> None: ...

class ActivateCentralizedStorageScenario:
logger: Incomplete
def __init__(self) -> None: ...
def activate(self, event) -> None: ...
session: Incomplete
def register(self, session) -> None: ...

def register(session) -> None: ...
def register_configuration(session) -> None: ...
46 changes: 46 additions & 0 deletions stubs/ftrack_api/_python_ntpath.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
from genericpath import *
from _typeshed import Incomplete
from nt import _isdir as isdir

__all__ = ['normcase', 'isabs', 'join', 'splitdrive', 'split', 'splitext', 'basename', 'dirname', 'commonprefix', 'getsize', 'getmtime', 'getatime', 'getctime', 'islink', 'exists', 'lexists', 'isdir', 'isfile', 'ismount', 'walk', 'expanduser', 'expandvars', 'normpath', 'abspath', 'splitunc', 'curdir', 'pardir', 'sep', 'pathsep', 'defpath', 'altsep', 'extsep', 'devnull', 'realpath', 'supports_unicode_filenames', 'relpath']

curdir: str
pardir: str
extsep: str
sep: str
pathsep: str
altsep: str
defpath: str
devnull: str

def normcase(s): ...
def isabs(s): ...
def join(a, *p): ...
def splitdrive(p): ...
def splitunc(p): ...
def split(p): ...
def splitext(p): ...
def basename(p): ...
def dirname(p): ...
def islink(path): ...
lexists = exists

def ismount(path): ...
def walk(top, func, arg) -> None: ...
def expanduser(path): ...
def expandvars(path): ...
def normpath(path): ...
def abspath(path): ...
realpath = abspath
supports_unicode_filenames: Incomplete

def relpath(path, start=...): ...

# Names in __all__ with no definition:
# commonprefix
# exists
# getatime
# getctime
# getmtime
# getsize
# isfile
1 change: 1 addition & 0 deletions stubs/ftrack_api/_version.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__: str
Empty file.
25 changes: 25 additions & 0 deletions stubs/ftrack_api/accessor/base.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import abc

class Accessor(metaclass=abc.ABCMeta):
def __init__(self) -> None: ...
@abc.abstractmethod
def list(self, resource_identifier): ...
@abc.abstractmethod
def exists(self, resource_identifier): ...
@abc.abstractmethod
def is_file(self, resource_identifier): ...
@abc.abstractmethod
def is_container(self, resource_identifier): ...
@abc.abstractmethod
def is_sequence(self, resource_identifier): ...
@abc.abstractmethod
def open(self, resource_identifier, mode: str = 'rb'): ...
@abc.abstractmethod
def remove(self, resource_identifier): ...
@abc.abstractmethod
def make_container(self, resource_identifier, recursive: bool = True): ...
@abc.abstractmethod
def get_container(self, resource_identifier): ...
def remove_container(self, resource_identifier): ...
def get_filesystem_path(self, resource_identifier) -> None: ...
def get_url(self, resource_identifier) -> None: ...
20 changes: 20 additions & 0 deletions stubs/ftrack_api/accessor/disk.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import ftrack_api.accessor.base
from _typeshed import Incomplete
from collections.abc import Generator
from ftrack_api.exception import AccessorContainerNotEmptyError as AccessorContainerNotEmptyError, AccessorFilesystemPathError as AccessorFilesystemPathError, AccessorOperationFailedError as AccessorOperationFailedError, AccessorParentResourceNotFoundError as AccessorParentResourceNotFoundError, AccessorPermissionDeniedError as AccessorPermissionDeniedError, AccessorResourceInvalidError as AccessorResourceInvalidError, AccessorResourceNotFoundError as AccessorResourceNotFoundError, AccessorUnsupportedOperationError as AccessorUnsupportedOperationError

class DiskAccessor(ftrack_api.accessor.base.Accessor):
prefix: Incomplete
def __init__(self, prefix, **kw) -> None: ...
def list(self, resource_identifier): ...
def exists(self, resource_identifier): ...
def is_file(self, resource_identifier): ...
def is_container(self, resource_identifier): ...
def is_sequence(self, resource_identifier) -> None: ...
def open(self, resource_identifier, mode: str = 'rb'): ...
def remove(self, resource_identifier) -> None: ...
def make_container(self, resource_identifier, recursive: bool = True) -> None: ...
def get_container(self, resource_identifier): ...
def get_filesystem_path(self, resource_identifier): ...

def error_handler(**kw) -> Generator[None]: ...
24 changes: 24 additions & 0 deletions stubs/ftrack_api/accessor/server.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from ..data import String as String
from .base import Accessor as Accessor
from _typeshed import Incomplete

class ServerFile(String):
mode: Incomplete
resource_identifier: Incomplete
def __init__(self, resource_identifier, session, mode: str = 'rb') -> None: ...
def flush(self) -> None: ...
def read(self, limit: Incomplete | None = None): ...

class _ServerAccessor(Accessor):
def __init__(self, session, **kw) -> None: ...
def open(self, resource_identifier, mode: str = 'rb'): ...
def remove(self, resourceIdentifier) -> None: ...
def get_container(self, resource_identifier) -> None: ...
def make_container(self, resource_identifier, recursive: bool = True) -> None: ...
def list(self, resource_identifier) -> None: ...
def exists(self, resource_identifier): ...
def is_file(self, resource_identifier) -> None: ...
def is_container(self, resource_identifier) -> None: ...
def is_sequence(self, resource_identifier) -> None: ...
def get_url(self, resource_identifier): ...
def get_thumbnail_url(self, resource_identifier, size: Incomplete | None = None): ...
65 changes: 65 additions & 0 deletions stubs/ftrack_api/attribute.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import ftrack_api.collection
from _typeshed import Incomplete

logger: Incomplete

def merge_references(function): ...

class Attributes:
def __init__(self, attributes: Incomplete | None = None) -> None: ...
def add(self, attribute) -> None: ...
def remove(self, attribute) -> None: ...
def get(self, name): ...
def keys(self): ...
def __contains__(self, item) -> bool: ...
def __iter__(self): ...
def __len__(self) -> int: ...

class Attribute:
default_value: Incomplete
def __init__(self, name, default_value=..., mutable: bool = True, computed: bool = False) -> None: ...
def get_entity_storage(self, entity): ...
@property
def name(self): ...
@property
def mutable(self): ...
@property
def computed(self): ...
def get_value(self, entity): ...
def get_local_value(self, entity): ...
def get_remote_value(self, entity): ...
def set_local_value(self, entity, value) -> None: ...
def set_remote_value(self, entity, value) -> None: ...
def populate_remote_value(self, entity) -> None: ...
def is_modified(self, entity): ...
def is_set(self, entity): ...

class ScalarAttribute(Attribute):
data_type: Incomplete
def __init__(self, name, data_type, **kw) -> None: ...

class ReferenceAttribute(Attribute):
entity_type: Incomplete
def __init__(self, name, entity_type, **kw) -> None: ...
def populate_remote_value(self, entity) -> None: ...
def is_modified(self, entity): ...
def get_value(self, entity): ...

class AbstractCollectionAttribute(Attribute):
collection_class: Incomplete
def get_value(self, entity): ...
def set_local_value(self, entity, value) -> None: ...
def set_remote_value(self, entity, value) -> None: ...

class CollectionAttribute(AbstractCollectionAttribute):
collection_class = ftrack_api.collection.Collection

class KeyValueMappedCollectionAttribute(AbstractCollectionAttribute):
collection_class = ftrack_api.collection.KeyValueMappedCollectionProxy
creator: Incomplete
key_attribute: Incomplete
value_attribute: Incomplete
def __init__(self, name, creator, key_attribute, value_attribute, **kw) -> None: ...

class CustomAttributeCollectionAttribute(AbstractCollectionAttribute):
collection_class = ftrack_api.collection.CustomAttributeCollectionProxy
78 changes: 78 additions & 0 deletions stubs/ftrack_api/cache.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
import abc
from _typeshed import Incomplete

class Cache(metaclass=abc.ABCMeta):
@abc.abstractmethod
def get(self, key): ...
@abc.abstractmethod
def set(self, key, value): ...
@abc.abstractmethod
def remove(self, key): ...
def keys(self) -> None: ...
def values(self): ...
def clear(self, pattern: Incomplete | None = None) -> None: ...

class ProxyCache(Cache):
proxied: Incomplete
def __init__(self, proxied) -> None: ...
def get(self, key): ...
def set(self, key, value): ...
def remove(self, key): ...
def keys(self): ...

class LayeredCache(Cache):
caches: Incomplete
def __init__(self, caches) -> None: ...
def get(self, key): ...
def set(self, key, value) -> None: ...
def remove(self, key) -> None: ...
def keys(self): ...

class MemoryCache(Cache):
def __init__(self) -> None: ...
def get(self, key): ...
def set(self, key, value) -> None: ...
def remove(self, key) -> None: ...
def keys(self): ...

class FileCache(Cache):
path: Incomplete
def __init__(self, path) -> None: ...
def get(self, key): ...
def set(self, key, value) -> None: ...
def remove(self, key) -> None: ...
def keys(self): ...

class SerialisedCache(ProxyCache):
encode: Incomplete
decode: Incomplete
def __init__(self, proxied, encode: Incomplete | None = None, decode: Incomplete | None = None) -> None: ...
def get(self, key): ...
def set(self, key, value) -> None: ...

class KeyMaker(metaclass=abc.ABCMeta):
item_separator: str
def __init__(self) -> None: ...
def key(self, *items): ...

class StringKeyMaker(KeyMaker): ...

class ObjectKeyMaker(KeyMaker):
item_separator: bytes
mapping_identifier: bytes
mapping_pair_separator: bytes
iterable_identifier: bytes
name_identifier: bytes
def __init__(self) -> None: ...

class Memoiser:
cache: Incomplete
key_maker: Incomplete
return_copies: Incomplete
def __init__(self, cache: Incomplete | None = None, key_maker: Incomplete | None = None, return_copies: bool = True) -> None: ...
def call(self, function, args: Incomplete | None = None, kw: Incomplete | None = None): ...

def memoise_decorator(memoiser): ...

memoiser: Incomplete
memoise: Incomplete
61 changes: 61 additions & 0 deletions stubs/ftrack_api/collection.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import abc
import collections.abc
import ftrack_api.cache
from _typeshed import Incomplete

class Collection(collections.abc.MutableSequence):
entity: Incomplete
attribute: Incomplete
mutable: bool
def __init__(self, entity, attribute, mutable: bool = True, data: Incomplete | None = None) -> None: ...
def __copy__(self): ...
def insert(self, index, item) -> None: ...
def __contains__(self, value) -> bool: ...
def __getitem__(self, index): ...
def __setitem__(self, index, item) -> None: ...
def __delitem__(self, index) -> None: ...
def __len__(self) -> int: ...
def __eq__(self, other): ...
def __ne__(self, other): ...

class MappedCollectionProxy(collections.abc.MutableMapping, metaclass=abc.ABCMeta):
logger: Incomplete
collection: Incomplete
def __init__(self, collection) -> None: ...
def __copy__(self): ...
@property
def mutable(self): ...
@mutable.setter
def mutable(self, value) -> None: ...
@property
def attribute(self): ...
@attribute.setter
def attribute(self, value) -> None: ...

class KeyValueMappedCollectionProxy(MappedCollectionProxy):
creator: Incomplete
key_attribute: Incomplete
value_attribute: Incomplete
def __init__(self, collection, creator, key_attribute, value_attribute) -> None: ...
def __getitem__(self, key): ...
def __setitem__(self, key, value) -> None: ...
def __delitem__(self, key) -> None: ...
def __iter__(self): ...
def __len__(self) -> int: ...
def keys(self): ...

class PerSessionDefaultKeyMaker(ftrack_api.cache.KeyMaker): ...

memoise_session: Incomplete

class CustomAttributeCollectionProxy(MappedCollectionProxy):
key_attribute: str
value_attribute: str
def __init__(self, collection) -> None: ...
def get_configuration_id_from_key(self, key): ...
def __getitem__(self, key): ...
def __setitem__(self, key, value) -> None: ...
def __delitem__(self, key) -> None: ...
def __eq__(self, collection): ...
def __iter__(self): ...
def __len__(self) -> int: ...
33 changes: 33 additions & 0 deletions stubs/ftrack_api/data.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
from _typeshed import Incomplete
from abc import ABCMeta, abstractmethod

class Data(metaclass=ABCMeta):
closed: bool
def __init__(self) -> None: ...
@abstractmethod
def read(self, limit: Incomplete | None = None): ...
@abstractmethod
def write(self, content): ...
def flush(self) -> None: ...
def seek(self, offset, whence=...) -> None: ...
def tell(self) -> None: ...
def close(self) -> None: ...

class FileWrapper(Data):
wrapped_file: Incomplete
def __init__(self, wrapped_file) -> None: ...
def read(self, limit: Incomplete | None = None): ...
def write(self, content) -> None: ...
def flush(self) -> None: ...
def seek(self, offset, whence=...) -> None: ...
def tell(self): ...
def close(self) -> None: ...

class File(FileWrapper):
def __init__(self, path, mode: str = 'rb') -> None: ...

class String(FileWrapper):
is_binary: bool
def __init__(self, content: Incomplete | None = None) -> None: ...
def write(self, content) -> None: ...
def read(self, limit: Incomplete | None = None): ...
Empty file.
Loading
Loading