opensees-cli 0.3.2__tar.gz → 0.3.4__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.4}/PKG-INFO +1 -1
- {opensees_cli-0.3.2 → opensees_cli-0.3.4}/pyproject.toml +1 -1
- {opensees_cli-0.3.2 → opensees_cli-0.3.4}/src/opensees_cli/__init__.py +1 -1
- {opensees_cli-0.3.2 → opensees_cli-0.3.4}/src/opensees_cli/auth.py +10 -1
- {opensees_cli-0.3.2 → opensees_cli-0.3.4}/src/opensees_cli.egg-info/PKG-INFO +1 -1
- {opensees_cli-0.3.2 → opensees_cli-0.3.4}/README.md +0 -0
- {opensees_cli-0.3.2 → opensees_cli-0.3.4}/setup.cfg +0 -0
- {opensees_cli-0.3.2 → opensees_cli-0.3.4}/src/opensees_cli/__main__.py +0 -0
- {opensees_cli-0.3.2 → opensees_cli-0.3.4}/src/opensees_cli/api.py +0 -0
- {opensees_cli-0.3.2 → opensees_cli-0.3.4}/src/opensees_cli/config.py +0 -0
- {opensees_cli-0.3.2 → opensees_cli-0.3.4}/src/opensees_cli/files.py +0 -0
- {opensees_cli-0.3.2 → opensees_cli-0.3.4}/src/opensees_cli/main.py +0 -0
- {opensees_cli-0.3.2 → opensees_cli-0.3.4}/src/opensees_cli/path_setup.py +0 -0
- {opensees_cli-0.3.2 → opensees_cli-0.3.4}/src/opensees_cli/run.py +0 -0
- {opensees_cli-0.3.2 → opensees_cli-0.3.4}/src/opensees_cli/version.py +0 -0
- {opensees_cli-0.3.2 → opensees_cli-0.3.4}/src/opensees_cli.egg-info/SOURCES.txt +0 -0
- {opensees_cli-0.3.2 → opensees_cli-0.3.4}/src/opensees_cli.egg-info/dependency_links.txt +0 -0
- {opensees_cli-0.3.2 → opensees_cli-0.3.4}/src/opensees_cli.egg-info/entry_points.txt +0 -0
- {opensees_cli-0.3.2 → opensees_cli-0.3.4}/src/opensees_cli.egg-info/requires.txt +0 -0
- {opensees_cli-0.3.2 → opensees_cli-0.3.4}/src/opensees_cli.egg-info/top_level.txt +0 -0
- {opensees_cli-0.3.2 → opensees_cli-0.3.4}/tests/test_api.py +0 -0
- {opensees_cli-0.3.2 → opensees_cli-0.3.4}/tests/test_auth_commands.py +0 -0
- {opensees_cli-0.3.2 → opensees_cli-0.3.4}/tests/test_config.py +0 -0
- {opensees_cli-0.3.2 → opensees_cli-0.3.4}/tests/test_files_commands.py +0 -0
- {opensees_cli-0.3.2 → opensees_cli-0.3.4}/tests/test_main_commands.py +0 -0
- {opensees_cli-0.3.2 → opensees_cli-0.3.4}/tests/test_run_commands.py +0 -0
- {opensees_cli-0.3.2 → opensees_cli-0.3.4}/tests/test_version_commands.py +0 -0
|
@@ -286,6 +286,15 @@ 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. A positive share under 1% is shown as < 1%."""
|
|
291
|
+
if pct <= 0:
|
|
292
|
+
return "0%"
|
|
293
|
+
if pct < 1:
|
|
294
|
+
return "< 1%"
|
|
295
|
+
return f"{pct:.0f}%"
|
|
296
|
+
|
|
297
|
+
|
|
289
298
|
def print_quota(q: dict) -> None:
|
|
290
299
|
"""Print quota info to the console."""
|
|
291
300
|
max_rt, used, reserved, _remaining = _usage_parts(q)
|
|
@@ -310,7 +319,7 @@ def print_quota(q: dict) -> None:
|
|
|
310
319
|
console.print(f" Max task timeout: {_fmt_duration(q['max_task_timeout']) if q.get('max_task_timeout') else '-'}")
|
|
311
320
|
console.print(f" Max RAM: {_fmt_bytes((q.get('max_ram_mb') or 1024) * 1024 * 1024)}")
|
|
312
321
|
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
|
|
322
|
+
console.print(f" Monthly usage: [{rt_color}]{_fmt_usage_pct(pct)}[/{rt_color}]")
|
|
314
323
|
if q.get("next_reset_at"):
|
|
315
324
|
console.print(f" Next cycle: {_to_local_date(q['next_reset_at'])}")
|
|
316
325
|
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
|