django-esi 8.0.0a1__py3-none-any.whl → 8.0.0a2__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.
Potentially problematic release.
This version of django-esi might be problematic. Click here for more details.
- {django_esi-8.0.0a1.dist-info → django_esi-8.0.0a2.dist-info}/METADATA +3 -4
- {django_esi-8.0.0a1.dist-info → django_esi-8.0.0a2.dist-info}/RECORD +10 -10
- esi/__init__.py +2 -2
- esi/aiopenapi3/plugins.py +18 -0
- esi/app_settings.py +1 -1
- esi/management/commands/generate_esi_stubs.py +33 -16
- esi/openapi_clients.py +72 -14
- esi/stubs.pyi +441 -567
- {django_esi-8.0.0a1.dist-info → django_esi-8.0.0a2.dist-info}/WHEEL +0 -0
- {django_esi-8.0.0a1.dist-info → django_esi-8.0.0a2.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: django-esi
|
|
3
|
-
Version: 8.0.
|
|
3
|
+
Version: 8.0.0a2
|
|
4
4
|
Summary: Django app for accessing the EVE Swagger Interface (ESI).
|
|
5
|
+
Keywords: eveonline
|
|
5
6
|
Author-email: Alliance Auth <adarnof@gmail.com>
|
|
6
|
-
Requires-Python: >=3.
|
|
7
|
+
Requires-Python: >=3.10
|
|
7
8
|
Description-Content-Type: text/markdown
|
|
8
9
|
Classifier: Environment :: Web Environment
|
|
9
10
|
Classifier: Framework :: Django
|
|
@@ -15,8 +16,6 @@ Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
|
|
|
15
16
|
Classifier: Operating System :: OS Independent
|
|
16
17
|
Classifier: Programming Language :: Python
|
|
17
18
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
20
19
|
Classifier: Programming Language :: Python :: 3.10
|
|
21
20
|
Classifier: Programming Language :: Python :: 3.11
|
|
22
21
|
Classifier: Programming Language :: Python :: 3.12
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
esi/__init__.py,sha256=
|
|
1
|
+
esi/__init__.py,sha256=x_GMW2iG9w-jeVStEapSJo_3MzGJm8XDnCJ6cTscRq4,199
|
|
2
2
|
esi/admin.py,sha256=9i68WwW_gR0zsGhJKTWK2yMEi44EkhpAaOW0LDpVfM8,1176
|
|
3
|
-
esi/app_settings.py,sha256=
|
|
3
|
+
esi/app_settings.py,sha256=2Jp_1myzKCL8A20RYvwQnQd04Ds_CBGsCqwDtsrYf0M,4289
|
|
4
4
|
esi/apps.py,sha256=HIu1niTkOXYmCzMVAjYcaFhHrrXeBbHvui6I44OCHXw,280
|
|
5
5
|
esi/checks.py,sha256=31puQdsrpRUJB-kedp2k7Evo0x2knTWQPZsCUUrJ3dY,1912
|
|
6
6
|
esi/clients.py,sha256=WB5YseJnfZdTeJ9C1Eze-iWXEqIpo5i_8uiQ6w0VkCw,23503
|
|
@@ -11,14 +11,14 @@ esi/helpers.py,sha256=-lYojtcWYWtlC_olSItWR3O3zJpjMYTQpNvsax81us8,672
|
|
|
11
11
|
esi/managers.py,sha256=zdri1aSJrSX9W_kwzbXq44CAAhdufikoOViaJntA41A,11443
|
|
12
12
|
esi/managers.pyi,sha256=BxRNX2yOT3domdrxsuGp4G0TrP_bWmf8VVwvM03eHQE,1977
|
|
13
13
|
esi/models.py,sha256=v33dvnWoiDwhcwc5Y4CvNOtAJocNd2qh5JtyNTtu-P8,11483
|
|
14
|
-
esi/openapi_clients.py,sha256=
|
|
14
|
+
esi/openapi_clients.py,sha256=l7XVB9cXiW04aG18Knb_gsCmQP20TghpyDPuyjUzr1Y,34385
|
|
15
15
|
esi/rate_limiting.py,sha256=fUzso1YCHlBes8SVrEAsP58eRWcFNuO2XEkW6RQLhUE,2600
|
|
16
16
|
esi/stubs.py,sha256=UakysEAq5V454oKbxyEUewncr5sCFZCgwHFh0SJvU3Y,30
|
|
17
|
-
esi/stubs.pyi,sha256=
|
|
17
|
+
esi/stubs.pyi,sha256=wT1aqp4eATKrReFupxmTz4wpvHNBQ0TpCJ-_zf2TjJg,231643
|
|
18
18
|
esi/tasks.py,sha256=TaE_Q03oLk1ohkPw8KknXpIK-nY47C-oaGUUu4nr8pw,2658
|
|
19
19
|
esi/urls.py,sha256=B4EnmT-MZzs4F8a9ORK1ejAHbpGRN_V4TKks8ww3JGE,151
|
|
20
20
|
esi/views.py,sha256=cq2JkqSAwx-Nqi3amRUA9CKLu3ZLQYHSAH8c8g7xIQ4,3917
|
|
21
|
-
esi/aiopenapi3/plugins.py,sha256=
|
|
21
|
+
esi/aiopenapi3/plugins.py,sha256=hHvWA_Sil5VTR1KLyF8dPSppx4g-daY9cj0kUSUZKxc,3914
|
|
22
22
|
esi/locale/de/LC_MESSAGES/django.mo,sha256=9_Fc_R8oZpT_CojH8gBxdSqj2K84EMEMn4wkvmOr7Dg,820
|
|
23
23
|
esi/locale/de/LC_MESSAGES/django.po,sha256=2NQVGYzLroHPPrWgmACSnb2d3nwlkMBLxA1uWU3K0FA,1503
|
|
24
24
|
esi/locale/en/LC_MESSAGES/django.mo,sha256=N1pb17IfLd0ASiKO8d68-B4ygSpDkhKOCs8YTzMXQo0,380
|
|
@@ -38,7 +38,7 @@ esi/locale/ru/LC_MESSAGES/django.po,sha256=_pMs3mMOGMiHGpk27p8ykllpGnw20l5sSDg-N
|
|
|
38
38
|
esi/locale/zh_Hans/LC_MESSAGES/django.mo,sha256=hPSO7wlU9cN8f32Qo1Dztq6AHUm2hZfL1hHIDW1R1F4,681
|
|
39
39
|
esi/locale/zh_Hans/LC_MESSAGES/django.po,sha256=fZhif8jOUvY22xurl7eBYsHNKoqf7obtkW5L3894hk4,1451
|
|
40
40
|
esi/management/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
41
|
-
esi/management/commands/generate_esi_stubs.py,sha256=
|
|
41
|
+
esi/management/commands/generate_esi_stubs.py,sha256=MlsLe_otphvkRDXs-MwbNLfvIhESKD9tOJxMdqvGunc,10579
|
|
42
42
|
esi/management/commands/migrate_to_ssov2.py,sha256=x9W4xaefrNoG_dNscHIWrWTRk4SuVGIW0s44q2QBN9k,6427
|
|
43
43
|
esi/migrations/0001_initial.py,sha256=ItZOyyCRyfyxUhxCG1P08oylCY355gqOKGF3cJTQmcM,3396
|
|
44
44
|
esi/migrations/0002_scopes_20161208.py,sha256=AG3qVAoEXh8WTgxuvS1pgG8LxLGMzpqr-jqtMjy3qC0,2846
|
|
@@ -79,7 +79,7 @@ esi/tests/test_tasks.py,sha256=nIvfXax_8nQCxNQeT-4TJ84i0__t1qWe155z5rnsktQ,4399
|
|
|
79
79
|
esi/tests/test_templatetags.py,sha256=b68JWE3HvOlr2aUisJHsTsDS4e7IMjDeqTuzMqC7Re4,517
|
|
80
80
|
esi/tests/test_views.py,sha256=Kj_f2yIpmPG0kx-lAX_sfkaHlIpgbkm02ieA1V3o-k4,13073
|
|
81
81
|
esi/tests/threading_pilot.py,sha256=ax_dEdnTNibA-UQHqbZle_2dh_3jcHKRyrYSOKuE_6U,1931
|
|
82
|
-
django_esi-8.0.
|
|
83
|
-
django_esi-8.0.
|
|
84
|
-
django_esi-8.0.
|
|
85
|
-
django_esi-8.0.
|
|
82
|
+
django_esi-8.0.0a2.dist-info/licenses/LICENSE,sha256=WJ7YI-moTFb-uVrFjnzzhGJrnL9P2iqQe8NuED3hutI,35141
|
|
83
|
+
django_esi-8.0.0a2.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
|
|
84
|
+
django_esi-8.0.0a2.dist-info/METADATA,sha256=nYKhXDNlrzlcplbMUL_eWoZcHQZ3B-oT4S1pgs8elAM,4738
|
|
85
|
+
django_esi-8.0.0a2.dist-info/RECORD,,
|
esi/__init__.py
CHANGED
esi/aiopenapi3/plugins.py
CHANGED
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
from aiopenapi3.plugin import Document
|
|
2
2
|
|
|
3
3
|
|
|
4
|
+
class Trim204ContentType(Document):
|
|
5
|
+
"""
|
|
6
|
+
Removes and content-type from responses on a 204 reponses
|
|
7
|
+
A 204 never has content...
|
|
8
|
+
"""
|
|
9
|
+
def parsed(self, ctx: Document.Context) -> Document.Context:
|
|
10
|
+
spec = ctx.document
|
|
11
|
+
# Patch all paths
|
|
12
|
+
for path_item in spec.get("paths", {}).values():
|
|
13
|
+
for method_name in ("get", "post", "put", "delete", "patch", "options", "head"):
|
|
14
|
+
method = path_item.get(method_name)
|
|
15
|
+
if not method:
|
|
16
|
+
continue
|
|
17
|
+
if "204" in method['responses']:
|
|
18
|
+
method['responses']["204"].pop("content", [])
|
|
19
|
+
return ctx
|
|
20
|
+
|
|
21
|
+
|
|
4
22
|
class RemoveSecurityParameter(Document):
|
|
5
23
|
"""
|
|
6
24
|
Removes the whole OAuth2 securityScheme
|
esi/app_settings.py
CHANGED
|
@@ -108,5 +108,5 @@ ESI_TOKEN_JWT_AUDIENCE = str(getattr(settings, "ESI_TOKEN_JWT_AUDIENCE", "EVE On
|
|
|
108
108
|
|
|
109
109
|
# list of all official language codes supported by ESI
|
|
110
110
|
ESI_LANGUAGES = getattr(settings, 'ESI_LANGUAGES', [
|
|
111
|
-
'
|
|
111
|
+
'en', 'de', 'fr', 'ja', 'ru', 'zh', 'ko', 'es'
|
|
112
112
|
])
|
|
@@ -102,7 +102,7 @@ class Command(BaseCommand):
|
|
|
102
102
|
f.write("# flake8: noqa=E501\n")
|
|
103
103
|
f.write("# Auto Generated do not edit\n")
|
|
104
104
|
# Python Imports
|
|
105
|
-
f.write("from typing import Any
|
|
105
|
+
f.write("from typing import Any\n\n")
|
|
106
106
|
f.write("from esi.openapi_clients import EsiOperation\n")
|
|
107
107
|
f.write("from esi.models import Token\n\n\n")
|
|
108
108
|
|
|
@@ -114,15 +114,25 @@ class Command(BaseCommand):
|
|
|
114
114
|
# result(), Results(), Results_Localized() etc. all live here
|
|
115
115
|
ops = stub_api._operationindex._tags[tag]
|
|
116
116
|
for nm, op in sorted(ops._operations.items()):
|
|
117
|
+
op_type = op[0]
|
|
117
118
|
op_obj = op[2]
|
|
118
119
|
docstring = (op_obj.description or op_obj.summary or "").replace("\n", " ").strip()
|
|
119
120
|
op_class_name = sanitize_operation_class(nm)
|
|
120
121
|
|
|
121
122
|
response_type = "Any"
|
|
122
123
|
try:
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
match op_type:
|
|
125
|
+
case "post":
|
|
126
|
+
resp_201 = op_obj.responses.get("201")
|
|
127
|
+
if resp_201 and "application/json" in resp_201.content:
|
|
128
|
+
response_type = schema_to_type(resp_201.content["application/json"].schema_)
|
|
129
|
+
case "put" | "delete":
|
|
130
|
+
response_type = "None"
|
|
131
|
+
case _:
|
|
132
|
+
resp_200 = op_obj.responses.get("200")
|
|
133
|
+
if resp_200 and "application/json" in resp_200.content:
|
|
134
|
+
response_type = schema_to_type(resp_200.content["application/json"].schema_)
|
|
135
|
+
|
|
126
136
|
except Exception:
|
|
127
137
|
response_type = "Any"
|
|
128
138
|
|
|
@@ -130,22 +140,26 @@ class Command(BaseCommand):
|
|
|
130
140
|
|
|
131
141
|
if op_class_name not in operation_classes:
|
|
132
142
|
f.write(f"class {op_class_name}(EsiOperation):\n")
|
|
133
|
-
|
|
143
|
+
if response_type != "None":
|
|
144
|
+
f.write(" \"\"\"EsiOperation, use result(), results() or results_localized()\"\"\"\n")
|
|
145
|
+
else:
|
|
146
|
+
f.write(" \"\"\"EsiOperation, use result()\"\"\"\n")
|
|
134
147
|
|
|
135
148
|
# result()
|
|
136
149
|
f.write(f" def result(self, etag: str | None = None, return_response: bool = False, use_cache: bool = True, **extra) -> {response_type}:\n") # noqa: E501
|
|
137
150
|
f.write(f" \"\"\"{docstring}\"\"\"\n") if docstring else None
|
|
138
151
|
f.write(" ...\n\n")
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
152
|
+
if response_type != "None":
|
|
153
|
+
# We only need the extra utility functions if its actually an endpoint that returns data
|
|
154
|
+
# results()
|
|
155
|
+
f.write(f" def results(self, etag: str | None = None, return_response: bool = False, use_cache: bool = True, **extra) -> {results_type}:\n") # noqa: E501
|
|
156
|
+
f.write(f" \"\"\"{docstring}\"\"\"\n") if docstring else None
|
|
157
|
+
f.write(" ...\n\n")
|
|
158
|
+
|
|
159
|
+
# results_localized()
|
|
160
|
+
f.write(f" def results_localized(self, languages: list[str] | str | None = None, **extra) -> dict[str, {results_type}]:\n")
|
|
161
|
+
f.write(f" \"\"\"{docstring}\"\"\"\n") if docstring else None
|
|
162
|
+
f.write(" ...\n\n\n")
|
|
149
163
|
|
|
150
164
|
operation_classes[op_class_name] = True
|
|
151
165
|
|
|
@@ -172,6 +186,9 @@ class Command(BaseCommand):
|
|
|
172
186
|
|
|
173
187
|
params = ["self"]
|
|
174
188
|
optional_params = []
|
|
189
|
+
if getattr(op_obj, "requestBody", None):
|
|
190
|
+
params.append(f"body: {schema_to_type(op_obj.requestBody.content['application/json'].schema_)}")
|
|
191
|
+
|
|
175
192
|
for p in getattr(op_obj, "parameters", []):
|
|
176
193
|
required = getattr(p, "required", False)
|
|
177
194
|
schema_type_value = getattr(getattr(p, "schema_", None), "type", None)
|
|
@@ -181,7 +198,7 @@ class Command(BaseCommand):
|
|
|
181
198
|
param_type = "Any"
|
|
182
199
|
default = ""
|
|
183
200
|
if not required:
|
|
184
|
-
param_type = f"
|
|
201
|
+
param_type = f"{param_type} | None"
|
|
185
202
|
default = " = ..."
|
|
186
203
|
param_name = p.name.replace("-", "_")
|
|
187
204
|
if param_name == "authorization" and needs_oauth:
|
esi/openapi_clients.py
CHANGED
|
@@ -18,7 +18,7 @@ from tenacity import (
|
|
|
18
18
|
from django.core.cache import cache
|
|
19
19
|
|
|
20
20
|
from esi import app_settings
|
|
21
|
-
from esi.aiopenapi3.plugins import PatchCompatibilityDatePlugin
|
|
21
|
+
from esi.aiopenapi3.plugins import PatchCompatibilityDatePlugin, Trim204ContentType
|
|
22
22
|
from esi.exceptions import ESIErrorLimitException
|
|
23
23
|
from esi.models import Token
|
|
24
24
|
from esi.stubs import ESIClientStub
|
|
@@ -121,14 +121,14 @@ def _load_aiopenapi_client_sync(
|
|
|
121
121
|
path=spec_file,
|
|
122
122
|
session_factory=session_factory,
|
|
123
123
|
use_operation_tags=True,
|
|
124
|
-
plugins=[PatchCompatibilityDatePlugin()]
|
|
124
|
+
plugins=[PatchCompatibilityDatePlugin(), Trim204ContentType()]
|
|
125
125
|
)
|
|
126
126
|
else:
|
|
127
127
|
return OpenAPI.load_sync(
|
|
128
128
|
url=spec_url,
|
|
129
129
|
session_factory=session_factory,
|
|
130
130
|
use_operation_tags=True,
|
|
131
|
-
plugins=[PatchCompatibilityDatePlugin()]
|
|
131
|
+
plugins=[PatchCompatibilityDatePlugin(), Trim204ContentType()]
|
|
132
132
|
)
|
|
133
133
|
|
|
134
134
|
|
|
@@ -176,14 +176,14 @@ async def _load_aiopenapi_client_async(
|
|
|
176
176
|
path=spec_file,
|
|
177
177
|
session_factory=session_factory,
|
|
178
178
|
use_operation_tags=True,
|
|
179
|
-
plugins=[PatchCompatibilityDatePlugin()]
|
|
179
|
+
plugins=[PatchCompatibilityDatePlugin(), Trim204ContentType()]
|
|
180
180
|
)
|
|
181
181
|
else:
|
|
182
182
|
return await OpenAPI.load_async(
|
|
183
183
|
url=spec_url,
|
|
184
184
|
session_factory=session_factory,
|
|
185
185
|
use_operation_tags=True,
|
|
186
|
-
plugins=[PatchCompatibilityDatePlugin()]
|
|
186
|
+
plugins=[PatchCompatibilityDatePlugin(), Trim204ContentType()]
|
|
187
187
|
)
|
|
188
188
|
|
|
189
189
|
|
|
@@ -326,6 +326,16 @@ class BaseEsiOperation():
|
|
|
326
326
|
str_hash = md5(data).hexdigest() # nosec B303
|
|
327
327
|
return f'esi_{str_hash}'
|
|
328
328
|
|
|
329
|
+
def _extract_body_param(self) -> Token | None:
|
|
330
|
+
"""Pop the request body from parameters to be able to check the param validity
|
|
331
|
+
Returns:
|
|
332
|
+
Any | None: the request body
|
|
333
|
+
"""
|
|
334
|
+
_body = self._kwargs.pop("body", None)
|
|
335
|
+
if _body and not getattr(self.operation, "requestBody", False):
|
|
336
|
+
raise ValueError("Request Body provided on endpoint with no request body paramater.")
|
|
337
|
+
return _body
|
|
338
|
+
|
|
329
339
|
def _extract_token_param(self) -> Token | None:
|
|
330
340
|
"""Pop token from parameters or use the Client wide token if set
|
|
331
341
|
Returns:
|
|
@@ -450,7 +460,7 @@ class EsiOperation(BaseEsiOperation):
|
|
|
450
460
|
req.req.headers["Authorization"] = f"Bearer {self.token.valid_access_token()}"
|
|
451
461
|
if etag:
|
|
452
462
|
req.req.headers["If-None-Match"] = etag
|
|
453
|
-
return req.request(parameters=self._unnormalize_parameters(parameters))
|
|
463
|
+
return req.request(data=self.body, parameters=self._unnormalize_parameters(parameters))
|
|
454
464
|
return retry(__func)
|
|
455
465
|
|
|
456
466
|
def result(
|
|
@@ -467,6 +477,7 @@ class EsiOperation(BaseEsiOperation):
|
|
|
467
477
|
"""
|
|
468
478
|
|
|
469
479
|
self.token = self._extract_token_param()
|
|
480
|
+
self.body = self._extract_body_param()
|
|
470
481
|
parameters = self._kwargs | extra
|
|
471
482
|
cache_key = self._cache_key()
|
|
472
483
|
etag_key = f"{cache_key}_etag"
|
|
@@ -508,8 +519,8 @@ class EsiOperation(BaseEsiOperation):
|
|
|
508
519
|
return_response: bool = False,
|
|
509
520
|
use_cache: bool = True,
|
|
510
521
|
**extra) -> tuple[list[Any], Response | Any | None] | list[Any]:
|
|
511
|
-
all_results = []
|
|
512
|
-
last_response = None
|
|
522
|
+
all_results: list[Any] = []
|
|
523
|
+
last_response: Response | None = None
|
|
513
524
|
"""Executes the request and returns the response from ESI for the current
|
|
514
525
|
operation. Response will include all pages if there are more available.
|
|
515
526
|
|
|
@@ -557,10 +568,31 @@ class EsiOperation(BaseEsiOperation):
|
|
|
557
568
|
|
|
558
569
|
return (all_results, last_response) if return_response else all_results
|
|
559
570
|
|
|
560
|
-
def results_localized(
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
571
|
+
def results_localized(
|
|
572
|
+
self,
|
|
573
|
+
languages: list[str] | str | None = None,
|
|
574
|
+
**kwargs) -> dict[str, list[Any]]:
|
|
575
|
+
"""Executes the request and returns the response from ESI for all default languages and pages (if any).
|
|
576
|
+
Args:
|
|
577
|
+
languages: (list[str], str, optional) language(s) to return instead of default languages
|
|
578
|
+
Raises:
|
|
579
|
+
ValueError: Invalid or Not Supported Language Code ...
|
|
580
|
+
Returns:
|
|
581
|
+
dict[str, list[Any]]: Dict of all responses with the language code as keys.
|
|
582
|
+
"""
|
|
583
|
+
if not languages:
|
|
584
|
+
my_languages = list(app_settings.ESI_LANGUAGES)
|
|
585
|
+
else:
|
|
586
|
+
my_languages = []
|
|
587
|
+
for lang in dict.fromkeys(languages):
|
|
588
|
+
if lang not in app_settings.ESI_LANGUAGES:
|
|
589
|
+
raise ValueError('Invalid or Not Supported Language Code: %s' % lang)
|
|
590
|
+
my_languages.append(lang)
|
|
591
|
+
|
|
592
|
+
return {
|
|
593
|
+
language: self.results(language=language, **kwargs)
|
|
594
|
+
for language in my_languages
|
|
595
|
+
}
|
|
564
596
|
|
|
565
597
|
def required_scopes(self) -> list[str]:
|
|
566
598
|
"""Return a simple list of scopes required for an endpoint. #Requires loading and processing a client
|
|
@@ -678,8 +710,31 @@ class EsiOperationAsync(BaseEsiOperation):
|
|
|
678
710
|
|
|
679
711
|
return (all_results, last_response) if return_response else all_results
|
|
680
712
|
|
|
681
|
-
|
|
682
|
-
|
|
713
|
+
def results_localized(
|
|
714
|
+
self,
|
|
715
|
+
languages: list[str] | str | None = None,
|
|
716
|
+
**extra) -> dict[str, list[Any]]:
|
|
717
|
+
"""Executes the request and returns the response from ESI for all default languages and pages (if any).
|
|
718
|
+
Args:
|
|
719
|
+
languages: (list[str], str, optional) language(s) to return instead of default languages
|
|
720
|
+
Raises:
|
|
721
|
+
ValueError: Invalid or Not Supported Language Code ...
|
|
722
|
+
Returns:
|
|
723
|
+
dict[str, list[Any]]: Dict of all responses with the language code as keys.
|
|
724
|
+
"""
|
|
725
|
+
if not languages:
|
|
726
|
+
my_languages = list(app_settings.ESI_LANGUAGES)
|
|
727
|
+
else:
|
|
728
|
+
my_languages = []
|
|
729
|
+
for lang in dict.fromkeys(languages):
|
|
730
|
+
if lang not in app_settings.ESI_LANGUAGES:
|
|
731
|
+
raise ValueError('Invalid or Not Supported Language Code: %s' % lang)
|
|
732
|
+
my_languages.append(lang)
|
|
733
|
+
|
|
734
|
+
return {
|
|
735
|
+
language: self.results(language=language, **extra)
|
|
736
|
+
for language in my_languages
|
|
737
|
+
}
|
|
683
738
|
|
|
684
739
|
def required_scopes(self) -> list[str]:
|
|
685
740
|
"""Return a simple list of scopes required for an endpoint. #Requires loading and processing a client
|
|
@@ -795,6 +850,9 @@ class ESIClientProvider:
|
|
|
795
850
|
client_async(): ESIClientAsync
|
|
796
851
|
"""
|
|
797
852
|
|
|
853
|
+
_client: ESIClient | None = None
|
|
854
|
+
_client_async: ESIClientAsync | None = None
|
|
855
|
+
|
|
798
856
|
def __init__(
|
|
799
857
|
self,
|
|
800
858
|
compatibility_date: str,
|