abstract
FileItem
File item that represents a file.
Can be used for both Workarea and Published workfile. Workarea file will always exist on disk which is not the case for Published workfile.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dirpath | str | Directory path of file. | required |
filename | str | Filename. | required |
modified | float | Modified timestamp. | required |
created_by | Optional[str] | Username. | None |
representation_id | Optional[str] | Representation id of published workfile. | None |
filepath | Optional[str] | Prepared filepath. | None |
exists | Optional[bool] | If file exists on disk. | None |
Source code in client/ayon_wrap/workfiles/abstract.py
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | |
exists property
File is available.
Returns:
| Name | Type | Description |
|---|---|---|
bool | If file exists on disk. |
filepath property
Filepath of file.
Returns:
| Name | Type | Description |
|---|---|---|
str | Full path to a file. |
from_data(data) classmethod
Re-creates file item from data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data | dict[str, Any] | File item data. | required |
Returns:
| Name | Type | Description |
|---|---|---|
FileItem | File item. |
Source code in client/ayon_wrap/workfiles/abstract.py
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | |
to_data()
Converts file item to data.
Returns:
| Type | Description |
|---|---|
| dict[str, Any]: File item data. |
Source code in client/ayon_wrap/workfiles/abstract.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | |