opensees-cli 0.3.2__tar.gz → 0.3.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {opensees_cli-0.3.2 → opensees_cli-0.3.3}/PKG-INFO +1 -1
- {opensees_cli-0.3.2 → opensees_cli-0.3.3}/pyproject.toml +1 -1
- {opensees_cli-0.3.2 → opensees_cli-0.3.3}/src/opensees_cli/__init__.py +1 -1
- {opensees_cli-0.3.2 → opensees_cli-0.3.3}/src/opensees_cli/auth.py +13 -1
- {opensees_cli-0.3.2 → opensees_cli-0.3.3}/src/opensees_cli.egg-info/PKG-INFO +1 -1
- {opensees_cli-0.3.2 → opensees_cli-0.3.3}/README.md +0 -0
- {opensees_cli-0.3.2 → opensees_cli-0.3.3}/setup.cfg +0 -0
- {opensees_cli-0.3.2 → opensees_cli-0.3.3}/src/opensees_cli/__main__.py +0 -0
- {opensees_cli-0.3.2 → opensees_cli-0.3.3}/src/opensees_cli/api.py +0 -0
- {opensees_cli-0.3.2 → opensees_cli-0.3.3}/src/opensees_cli/config.py +0 -0
- {opensees_cli-0.3.2 → opensees_cli-0.3.3}/src/opensees_cli/files.py +0 -0
- {opensees_cli-0.3.2 → opensees_cli-0.3.3}/src/opensees_cli/main.py +0 -0
- {opensees_cli-0.3.2 → opensees_cli-0.3.3}/src/opensees_cli/path_setup.py +0 -0
- {opensees_cli-0.3.2 → opensees_cli-0.3.3}/src/opensees_cli/run.py +0 -0
- {opensees_cli-0.3.2 → opensees_cli-0.3.3}/src/opensees_cli/version.py +0 -0
- {opensees_cli-0.3.2 → opensees_cli-0.3.3}/src/opensees_cli.egg-info/SOURCES.txt +0 -0
- {opensees_cli-0.3.2 → opensees_cli-0.3.3}/src/opensees_cli.egg-info/dependency_links.txt +0 -0
- {opensees_cli-0.3.2 → opensees_cli-0.3.3}/src/opensees_cli.egg-info/entry_points.txt +0 -0
- {opensees_cli-0.3.2 → opensees_cli-0.3.3}/src/opensees_cli.egg-info/requires.txt +0 -0
- {opensees_cli-0.3.2 → opensees_cli-0.3.3}/src/opensees_cli.egg-info/top_level.txt +0 -0
- {opensees_cli-0.3.2 → opensees_cli-0.3.3}/tests/test_api.py +0 -0
- {opensees_cli-0.3.2 → opensees_cli-0.3.3}/tests/test_auth_commands.py +0 -0
- {opensees_cli-0.3.2 → opensees_cli-0.3.3}/tests/test_config.py +0 -0
- {opensees_cli-0.3.2 → opensees_cli-0.3.3}/tests/test_files_commands.py +0 -0
- {opensees_cli-0.3.2 → opensees_cli-0.3.3}/tests/test_main_commands.py +0 -0
- {opensees_cli-0.3.2 → opensees_cli-0.3.3}/tests/test_run_commands.py +0 -0
- {opensees_cli-0.3.2 → opensees_cli-0.3.3}/tests/test_version_commands.py +0 -0
|
@@ -286,6 +286,18 @@ def _usage_parts(q: dict) -> tuple:
|
|
|
286
286
|
return maximum or 0, used or 0, reserved or 0, remaining
|
|
287
287
|
|
|
288
288
|
|
|
289
|
+
def _fmt_usage_pct(pct: float) -> str:
|
|
290
|
+
"""Whole percent, or up to two decimals when the share is under 1%."""
|
|
291
|
+
if pct <= 0:
|
|
292
|
+
return "0%"
|
|
293
|
+
if pct < 1:
|
|
294
|
+
text = f"{pct:.2f}".rstrip("0").rstrip(".")
|
|
295
|
+
if text in ("", "0"):
|
|
296
|
+
text = "0.00"
|
|
297
|
+
return f"{text}%"
|
|
298
|
+
return f"{pct:.0f}%"
|
|
299
|
+
|
|
300
|
+
|
|
289
301
|
def print_quota(q: dict) -> None:
|
|
290
302
|
"""Print quota info to the console."""
|
|
291
303
|
max_rt, used, reserved, _remaining = _usage_parts(q)
|
|
@@ -310,7 +322,7 @@ def print_quota(q: dict) -> None:
|
|
|
310
322
|
console.print(f" Max task timeout: {_fmt_duration(q['max_task_timeout']) if q.get('max_task_timeout') else '-'}")
|
|
311
323
|
console.print(f" Max RAM: {_fmt_bytes((q.get('max_ram_mb') or 1024) * 1024 * 1024)}")
|
|
312
324
|
console.print(f" Max storage/task: {_fmt_bytes(q['max_storage_per_task']) if q.get('max_storage_per_task') else '-'}")
|
|
313
|
-
console.print(f" Monthly usage: [{rt_color}]{pct
|
|
325
|
+
console.print(f" Monthly usage: [{rt_color}]{_fmt_usage_pct(pct)}[/{rt_color}]")
|
|
314
326
|
if q.get("next_reset_at"):
|
|
315
327
|
console.print(f" Next cycle: {_to_local_date(q['next_reset_at'])}")
|
|
316
328
|
else:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|