[FIX] Various little things in eveonline.providers

### Fixed

- `__init__(self)` instead of `__init__(cls)`
- AttributeError: 'EveOpenAPIProvider' object has no attribute '_faction_list'
- Return typehint for `get_alliance_corps`
- `use_cache` parameter for `get_all_factions` was not defined but used in `get_faction`
This commit is contained in:
Peter Pfeufer committed 2026-03-15 19:57:38 +01:00
1 parent 633f0809a5
commit 64336829cf
1 file changed
+5 -4
+5 -4
View File
@@ -143,7 +143,7 @@ class EveOpenAPIProvider(ESIClientProvider):
# most operations used here have `use_cache = False` this is cause we don't
# want to use the space in ram for mostly useless data. We are using etags tho.
def __init__(cls):
def __init__(self):
super().__init__(
__esi_compatibility_date__,
__title_useragent__,
@@ -151,8 +151,9 @@ class EveOpenAPIProvider(ESIClientProvider):
__url__,
operations=OPEN_API_OPERATIONS
)
self._faction_list = None
def get_alliance_corps(self, alliance_id: int, force_refresh=False) -> Alliance:
def get_alliance_corps(self, alliance_id: int, force_refresh=False) -> list:
"""Fetch alliance from ESI."""
try:
corps = self.client.Alliance.GetAlliancesAllianceIdCorporations(
@@ -254,13 +255,13 @@ class EveOpenAPIProvider(ESIClientProvider):
raise ObjectNotFound(character_id, 'character')
return character.name
def get_all_factions(self, force_refresh=False):
def get_all_factions(self, force_refresh=False, use_cache=True) -> list:
"""Fetch all factions from ESI."""
if not self._faction_list:
self._faction_list = self.client.Universe.GetUniverseFactions(
).result(
force_refresh=force_refresh,
use_cache=False
use_cache=use_cache
)
return self._faction_list