plugin_tools
AYON plugin tools.
prepare_template_data(fill_pairs)
Prepares formatted data for filling template.
It produces multiple variants of keys (key, Key, KEY) to control format of filled template.
Example
src_data = { ... "host": "maya", ... } output = prepare_template_data(src_data) sorted(list(output.items())) # sort & list conversion for tests [('HOST', 'MAYA'), ('Host', 'Maya'), ('host', 'maya')]
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fill_pairs | Union[dict[str, Any], Iterable[Tuple[str, Any]]] | The value that are prepared for template. | required |
Returns:
Type | Description |
---|---|
dict[str, str]: Prepared values for template. |
Source code in client/ayon_core/lib/plugin_tools.py
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 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 |
|
source_hash(filepath, *args)
Generate simple identifier for a source file. This is used to identify whether a source file has previously been processe into the pipeline, e.g. a texture. The hash is based on source filepath, modification time and file size. This is only used to identify whether a specific source file was already published before from the same location with the same modification date. We opt to do it this way as opposed to Avalanch C4 hash as this is much faster and predictable enough for all our production use cases. Args: filepath (str): The source file path. You can specify additional arguments in the function to allow for specific 'processing' values to be included.
Source code in client/ayon_core/lib/plugin_tools.py
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 |
|