Changeset View
Changeset View
Standalone View
Standalone View
swh/deposit/cli/client.py
Show First 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | def trap_and_report_exceptions(): | ||||
except InputError as e: | except InputError as e: | ||||
logger.error("Problem during parsing options: %s", e) | logger.error("Problem during parsing options: %s", e) | ||||
sys.exit(1) | sys.exit(1) | ||||
except MaintenanceError as e: | except MaintenanceError as e: | ||||
logger.error(e) | logger.error(e) | ||||
sys.exit(1) | sys.exit(1) | ||||
def generate_slug() -> str: | |||||
"""Generate a slug (sample purposes). | |||||
""" | |||||
import uuid | |||||
return str(uuid.uuid4()) | |||||
def _url(url: str) -> str: | def _url(url: str) -> str: | ||||
"""Force the /1 api version at the end of the url (avoiding confusing | """Force the /1 api version at the end of the url (avoiding confusing | ||||
issues without it). | issues without it). | ||||
Args: | Args: | ||||
url (str): api url used by cli users | url (str): api url used by cli users | ||||
Returns: | Returns: | ||||
▲ Show 20 Lines • Show All 450 Lines • Show Last 20 Lines |