Ayon-Python-Api 0.5.0__tar.gz → 0.5.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {ayon-python-api-0.5.0 → ayon-python-api-0.5.2}/PKG-INFO +1 -1
- {ayon-python-api-0.5.0 → ayon-python-api-0.5.2}/ayon_api/entity_hub.py +23 -2
- {ayon-python-api-0.5.0 → ayon-python-api-0.5.2}/ayon_api/server_api.py +9 -6
- {ayon-python-api-0.5.0 → ayon-python-api-0.5.2}/ayon_api/version.py +1 -1
- {ayon-python-api-0.5.0 → ayon-python-api-0.5.2}/ayon_python_api.egg-info/PKG-INFO +1 -1
- {ayon-python-api-0.5.0 → ayon-python-api-0.5.2}/pyproject.toml +1 -1
- {ayon-python-api-0.5.0 → ayon-python-api-0.5.2}/LICENSE +0 -0
- {ayon-python-api-0.5.0 → ayon-python-api-0.5.2}/README.md +0 -0
- {ayon-python-api-0.5.0 → ayon-python-api-0.5.2}/ayon_api/__init__.py +0 -0
- {ayon-python-api-0.5.0 → ayon-python-api-0.5.2}/ayon_api/_api.py +0 -0
- {ayon-python-api-0.5.0 → ayon-python-api-0.5.2}/ayon_api/constants.py +0 -0
- {ayon-python-api-0.5.0 → ayon-python-api-0.5.2}/ayon_api/events.py +0 -0
- {ayon-python-api-0.5.0 → ayon-python-api-0.5.2}/ayon_api/exceptions.py +0 -0
- {ayon-python-api-0.5.0 → ayon-python-api-0.5.2}/ayon_api/graphql.py +0 -0
- {ayon-python-api-0.5.0 → ayon-python-api-0.5.2}/ayon_api/graphql_queries.py +0 -0
- {ayon-python-api-0.5.0 → ayon-python-api-0.5.2}/ayon_api/operations.py +0 -0
- {ayon-python-api-0.5.0 → ayon-python-api-0.5.2}/ayon_api/utils.py +0 -0
- {ayon-python-api-0.5.0 → ayon-python-api-0.5.2}/ayon_python_api.egg-info/SOURCES.txt +0 -0
- {ayon-python-api-0.5.0 → ayon-python-api-0.5.2}/ayon_python_api.egg-info/dependency_links.txt +0 -0
- {ayon-python-api-0.5.0 → ayon-python-api-0.5.2}/ayon_python_api.egg-info/requires.txt +0 -0
- {ayon-python-api-0.5.0 → ayon-python-api-0.5.2}/ayon_python_api.egg-info/top_level.txt +0 -0
- {ayon-python-api-0.5.0 → ayon-python-api-0.5.2}/setup.cfg +0 -0
- {ayon-python-api-0.5.0 → ayon-python-api-0.5.2}/setup.py +0 -0
|
@@ -40,7 +40,13 @@ class EntityHub(object):
|
|
|
40
40
|
):
|
|
41
41
|
if not connection:
|
|
42
42
|
connection = get_server_api_connection()
|
|
43
|
+
major, minor, _, _, _ = connection.server_version_tuple
|
|
44
|
+
path_start_with_slash = True
|
|
45
|
+
if (major, minor) < (0, 6):
|
|
46
|
+
path_start_with_slash = False
|
|
47
|
+
|
|
43
48
|
self._connection = connection
|
|
49
|
+
self._path_start_with_slash = path_start_with_slash
|
|
44
50
|
|
|
45
51
|
self._project_name = project_name
|
|
46
52
|
self._entities_by_id = {}
|
|
@@ -65,6 +71,18 @@ class EntityHub(object):
|
|
|
65
71
|
|
|
66
72
|
return self._allow_data_changes
|
|
67
73
|
|
|
74
|
+
@property
|
|
75
|
+
def path_start_with_slash(self):
|
|
76
|
+
"""Folder path should start with slash.
|
|
77
|
+
|
|
78
|
+
This changed in 0.6.x server version.
|
|
79
|
+
|
|
80
|
+
Returns:
|
|
81
|
+
bool: Path starts with slash.
|
|
82
|
+
"""
|
|
83
|
+
|
|
84
|
+
return self._path_start_with_slash
|
|
85
|
+
|
|
68
86
|
@property
|
|
69
87
|
def project_name(self):
|
|
70
88
|
"""Project name which is maintained by hub.
|
|
@@ -2419,10 +2437,13 @@ class FolderEntity(BaseEntity):
|
|
|
2419
2437
|
|
|
2420
2438
|
if self._path is None:
|
|
2421
2439
|
parent = self.parent
|
|
2422
|
-
path = self.name
|
|
2423
2440
|
if parent.entity_type == "folder":
|
|
2424
2441
|
parent_path = parent.path
|
|
2425
|
-
path = "/".join([parent_path,
|
|
2442
|
+
path = "/".join([parent_path, self.name])
|
|
2443
|
+
elif self._entity_hub.path_start_with_slash:
|
|
2444
|
+
path = "/{}".format(self.name)
|
|
2445
|
+
else:
|
|
2446
|
+
path = self.name
|
|
2426
2447
|
self._path = path
|
|
2427
2448
|
return self._path
|
|
2428
2449
|
|
|
@@ -176,6 +176,11 @@ class RestApiResponse(object):
|
|
|
176
176
|
return self.status
|
|
177
177
|
|
|
178
178
|
def raise_for_status(self, message=None):
|
|
179
|
+
if self._response is None:
|
|
180
|
+
if self._data and self._data.get("detail"):
|
|
181
|
+
raise ServerError(self._data["detail"])
|
|
182
|
+
raise ValueError("Response is not available.")
|
|
183
|
+
|
|
179
184
|
try:
|
|
180
185
|
self._response.raise_for_status()
|
|
181
186
|
except requests.exceptions.HTTPError as exc:
|
|
@@ -655,13 +660,10 @@ class ServerAPI(object):
|
|
|
655
660
|
as default variant.
|
|
656
661
|
|
|
657
662
|
Args:
|
|
658
|
-
variant (
|
|
663
|
+
variant (str): Settings variant name. It is possible to use
|
|
664
|
+
'production', 'staging' or name of dev bundle.
|
|
659
665
|
"""
|
|
660
666
|
|
|
661
|
-
if variant not in ("production", "staging"):
|
|
662
|
-
raise ValueError((
|
|
663
|
-
"Invalid variant name {}. Expected 'production' or 'staging'"
|
|
664
|
-
).format(variant))
|
|
665
667
|
self._default_settings_variant = variant
|
|
666
668
|
|
|
667
669
|
default_settings_variant = property(
|
|
@@ -1515,8 +1517,9 @@ class ServerAPI(object):
|
|
|
1515
1517
|
"sourceTopic": source_topic,
|
|
1516
1518
|
"targetTopic": target_topic,
|
|
1517
1519
|
"sender": sender,
|
|
1518
|
-
"maxRetries": max_retries,
|
|
1519
1520
|
}
|
|
1521
|
+
if max_retries is not None:
|
|
1522
|
+
kwargs["maxRetries"] = max_retries
|
|
1520
1523
|
if sequential is not None:
|
|
1521
1524
|
kwargs["sequential"] = sequential
|
|
1522
1525
|
if description is not None:
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"""Package declaring Python API for Ayon server."""
|
|
2
|
-
__version__ = "0.5.
|
|
2
|
+
__version__ = "0.5.2"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ayon-python-api-0.5.0 → ayon-python-api-0.5.2}/ayon_python_api.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|