ayon-python-api 1.1.1__tar.gz → 1.1.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.
Files changed (24) hide show
  1. {ayon-python-api-1.1.1 → ayon-python-api-1.1.2}/PKG-INFO +1 -1
  2. {ayon-python-api-1.1.1 → ayon-python-api-1.1.2}/ayon_api/server_api.py +12 -4
  3. {ayon-python-api-1.1.1 → ayon-python-api-1.1.2}/ayon_api/utils.py +11 -0
  4. {ayon-python-api-1.1.1 → ayon-python-api-1.1.2}/ayon_api/version.py +1 -1
  5. {ayon-python-api-1.1.1 → ayon-python-api-1.1.2}/ayon_python_api.egg-info/PKG-INFO +1 -1
  6. {ayon-python-api-1.1.1 → ayon-python-api-1.1.2}/pyproject.toml +2 -2
  7. {ayon-python-api-1.1.1 → ayon-python-api-1.1.2}/LICENSE +0 -0
  8. {ayon-python-api-1.1.1 → ayon-python-api-1.1.2}/README.md +0 -0
  9. {ayon-python-api-1.1.1 → ayon-python-api-1.1.2}/ayon_api/__init__.py +0 -0
  10. {ayon-python-api-1.1.1 → ayon-python-api-1.1.2}/ayon_api/_api.py +0 -0
  11. {ayon-python-api-1.1.1 → ayon-python-api-1.1.2}/ayon_api/constants.py +0 -0
  12. {ayon-python-api-1.1.1 → ayon-python-api-1.1.2}/ayon_api/entity_hub.py +0 -0
  13. {ayon-python-api-1.1.1 → ayon-python-api-1.1.2}/ayon_api/events.py +0 -0
  14. {ayon-python-api-1.1.1 → ayon-python-api-1.1.2}/ayon_api/exceptions.py +0 -0
  15. {ayon-python-api-1.1.1 → ayon-python-api-1.1.2}/ayon_api/graphql.py +0 -0
  16. {ayon-python-api-1.1.1 → ayon-python-api-1.1.2}/ayon_api/graphql_queries.py +0 -0
  17. {ayon-python-api-1.1.1 → ayon-python-api-1.1.2}/ayon_api/operations.py +0 -0
  18. {ayon-python-api-1.1.1 → ayon-python-api-1.1.2}/ayon_api/typing.py +0 -0
  19. {ayon-python-api-1.1.1 → ayon-python-api-1.1.2}/ayon_python_api.egg-info/SOURCES.txt +0 -0
  20. {ayon-python-api-1.1.1 → ayon-python-api-1.1.2}/ayon_python_api.egg-info/dependency_links.txt +0 -0
  21. {ayon-python-api-1.1.1 → ayon-python-api-1.1.2}/ayon_python_api.egg-info/requires.txt +0 -0
  22. {ayon-python-api-1.1.1 → ayon-python-api-1.1.2}/ayon_python_api.egg-info/top_level.txt +0 -0
  23. {ayon-python-api-1.1.1 → ayon-python-api-1.1.2}/setup.cfg +0 -0
  24. {ayon-python-api-1.1.1 → ayon-python-api-1.1.2}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ayon-python-api
3
- Version: 1.1.1
3
+ Version: 1.1.2
4
4
  Summary: AYON Python API
5
5
  Home-page: https://github.com/ynput/ayon-python-api
6
6
  Author: ynput.io
@@ -96,6 +96,7 @@ from .utils import (
96
96
  NOT_SET,
97
97
  get_media_mime_type,
98
98
  SortOrder,
99
+ get_machine_name,
99
100
  )
100
101
 
101
102
  if typing.TYPE_CHECKING:
@@ -1187,8 +1188,13 @@ class ServerAPI(object):
1187
1188
 
1188
1189
  for parsed_data in query.continuous_query(self):
1189
1190
  for user in parsed_data["users"]:
1190
- user["accessGroups"] = json.loads(
1191
- user["accessGroups"])
1191
+ access_groups = user.get("accessGroups")
1192
+ if isinstance(access_groups, str):
1193
+ user["accessGroups"] = json.loads(access_groups)
1194
+ all_attrib = user.get("allAttrib")
1195
+ if isinstance(all_attrib, str):
1196
+ user["allAttrib"] = json.loads(all_attrib)
1197
+ fill_own_attribs(user)
1192
1198
  yield user
1193
1199
 
1194
1200
  def get_user_by_name(
@@ -1245,7 +1251,9 @@ class ServerAPI(object):
1245
1251
 
1246
1252
  response = self.get(f"users/{username}")
1247
1253
  response.raise_for_status()
1248
- return response.data
1254
+ user = response.data
1255
+ fill_own_attribs(user)
1256
+ return user
1249
1257
 
1250
1258
  def get_headers(
1251
1259
  self, content_type: Optional[str] = None
@@ -1256,7 +1264,7 @@ class ServerAPI(object):
1256
1264
  headers = {
1257
1265
  "Content-Type": content_type,
1258
1266
  "x-ayon-platform": platform.system().lower(),
1259
- "x-ayon-hostname": platform.node(),
1267
+ "x-ayon-hostname": get_machine_name(),
1260
1268
  "referer": self.get_base_url(),
1261
1269
  }
1262
1270
  if self._site_id is not None:
@@ -89,6 +89,17 @@ def get_default_settings_variant() -> str:
89
89
  return os.environ.get(DEFAULT_VARIANT_ENV_KEY) or "production"
90
90
 
91
91
 
92
+ def get_machine_name() -> str:
93
+ """Get machine name.
94
+
95
+ Returns:
96
+ str: Machine name.
97
+
98
+ """
99
+ return platform.node()
100
+ return unidecode.unidecode(platform.node())
101
+
102
+
92
103
  def get_default_site_id() -> Optional[str]:
93
104
  """Site id used for server connection.
94
105
 
@@ -1,2 +1,2 @@
1
1
  """Package declaring Python API for AYON server."""
2
- __version__ = "1.1.1"
2
+ __version__ = "1.1.2"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ayon-python-api
3
- Version: 1.1.1
3
+ Version: 1.1.2
4
4
  Summary: AYON Python API
5
5
  Home-page: https://github.com/ynput/ayon-python-api
6
6
  Author: ynput.io
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "ayon-python-api"
3
- version = "1.1.1"
3
+ version = "1.1.2"
4
4
  description = "AYON Python API"
5
5
  license = {file = "LICENSE"}
6
6
  readme = {file = "README.md", content-type = "text/markdown"}
@@ -28,7 +28,7 @@ build-backend = "poetry.core.masonry.api"
28
28
 
29
29
  [tool.poetry]
30
30
  name = "ayon-python-api"
31
- version = "1.1.1"
31
+ version = "1.1.2"
32
32
  description = "AYON Python API"
33
33
  authors = [
34
34
  "ynput.io <info@ynput.io>"
File without changes