Changeset View
Changeset View
Standalone View
Standalone View
swh/deposit/cli/client.py
Show First 20 Lines • Show All 114 Lines • ▼ Show 20 Lines | |||||
def _collection(client: PublicApiDepositClient) -> str: | def _collection(client: PublicApiDepositClient) -> str: | ||||
"""Retrieve the client's collection | """Retrieve the client's collection | ||||
""" | """ | ||||
# retrieve user's collection | # retrieve user's collection | ||||
sd_content = client.service_document() | sd_content = client.service_document() | ||||
if "error" in sd_content: | if "error" in sd_content: | ||||
raise InputError("Service document retrieval: %s" % (sd_content["error"],)) | raise InputError("Service document retrieval: %s" % (sd_content["error"],)) | ||||
collection = sd_content["service"]["workspace"]["collection"]["sword:name"] | collection = sd_content["app:service"]["app:workspace"]["app:collection"][ | ||||
"sword:name" | |||||
] | |||||
return collection | return collection | ||||
def client_command_parse_input( | def client_command_parse_input( | ||||
client, | client, | ||||
username: str, | username: str, | ||||
archive: Optional[str], | archive: Optional[str], | ||||
metadata: Optional[str], | metadata: Optional[str], | ||||
▲ Show 20 Lines • Show All 351 Lines • Show Last 20 Lines |