Skip to content

Commit 3dee846

Browse files
committed
chore: format
1 parent 6c0a8cb commit 3dee846

File tree

2 files changed

+27
-6
lines changed

2 files changed

+27
-6
lines changed

morphcloud/api.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,13 +264,16 @@ def usage(self, interval: typing.Optional[str] = None) -> "UserUsageOverview":
264264
response = self._client._http_client.get("/user/usage", params=params)
265265
return UserUsageOverview.model_validate(response.json())
266266

267-
async def ausage(self, interval: typing.Optional[str] = None) -> "UserUsageOverview":
267+
async def ausage(
268+
self, interval: typing.Optional[str] = None
269+
) -> "UserUsageOverview":
268270
params = {"interval": interval} if interval else None
269271
response = await self._client._async_http_client.get(
270272
"/user/usage", params=params
271273
)
272274
return UserUsageOverview.model_validate(response.json())
273275

276+
274277
class ImageAPI(BaseAPI):
275278
def list(self) -> typing.List[Image]:
276279
"""List all base images available to the user."""

morphcloud/cli.py

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,11 @@ def user_api_key_list(json_mode):
318318
def user_api_key_create(json_mode):
319319
client = get_client()
320320
try:
321-
with Spinner(text="Creating API key...", success_text="API key created", success_emoji="🔑"):
321+
with Spinner(
322+
text="Creating API key...",
323+
success_text="API key created",
324+
success_emoji="🔑",
325+
):
322326
resp = client.user.create_api_key()
323327
if json_mode:
324328
click.echo(format_json(resp))
@@ -327,7 +331,9 @@ def user_api_key_create(json_mode):
327331
click.echo(f"ID: {resp.id}")
328332
click.echo(f"Prefix: {resp.key_prefix}")
329333
click.echo(f"Created: {unix_timestamp_to_datetime(resp.created)}")
330-
click.secho("This is your API key — it will not be shown again:", fg="yellow")
334+
click.secho(
335+
"This is your API key — it will not be shown again:", fg="yellow"
336+
)
331337
click.secho(resp.key, fg="yellow")
332338
except Exception as e:
333339
handle_api_error(e)
@@ -338,7 +344,11 @@ def user_api_key_create(json_mode):
338344
def user_api_key_delete(api_key_id):
339345
client = get_client()
340346
try:
341-
with Spinner(text=f"Deleting API key {api_key_id}...", success_text="API key deleted", success_emoji="🗑"):
347+
with Spinner(
348+
text=f"Deleting API key {api_key_id}...",
349+
success_text="API key deleted",
350+
success_emoji="🗑",
351+
):
342352
client.user.delete_api_key(api_key_id)
343353
except Exception as e:
344354
handle_api_error(e)
@@ -370,12 +380,20 @@ def user_ssh_key_get(json_mode):
370380

371381

372382
@user_ssh_key.command(name="set", aliases=["update"])
373-
@click.option("--public-key", required=True, help="SSH public key string (e.g., 'ssh-rsa AAAA...')")
383+
@click.option(
384+
"--public-key",
385+
required=True,
386+
help="SSH public key string (e.g., 'ssh-rsa AAAA...')",
387+
)
374388
@click.option("--json", "json_mode", is_flag=True, default=False)
375389
def user_ssh_key_set(public_key, json_mode):
376390
client = get_client()
377391
try:
378-
with Spinner(text="Updating SSH key...", success_text="SSH key updated", success_emoji="🔐"):
392+
with Spinner(
393+
text="Updating SSH key...",
394+
success_text="SSH key updated",
395+
success_emoji="🔐",
396+
):
379397
info = client.user.update_ssh_key(public_key)
380398
if json_mode:
381399
click.echo(format_json(info))

0 commit comments

Comments
 (0)