Ayon-Python-Api 0.3.2__py3-none-any.whl → 0.3.4__py3-none-any.whl
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_api/__init__.py +4 -0
- ayon_api/_api.py +30 -34
- ayon_api/entity_hub.py +744 -4
- ayon_api/server_api.py +187 -22
- ayon_api/utils.py +131 -8
- ayon_api/version.py +1 -1
- {ayon_python_api-0.3.2.dist-info → ayon_python_api-0.3.4.dist-info}/METADATA +2 -3
- ayon_python_api-0.3.4.dist-info/RECORD +18 -0
- {ayon_python_api-0.3.2.dist-info → ayon_python_api-0.3.4.dist-info}/WHEEL +1 -1
- ayon_python_api-0.3.2.dist-info/RECORD +0 -18
- {ayon_python_api-0.3.2.dist-info → ayon_python_api-0.3.4.dist-info}/LICENSE +0 -0
- {ayon_python_api-0.3.2.dist-info → ayon_python_api-0.3.4.dist-info}/top_level.txt +0 -0
ayon_api/__init__.py
CHANGED
|
@@ -78,6 +78,8 @@ from ._api import (
|
|
|
78
78
|
download_dependency_package,
|
|
79
79
|
upload_dependency_package,
|
|
80
80
|
|
|
81
|
+
upload_addon_zip,
|
|
82
|
+
|
|
81
83
|
get_bundles,
|
|
82
84
|
create_bundle,
|
|
83
85
|
update_bundle,
|
|
@@ -262,6 +264,8 @@ __all__ = (
|
|
|
262
264
|
"download_dependency_package",
|
|
263
265
|
"upload_dependency_package",
|
|
264
266
|
|
|
267
|
+
"upload_addon_zip",
|
|
268
|
+
|
|
265
269
|
"get_bundles",
|
|
266
270
|
"create_bundle",
|
|
267
271
|
"update_bundle",
|
ayon_api/_api.py
CHANGED
|
@@ -25,12 +25,29 @@ class GlobalServerAPI(ServerAPI):
|
|
|
25
25
|
but that can be filled afterwards with calling 'login' method.
|
|
26
26
|
"""
|
|
27
27
|
|
|
28
|
-
def __init__(
|
|
28
|
+
def __init__(
|
|
29
|
+
self,
|
|
30
|
+
site_id=None,
|
|
31
|
+
client_version=None,
|
|
32
|
+
default_settings_variant=None,
|
|
33
|
+
ssl_verify=None,
|
|
34
|
+
cert=None,
|
|
35
|
+
):
|
|
29
36
|
url = self.get_url()
|
|
30
37
|
token = self.get_token()
|
|
31
38
|
|
|
32
|
-
super(GlobalServerAPI, self).__init__(
|
|
33
|
-
|
|
39
|
+
super(GlobalServerAPI, self).__init__(
|
|
40
|
+
url,
|
|
41
|
+
token,
|
|
42
|
+
site_id,
|
|
43
|
+
client_version,
|
|
44
|
+
default_settings_variant,
|
|
45
|
+
ssl_verify,
|
|
46
|
+
cert,
|
|
47
|
+
# We want to make sure that server and api key validation
|
|
48
|
+
# happens all the time in 'GlobalServerAPI'.
|
|
49
|
+
create_session=False,
|
|
50
|
+
)
|
|
34
51
|
self.validate_server_availability()
|
|
35
52
|
self.create_session()
|
|
36
53
|
|
|
@@ -129,17 +146,6 @@ class ServiceContext:
|
|
|
129
146
|
addon_version = None
|
|
130
147
|
service_name = None
|
|
131
148
|
|
|
132
|
-
@staticmethod
|
|
133
|
-
def get_value_from_envs(env_keys, value=None):
|
|
134
|
-
if value:
|
|
135
|
-
return value
|
|
136
|
-
|
|
137
|
-
for env_key in env_keys:
|
|
138
|
-
value = os.environ.get(env_key)
|
|
139
|
-
if value:
|
|
140
|
-
break
|
|
141
|
-
return value
|
|
142
|
-
|
|
143
149
|
@classmethod
|
|
144
150
|
def init_service(
|
|
145
151
|
cls,
|
|
@@ -150,14 +156,8 @@ class ServiceContext:
|
|
|
150
156
|
service_name=None,
|
|
151
157
|
connect=True
|
|
152
158
|
):
|
|
153
|
-
token =
|
|
154
|
-
|
|
155
|
-
token
|
|
156
|
-
)
|
|
157
|
-
server_url = cls.get_value_from_envs(
|
|
158
|
-
("AY_SERVER_URL", "AYON_SERVER_URL"),
|
|
159
|
-
server_url
|
|
160
|
-
)
|
|
159
|
+
token = token or os.environ.get("AYON_API_KEY")
|
|
160
|
+
server_url = server_url or os.environ.get("AYON_SERVER_URL")
|
|
161
161
|
if not server_url:
|
|
162
162
|
raise FailedServiceInit("URL to server is not set")
|
|
163
163
|
|
|
@@ -166,18 +166,9 @@ class ServiceContext:
|
|
|
166
166
|
"Token to server {} is not set".format(server_url)
|
|
167
167
|
)
|
|
168
168
|
|
|
169
|
-
addon_name =
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
)
|
|
173
|
-
addon_version = cls.get_value_from_envs(
|
|
174
|
-
("AY_ADDON_VERSION", "AYON_ADDON_VERSION"),
|
|
175
|
-
addon_version
|
|
176
|
-
)
|
|
177
|
-
service_name = cls.get_value_from_envs(
|
|
178
|
-
("AY_SERVICE_NAME", "AYON_SERVICE_NAME"),
|
|
179
|
-
service_name
|
|
180
|
-
)
|
|
169
|
+
addon_name = addon_name or os.environ.get("AYON_ADDON_NAME")
|
|
170
|
+
addon_version = addon_version or os.environ.get("AYON_ADDON_VERSION")
|
|
171
|
+
service_name = service_name or os.environ.get("AYON_SERVICE_NAME")
|
|
181
172
|
|
|
182
173
|
cls.token = token
|
|
183
174
|
cls.server_url = server_url
|
|
@@ -618,6 +609,11 @@ def delete_dependency_package(*args, **kwargs):
|
|
|
618
609
|
return con.delete_dependency_package(*args, **kwargs)
|
|
619
610
|
|
|
620
611
|
|
|
612
|
+
def upload_addon_zip(*args, **kwargs):
|
|
613
|
+
con = get_server_api_connection()
|
|
614
|
+
return con.upload_addon_zip(*args, **kwargs)
|
|
615
|
+
|
|
616
|
+
|
|
621
617
|
def get_project_anatomy_presets(*args, **kwargs):
|
|
622
618
|
con = get_server_api_connection()
|
|
623
619
|
return con.get_project_anatomy_presets(*args, **kwargs)
|