ayon-python-api 1.2.9__tar.gz → 1.2.11__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-1.2.9 → ayon_python_api-1.2.11}/PKG-INFO +1 -1
- {ayon_python_api-1.2.9 → ayon_python_api-1.2.11}/ayon_api/_api_helpers/bundles_addons.py +5 -3
- {ayon_python_api-1.2.9 → ayon_python_api-1.2.11}/ayon_api/_api_helpers/dependency_packages.py +2 -2
- {ayon_python_api-1.2.9 → ayon_python_api-1.2.11}/ayon_api/_api_helpers/installers.py +2 -2
- {ayon_python_api-1.2.9 → ayon_python_api-1.2.11}/ayon_api/_api_helpers/links.py +6 -1
- {ayon_python_api-1.2.9 → ayon_python_api-1.2.11}/ayon_api/_api_helpers/thumbnails.py +4 -4
- {ayon_python_api-1.2.9 → ayon_python_api-1.2.11}/ayon_api/server_api.py +64 -19
- {ayon_python_api-1.2.9 → ayon_python_api-1.2.11}/ayon_api/utils.py +20 -2
- {ayon_python_api-1.2.9 → ayon_python_api-1.2.11}/ayon_api/version.py +1 -1
- {ayon_python_api-1.2.9 → ayon_python_api-1.2.11}/ayon_python_api.egg-info/PKG-INFO +1 -1
- {ayon_python_api-1.2.9 → ayon_python_api-1.2.11}/pyproject.toml +1 -1
- {ayon_python_api-1.2.9 → ayon_python_api-1.2.11}/LICENSE +0 -0
- {ayon_python_api-1.2.9 → ayon_python_api-1.2.11}/README.md +0 -0
- {ayon_python_api-1.2.9 → ayon_python_api-1.2.11}/ayon_api/__init__.py +0 -0
- {ayon_python_api-1.2.9 → ayon_python_api-1.2.11}/ayon_api/_api.py +0 -0
- {ayon_python_api-1.2.9 → ayon_python_api-1.2.11}/ayon_api/_api_helpers/__init__.py +0 -0
- {ayon_python_api-1.2.9 → ayon_python_api-1.2.11}/ayon_api/_api_helpers/actions.py +0 -0
- {ayon_python_api-1.2.9 → ayon_python_api-1.2.11}/ayon_api/_api_helpers/activities.py +0 -0
- {ayon_python_api-1.2.9 → ayon_python_api-1.2.11}/ayon_api/_api_helpers/attributes.py +0 -0
- {ayon_python_api-1.2.9 → ayon_python_api-1.2.11}/ayon_api/_api_helpers/base.py +0 -0
- {ayon_python_api-1.2.9 → ayon_python_api-1.2.11}/ayon_api/_api_helpers/events.py +0 -0
- {ayon_python_api-1.2.9 → ayon_python_api-1.2.11}/ayon_api/_api_helpers/folders.py +0 -0
- {ayon_python_api-1.2.9 → ayon_python_api-1.2.11}/ayon_api/_api_helpers/lists.py +0 -0
- {ayon_python_api-1.2.9 → ayon_python_api-1.2.11}/ayon_api/_api_helpers/products.py +0 -0
- {ayon_python_api-1.2.9 → ayon_python_api-1.2.11}/ayon_api/_api_helpers/projects.py +0 -0
- {ayon_python_api-1.2.9 → ayon_python_api-1.2.11}/ayon_api/_api_helpers/representations.py +0 -0
- {ayon_python_api-1.2.9 → ayon_python_api-1.2.11}/ayon_api/_api_helpers/secrets.py +0 -0
- {ayon_python_api-1.2.9 → ayon_python_api-1.2.11}/ayon_api/_api_helpers/tasks.py +0 -0
- {ayon_python_api-1.2.9 → ayon_python_api-1.2.11}/ayon_api/_api_helpers/versions.py +0 -0
- {ayon_python_api-1.2.9 → ayon_python_api-1.2.11}/ayon_api/_api_helpers/workfiles.py +0 -0
- {ayon_python_api-1.2.9 → ayon_python_api-1.2.11}/ayon_api/constants.py +0 -0
- {ayon_python_api-1.2.9 → ayon_python_api-1.2.11}/ayon_api/entity_hub.py +0 -0
- {ayon_python_api-1.2.9 → ayon_python_api-1.2.11}/ayon_api/events.py +0 -0
- {ayon_python_api-1.2.9 → ayon_python_api-1.2.11}/ayon_api/exceptions.py +0 -0
- {ayon_python_api-1.2.9 → ayon_python_api-1.2.11}/ayon_api/graphql.py +0 -0
- {ayon_python_api-1.2.9 → ayon_python_api-1.2.11}/ayon_api/graphql_queries.py +0 -0
- {ayon_python_api-1.2.9 → ayon_python_api-1.2.11}/ayon_api/operations.py +0 -0
- {ayon_python_api-1.2.9 → ayon_python_api-1.2.11}/ayon_api/typing.py +0 -0
- {ayon_python_api-1.2.9 → ayon_python_api-1.2.11}/ayon_python_api.egg-info/SOURCES.txt +0 -0
- {ayon_python_api-1.2.9 → ayon_python_api-1.2.11}/ayon_python_api.egg-info/dependency_links.txt +0 -0
- {ayon_python_api-1.2.9 → ayon_python_api-1.2.11}/ayon_python_api.egg-info/requires.txt +0 -0
- {ayon_python_api-1.2.9 → ayon_python_api-1.2.11}/ayon_python_api.egg-info/top_level.txt +0 -0
- {ayon_python_api-1.2.9 → ayon_python_api-1.2.11}/setup.cfg +0 -0
- {ayon_python_api-1.2.9 → ayon_python_api-1.2.11}/setup.py +0 -0
- {ayon_python_api-1.2.9 → ayon_python_api-1.2.11}/tests/test_entity_hub.py +0 -0
- {ayon_python_api-1.2.9 → ayon_python_api-1.2.11}/tests/test_folder_hierarchy.py +0 -0
- {ayon_python_api-1.2.9 → ayon_python_api-1.2.11}/tests/test_get_events.py +0 -0
- {ayon_python_api-1.2.9 → ayon_python_api-1.2.11}/tests/test_graphql_queries.py +0 -0
- {ayon_python_api-1.2.9 → ayon_python_api-1.2.11}/tests/test_server.py +0 -0
|
@@ -398,7 +398,7 @@ class BundlesAddonsAPI(BaseServerAPI):
|
|
|
398
398
|
|
|
399
399
|
"""
|
|
400
400
|
response = self.upload_file(
|
|
401
|
-
"addons/install",
|
|
401
|
+
"api/addons/install",
|
|
402
402
|
src_filepath,
|
|
403
403
|
progress=progress,
|
|
404
404
|
request_type=RequestTypes.post,
|
|
@@ -448,9 +448,11 @@ class BundlesAddonsAPI(BaseServerAPI):
|
|
|
448
448
|
"private",
|
|
449
449
|
filename
|
|
450
450
|
)
|
|
451
|
-
url = f"{self.get_base_url()}/{endpoint}"
|
|
452
451
|
self.download_file(
|
|
453
|
-
|
|
452
|
+
endpoint,
|
|
453
|
+
dst_filepath,
|
|
454
|
+
chunk_size=chunk_size,
|
|
455
|
+
progress=progress,
|
|
454
456
|
)
|
|
455
457
|
return dst_filepath
|
|
456
458
|
|
{ayon_python_api-1.2.9 → ayon_python_api-1.2.11}/ayon_api/_api_helpers/dependency_packages.py
RENAMED
|
@@ -189,7 +189,7 @@ class DependencyPackagesAPI(BaseServerAPI):
|
|
|
189
189
|
route = self._get_dependency_package_route(src_filename)
|
|
190
190
|
package_filepath = os.path.join(dst_directory, dst_filename)
|
|
191
191
|
self.download_file(
|
|
192
|
-
route,
|
|
192
|
+
f"api/{route}",
|
|
193
193
|
package_filepath,
|
|
194
194
|
chunk_size=chunk_size,
|
|
195
195
|
progress=progress
|
|
@@ -225,7 +225,7 @@ class DependencyPackagesAPI(BaseServerAPI):
|
|
|
225
225
|
)
|
|
226
226
|
|
|
227
227
|
route = self._get_dependency_package_route(dst_filename)
|
|
228
|
-
self.upload_file(route, src_filepath, progress=progress)
|
|
228
|
+
self.upload_file(f"api/{route}", src_filepath, progress=progress)
|
|
229
229
|
|
|
230
230
|
def _get_dependency_package_route(
|
|
231
231
|
self, filename: Optional[str] = None
|
|
@@ -143,7 +143,7 @@ class InstallersAPI(BaseServerAPI):
|
|
|
143
143
|
|
|
144
144
|
"""
|
|
145
145
|
return self.download_file(
|
|
146
|
-
f"desktop/installers/{filename}",
|
|
146
|
+
f"api/desktop/installers/{filename}",
|
|
147
147
|
dst_filepath,
|
|
148
148
|
chunk_size=chunk_size,
|
|
149
149
|
progress=progress
|
|
@@ -168,7 +168,7 @@ class InstallersAPI(BaseServerAPI):
|
|
|
168
168
|
|
|
169
169
|
"""
|
|
170
170
|
return self.upload_file(
|
|
171
|
-
f"desktop/installers/{dst_filename}",
|
|
171
|
+
f"api/desktop/installers/{dst_filename}",
|
|
172
172
|
src_filepath,
|
|
173
173
|
progress=progress
|
|
174
174
|
)
|
|
@@ -203,6 +203,7 @@ class LinksAPI(BaseServerAPI):
|
|
|
203
203
|
output_id: str,
|
|
204
204
|
output_type: str,
|
|
205
205
|
link_name: Optional[str] = None,
|
|
206
|
+
data: Optional[dict[str, Any]] = None,
|
|
206
207
|
) -> CreateLinkData:
|
|
207
208
|
"""Create link between 2 entities.
|
|
208
209
|
|
|
@@ -222,7 +223,8 @@ class LinksAPI(BaseServerAPI):
|
|
|
222
223
|
output_id (str): Output entity id.
|
|
223
224
|
output_type (str): Entity type of output entity.
|
|
224
225
|
link_name (Optional[str]): Name of link.
|
|
225
|
-
|
|
226
|
+
data (Optional[dict[str, Any]]): Additional data to be stored
|
|
227
|
+
with the link.
|
|
226
228
|
|
|
227
229
|
Returns:
|
|
228
230
|
CreateLinkData: Information about link.
|
|
@@ -242,6 +244,9 @@ class LinksAPI(BaseServerAPI):
|
|
|
242
244
|
if link_name:
|
|
243
245
|
kwargs["name"] = link_name
|
|
244
246
|
|
|
247
|
+
if data:
|
|
248
|
+
kwargs["data"] = data
|
|
249
|
+
|
|
245
250
|
response = self.post(
|
|
246
251
|
f"projects/{project_name}/links", **kwargs
|
|
247
252
|
)
|
|
@@ -256,7 +256,7 @@ class ThumbnailsAPI(BaseServerAPI):
|
|
|
256
256
|
|
|
257
257
|
mime_type = get_media_mime_type(src_filepath)
|
|
258
258
|
response = self.upload_file(
|
|
259
|
-
f"projects/{project_name}/thumbnails",
|
|
259
|
+
f"api/projects/{project_name}/thumbnails",
|
|
260
260
|
src_filepath,
|
|
261
261
|
request_type=RequestTypes.post,
|
|
262
262
|
headers={"Content-Type": mime_type},
|
|
@@ -295,7 +295,7 @@ class ThumbnailsAPI(BaseServerAPI):
|
|
|
295
295
|
|
|
296
296
|
mime_type = get_media_mime_type_for_stream(stream)
|
|
297
297
|
response = self.upload_file_from_stream(
|
|
298
|
-
f"projects/{project_name}/thumbnails",
|
|
298
|
+
f"api/projects/{project_name}/thumbnails",
|
|
299
299
|
stream,
|
|
300
300
|
request_type=RequestTypes.post,
|
|
301
301
|
headers={"Content-Type": mime_type},
|
|
@@ -325,7 +325,7 @@ class ThumbnailsAPI(BaseServerAPI):
|
|
|
325
325
|
|
|
326
326
|
mime_type = get_media_mime_type(src_filepath)
|
|
327
327
|
response = self.upload_file(
|
|
328
|
-
f"projects/{project_name}/thumbnails/{thumbnail_id}",
|
|
328
|
+
f"api/projects/{project_name}/thumbnails/{thumbnail_id}",
|
|
329
329
|
src_filepath,
|
|
330
330
|
request_type=RequestTypes.put,
|
|
331
331
|
headers={"Content-Type": mime_type},
|
|
@@ -351,7 +351,7 @@ class ThumbnailsAPI(BaseServerAPI):
|
|
|
351
351
|
"""
|
|
352
352
|
mime_type = get_media_mime_type_for_stream(stream)
|
|
353
353
|
response = self.upload_file_from_stream(
|
|
354
|
-
f"projects/{project_name}/thumbnails/{thumbnail_id}",
|
|
354
|
+
f"api/projects/{project_name}/thumbnails/{thumbnail_id}",
|
|
355
355
|
stream,
|
|
356
356
|
request_type=RequestTypes.put,
|
|
357
357
|
headers={"Content-Type": mime_type},
|
|
@@ -1352,7 +1352,7 @@ class ServerAPI(
|
|
|
1352
1352
|
|
|
1353
1353
|
def _download_file_to_stream(
|
|
1354
1354
|
self,
|
|
1355
|
-
|
|
1355
|
+
endpoint: str,
|
|
1356
1356
|
stream: StreamType,
|
|
1357
1357
|
chunk_size: int,
|
|
1358
1358
|
progress: TransferProgress,
|
|
@@ -1367,7 +1367,11 @@ class ServerAPI(
|
|
|
1367
1367
|
else:
|
|
1368
1368
|
get_func = self._session_functions_mapping[RequestTypes.get]
|
|
1369
1369
|
|
|
1370
|
+
url = self._endpoint_to_url(endpoint, use_rest=False)
|
|
1371
|
+
progress.set_source_url(url)
|
|
1372
|
+
|
|
1370
1373
|
retries = self.get_default_max_retries()
|
|
1374
|
+
api_prepended = False
|
|
1371
1375
|
for attempt in range(retries):
|
|
1372
1376
|
# Continue in download
|
|
1373
1377
|
offset = progress.get_transferred_size()
|
|
@@ -1376,6 +1380,18 @@ class ServerAPI(
|
|
|
1376
1380
|
|
|
1377
1381
|
try:
|
|
1378
1382
|
with get_func(url, **kwargs) as response:
|
|
1383
|
+
# Auto-fix missing 'api/'
|
|
1384
|
+
if response.status_code == 405 and not api_prepended:
|
|
1385
|
+
api_prepended = True
|
|
1386
|
+
if (
|
|
1387
|
+
not endpoint.startswith(self._base_url)
|
|
1388
|
+
and not endpoint.startswith("api/")
|
|
1389
|
+
):
|
|
1390
|
+
url = self._endpoint_to_url(
|
|
1391
|
+
endpoint, use_rest=True
|
|
1392
|
+
)
|
|
1393
|
+
progress.set_destination_url(url)
|
|
1394
|
+
continue
|
|
1379
1395
|
response.raise_for_status()
|
|
1380
1396
|
if progress.get_content_size() is None:
|
|
1381
1397
|
progress.set_content_size(
|
|
@@ -1395,6 +1411,12 @@ class ServerAPI(
|
|
|
1395
1411
|
raise
|
|
1396
1412
|
progress.next_attempt()
|
|
1397
1413
|
|
|
1414
|
+
if api_prepended:
|
|
1415
|
+
self.log.warning(
|
|
1416
|
+
f"Auto-fixed endpoint '{endpoint}' -> 'api/{endpoint}'."
|
|
1417
|
+
" Please fix the endpoit passed to the function."
|
|
1418
|
+
)
|
|
1419
|
+
|
|
1398
1420
|
def download_file_to_stream(
|
|
1399
1421
|
self,
|
|
1400
1422
|
endpoint: str,
|
|
@@ -1427,17 +1449,14 @@ class ServerAPI(
|
|
|
1427
1449
|
if not chunk_size:
|
|
1428
1450
|
chunk_size = self.default_download_chunk_size
|
|
1429
1451
|
|
|
1430
|
-
url = self._endpoint_to_url(endpoint, use_rest=False)
|
|
1431
|
-
|
|
1432
1452
|
if progress is None:
|
|
1433
1453
|
progress = TransferProgress()
|
|
1434
1454
|
|
|
1435
|
-
progress.set_source_url(url)
|
|
1436
1455
|
progress.set_started()
|
|
1437
1456
|
|
|
1438
1457
|
try:
|
|
1439
1458
|
self._download_file_to_stream(
|
|
1440
|
-
|
|
1459
|
+
endpoint, stream, chunk_size, progress
|
|
1441
1460
|
)
|
|
1442
1461
|
|
|
1443
1462
|
except Exception as exc:
|
|
@@ -1585,13 +1604,7 @@ class ServerAPI(
|
|
|
1585
1604
|
bytes: Chunk of file.
|
|
1586
1605
|
|
|
1587
1606
|
"""
|
|
1588
|
-
# Get size of file
|
|
1589
|
-
file_stream.seek(0, io.SEEK_END)
|
|
1590
|
-
size = file_stream.tell()
|
|
1591
1607
|
file_stream.seek(0)
|
|
1592
|
-
# Set content size to progress object
|
|
1593
|
-
progress.set_content_size(size)
|
|
1594
|
-
|
|
1595
1608
|
while True:
|
|
1596
1609
|
chunk = file_stream.read(chunk_size)
|
|
1597
1610
|
if not chunk:
|
|
@@ -1601,7 +1614,7 @@ class ServerAPI(
|
|
|
1601
1614
|
|
|
1602
1615
|
def _upload_file(
|
|
1603
1616
|
self,
|
|
1604
|
-
|
|
1617
|
+
endpoint: str,
|
|
1605
1618
|
stream: StreamType,
|
|
1606
1619
|
progress: TransferProgress,
|
|
1607
1620
|
request_type: Optional[RequestType] = None,
|
|
@@ -1611,7 +1624,7 @@ class ServerAPI(
|
|
|
1611
1624
|
"""Upload file to server.
|
|
1612
1625
|
|
|
1613
1626
|
Args:
|
|
1614
|
-
|
|
1627
|
+
endpoint (str): Endpoint used to upload.
|
|
1615
1628
|
stream (StreamType): File stream.
|
|
1616
1629
|
progress (TransferProgress): Object that gives ability to track
|
|
1617
1630
|
progress.
|
|
@@ -1629,6 +1642,10 @@ class ServerAPI(
|
|
|
1629
1642
|
if request_type is None:
|
|
1630
1643
|
request_type = RequestTypes.put
|
|
1631
1644
|
|
|
1645
|
+
endpoint = endpoint.lstrip("/")
|
|
1646
|
+
url = self._endpoint_to_url(endpoint, use_rest=False)
|
|
1647
|
+
progress.set_destination_url(url)
|
|
1648
|
+
|
|
1632
1649
|
if self._session is None:
|
|
1633
1650
|
headers = kwargs.setdefault("headers", {})
|
|
1634
1651
|
for key, value in self.get_headers().items():
|
|
@@ -1643,6 +1660,14 @@ class ServerAPI(
|
|
|
1643
1660
|
|
|
1644
1661
|
retries = self.get_default_max_retries()
|
|
1645
1662
|
response = None
|
|
1663
|
+
|
|
1664
|
+
# Get size of file
|
|
1665
|
+
stream.seek(0, io.SEEK_END)
|
|
1666
|
+
size = stream.tell()
|
|
1667
|
+
# Set content size to progress object
|
|
1668
|
+
progress.set_content_size(size)
|
|
1669
|
+
|
|
1670
|
+
api_prepended = False
|
|
1646
1671
|
for attempt in range(retries):
|
|
1647
1672
|
try:
|
|
1648
1673
|
response = post_func(
|
|
@@ -1652,6 +1677,16 @@ class ServerAPI(
|
|
|
1652
1677
|
),
|
|
1653
1678
|
**kwargs
|
|
1654
1679
|
)
|
|
1680
|
+
# Auto-fix missing 'api/'
|
|
1681
|
+
if response.status_code == 405 and not api_prepended:
|
|
1682
|
+
api_prepended = True
|
|
1683
|
+
if (
|
|
1684
|
+
not endpoint.startswith(self._base_url)
|
|
1685
|
+
and not endpoint.startswith("api/")
|
|
1686
|
+
):
|
|
1687
|
+
url = self._endpoint_to_url(endpoint, use_rest=True)
|
|
1688
|
+
progress.set_destination_url(url)
|
|
1689
|
+
continue
|
|
1655
1690
|
break
|
|
1656
1691
|
|
|
1657
1692
|
except (
|
|
@@ -1664,6 +1699,11 @@ class ServerAPI(
|
|
|
1664
1699
|
progress.reset_transferred()
|
|
1665
1700
|
|
|
1666
1701
|
response.raise_for_status()
|
|
1702
|
+
if api_prepended:
|
|
1703
|
+
self.log.warning(
|
|
1704
|
+
f"Auto-fixed endpoint '{endpoint}' -> 'api/{endpoint}'."
|
|
1705
|
+
" Please fix the endpoit passed to the function."
|
|
1706
|
+
)
|
|
1667
1707
|
return response
|
|
1668
1708
|
|
|
1669
1709
|
def upload_file_from_stream(
|
|
@@ -1694,19 +1734,20 @@ class ServerAPI(
|
|
|
1694
1734
|
requests.Response: Response object
|
|
1695
1735
|
|
|
1696
1736
|
"""
|
|
1697
|
-
url = self._endpoint_to_url(endpoint)
|
|
1698
|
-
|
|
1699
1737
|
# Create dummy object so the function does not have to check
|
|
1700
1738
|
# 'progress' variable everywhere
|
|
1701
1739
|
if progress is None:
|
|
1702
1740
|
progress = TransferProgress()
|
|
1703
1741
|
|
|
1704
|
-
progress.set_destination_url(url)
|
|
1705
1742
|
progress.set_started()
|
|
1706
1743
|
|
|
1707
1744
|
try:
|
|
1708
1745
|
return self._upload_file(
|
|
1709
|
-
|
|
1746
|
+
endpoint,
|
|
1747
|
+
stream,
|
|
1748
|
+
progress,
|
|
1749
|
+
request_type,
|
|
1750
|
+
**kwargs
|
|
1710
1751
|
)
|
|
1711
1752
|
|
|
1712
1753
|
except Exception as exc:
|
|
@@ -1751,7 +1792,11 @@ class ServerAPI(
|
|
|
1751
1792
|
|
|
1752
1793
|
with open(filepath, "rb") as stream:
|
|
1753
1794
|
return self.upload_file_from_stream(
|
|
1754
|
-
endpoint,
|
|
1795
|
+
endpoint,
|
|
1796
|
+
stream,
|
|
1797
|
+
progress,
|
|
1798
|
+
request_type,
|
|
1799
|
+
**kwargs
|
|
1755
1800
|
)
|
|
1756
1801
|
|
|
1757
1802
|
def upload_reviewable(
|
|
@@ -1813,7 +1858,7 @@ class ServerAPI(
|
|
|
1813
1858
|
|
|
1814
1859
|
query = prepare_query_string({"label": label or None})
|
|
1815
1860
|
endpoint = (
|
|
1816
|
-
f"/projects/{project_name}"
|
|
1861
|
+
f"api/projects/{project_name}"
|
|
1817
1862
|
f"/versions/{version_id}/reviewables{query}"
|
|
1818
1863
|
)
|
|
1819
1864
|
return self.upload_file(
|
|
@@ -4,6 +4,8 @@ import os
|
|
|
4
4
|
import re
|
|
5
5
|
import datetime
|
|
6
6
|
import copy
|
|
7
|
+
import logging
|
|
8
|
+
import json
|
|
7
9
|
import uuid
|
|
8
10
|
import string
|
|
9
11
|
import platform
|
|
@@ -101,8 +103,9 @@ def _get_description(response):
|
|
|
101
103
|
return HTTPStatus(response.status).description
|
|
102
104
|
|
|
103
105
|
|
|
104
|
-
class RestApiResponse
|
|
106
|
+
class RestApiResponse:
|
|
105
107
|
"""API Response."""
|
|
108
|
+
log = logging.getLogger("RestApiResponse")
|
|
106
109
|
|
|
107
110
|
def __init__(self, response, data=None):
|
|
108
111
|
if response is None:
|
|
@@ -134,7 +137,7 @@ class RestApiResponse(object):
|
|
|
134
137
|
if self._data is None:
|
|
135
138
|
try:
|
|
136
139
|
self._data = self.orig_response.json()
|
|
137
|
-
except RequestsJSONDecodeError:
|
|
140
|
+
except (AttributeError, RequestsJSONDecodeError):
|
|
138
141
|
self._data = {}
|
|
139
142
|
return self._data
|
|
140
143
|
|
|
@@ -178,6 +181,21 @@ class RestApiResponse(object):
|
|
|
178
181
|
except requests.exceptions.HTTPError as exc:
|
|
179
182
|
if message is None:
|
|
180
183
|
message = str(exc)
|
|
184
|
+
|
|
185
|
+
submsg = ""
|
|
186
|
+
if self.data:
|
|
187
|
+
submsg = json.dumps(self.data, indent=4)
|
|
188
|
+
|
|
189
|
+
self.log.warning(
|
|
190
|
+
"HTTP request error: %s%s%s",
|
|
191
|
+
message,
|
|
192
|
+
"\n" if submsg else "",
|
|
193
|
+
submsg,
|
|
194
|
+
)
|
|
195
|
+
|
|
196
|
+
detail = self.data.get("detail")
|
|
197
|
+
if detail:
|
|
198
|
+
message = f"{message} ({detail})"
|
|
181
199
|
raise HTTPRequestError(message, exc.response)
|
|
182
200
|
|
|
183
201
|
def __enter__(self, *args, **kwargs):
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"""Package declaring Python API for AYON server."""
|
|
2
|
-
__version__ = "1.2.
|
|
2
|
+
__version__ = "1.2.11"
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{ayon_python_api-1.2.9 → ayon_python_api-1.2.11}/ayon_python_api.egg-info/dependency_links.txt
RENAMED
|
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
|