|
|
@@ -9,15 +9,15 @@ from ._provided import blueprint |
|
|
|
|
|
|
|
SCOPES = {"esi-corporations.read_corporation_membership.v1"} |
|
|
|
|
|
|
|
_Member = namedtuple("_Member", ["id", "name"]) |
|
|
|
_Member = namedtuple("_Member", ["id", "name", "roles"]) |
|
|
|
|
|
|
|
# ... show roles if possible |
|
|
|
# ... sort by seniority |
|
|
|
|
|
|
|
def get_members(): |
|
|
|
"""Return a list of the members of the user's corporation. |
|
|
|
|
|
|
|
Members are returned as 2-namedtuples of (id, name). An empty list is |
|
|
|
returned if there was some error with tokens. |
|
|
|
Members are returned as 3-namedtuples of (id, name, roles). An empty list |
|
|
|
is returned if there was some error with tokens. |
|
|
|
""" |
|
|
|
token = g.auth.get_token() |
|
|
|
if not token: |
|
|
@@ -26,8 +26,10 @@ def get_members(): |
|
|
|
corp_id = g.config.get("corp.id") |
|
|
|
resp = g.eve.esi(token).v2.corporations(corp_id).members.get() |
|
|
|
cids = ",".join(str(item["character_id"]) for item in resp) |
|
|
|
ceo_id = g.eve.esi(token).v2.corporations(corp_id).get()["ceo_id"] |
|
|
|
resp = g.eve.esi(token).v1.characters.names.get(character_ids=cids) |
|
|
|
return [_Member(item["character_id"], item["character_name"]) |
|
|
|
return [_Member(item["character_id"], item["character_name"], |
|
|
|
"CEO" if item["character_id"] == ceo_id else None) |
|
|
|
for item in resp] |
|
|
|
|
|
|
|
def home(): |
|
|
|