opensees-cli 0.3.1__tar.gz → 0.3.2__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.1 → opensees_cli-0.3.2}/PKG-INFO +1 -1
- {opensees_cli-0.3.1 → opensees_cli-0.3.2}/pyproject.toml +1 -1
- {opensees_cli-0.3.1 → opensees_cli-0.3.2}/src/opensees_cli/__init__.py +1 -1
- {opensees_cli-0.3.1 → opensees_cli-0.3.2}/src/opensees_cli/auth.py +2 -17
- {opensees_cli-0.3.1 → opensees_cli-0.3.2}/src/opensees_cli.egg-info/PKG-INFO +1 -1
- {opensees_cli-0.3.1 → opensees_cli-0.3.2}/README.md +0 -0
- {opensees_cli-0.3.1 → opensees_cli-0.3.2}/setup.cfg +0 -0
- {opensees_cli-0.3.1 → opensees_cli-0.3.2}/src/opensees_cli/__main__.py +0 -0
- {opensees_cli-0.3.1 → opensees_cli-0.3.2}/src/opensees_cli/api.py +0 -0
- {opensees_cli-0.3.1 → opensees_cli-0.3.2}/src/opensees_cli/config.py +0 -0
- {opensees_cli-0.3.1 → opensees_cli-0.3.2}/src/opensees_cli/files.py +0 -0
- {opensees_cli-0.3.1 → opensees_cli-0.3.2}/src/opensees_cli/main.py +0 -0
- {opensees_cli-0.3.1 → opensees_cli-0.3.2}/src/opensees_cli/path_setup.py +0 -0
- {opensees_cli-0.3.1 → opensees_cli-0.3.2}/src/opensees_cli/run.py +0 -0
- {opensees_cli-0.3.1 → opensees_cli-0.3.2}/src/opensees_cli/version.py +0 -0
- {opensees_cli-0.3.1 → opensees_cli-0.3.2}/src/opensees_cli.egg-info/SOURCES.txt +0 -0
- {opensees_cli-0.3.1 → opensees_cli-0.3.2}/src/opensees_cli.egg-info/dependency_links.txt +0 -0
- {opensees_cli-0.3.1 → opensees_cli-0.3.2}/src/opensees_cli.egg-info/entry_points.txt +0 -0
- {opensees_cli-0.3.1 → opensees_cli-0.3.2}/src/opensees_cli.egg-info/requires.txt +0 -0
- {opensees_cli-0.3.1 → opensees_cli-0.3.2}/src/opensees_cli.egg-info/top_level.txt +0 -0
- {opensees_cli-0.3.1 → opensees_cli-0.3.2}/tests/test_api.py +0 -0
- {opensees_cli-0.3.1 → opensees_cli-0.3.2}/tests/test_auth_commands.py +0 -0
- {opensees_cli-0.3.1 → opensees_cli-0.3.2}/tests/test_config.py +0 -0
- {opensees_cli-0.3.1 → opensees_cli-0.3.2}/tests/test_files_commands.py +0 -0
- {opensees_cli-0.3.1 → opensees_cli-0.3.2}/tests/test_main_commands.py +0 -0
- {opensees_cli-0.3.1 → opensees_cli-0.3.2}/tests/test_run_commands.py +0 -0
- {opensees_cli-0.3.1 → opensees_cli-0.3.2}/tests/test_version_commands.py +0 -0
|
@@ -268,13 +268,6 @@ def _fmt_bytes_precise(n: float) -> str:
|
|
|
268
268
|
return f"{n:.2f} GB"
|
|
269
269
|
|
|
270
270
|
|
|
271
|
-
def _fmt_usage(n: float) -> str:
|
|
272
|
-
n = float(n or 0)
|
|
273
|
-
if abs(n - round(n)) < 0.05:
|
|
274
|
-
return str(int(round(n)))
|
|
275
|
-
return f"{n:.1f}"
|
|
276
|
-
|
|
277
|
-
|
|
278
271
|
def _usage_parts(q: dict) -> tuple:
|
|
279
272
|
maximum = q.get("max_monthly_usage")
|
|
280
273
|
if maximum is None:
|
|
@@ -295,7 +288,7 @@ def _usage_parts(q: dict) -> tuple:
|
|
|
295
288
|
|
|
296
289
|
def print_quota(q: dict) -> None:
|
|
297
290
|
"""Print quota info to the console."""
|
|
298
|
-
max_rt, used, reserved,
|
|
291
|
+
max_rt, used, reserved, _remaining = _usage_parts(q)
|
|
299
292
|
committed = used + reserved
|
|
300
293
|
pct = (committed / max_rt * 100) if max_rt else 0
|
|
301
294
|
rt_color = "green" if pct < 75 else ("yellow" if pct < 90 else "red")
|
|
@@ -317,15 +310,7 @@ def print_quota(q: dict) -> None:
|
|
|
317
310
|
console.print(f" Max task timeout: {_fmt_duration(q['max_task_timeout']) if q.get('max_task_timeout') else '-'}")
|
|
318
311
|
console.print(f" Max RAM: {_fmt_bytes((q.get('max_ram_mb') or 1024) * 1024 * 1024)}")
|
|
319
312
|
console.print(f" Max storage/task: {_fmt_bytes(q['max_storage_per_task']) if q.get('max_storage_per_task') else '-'}")
|
|
320
|
-
|
|
321
|
-
console.print(
|
|
322
|
-
f" Monthly usage: [{rt_color}]{_fmt_usage(used)} settled"
|
|
323
|
-
f" + {_fmt_usage(reserved)} in-flight[/{rt_color}]"
|
|
324
|
-
f" / {_fmt_usage(max_rt)} ({pct:.0f}% committed)"
|
|
325
|
-
)
|
|
326
|
-
else:
|
|
327
|
-
console.print(f" Monthly usage: [{rt_color}]{_fmt_usage(used)}[/{rt_color}] / {_fmt_usage(max_rt)} ({pct:.0f}% used)")
|
|
328
|
-
console.print(f" Usage left: {_fmt_usage(remaining)}")
|
|
313
|
+
console.print(f" Monthly usage: [{rt_color}]{pct:.0f}%[/{rt_color}]")
|
|
329
314
|
if q.get("next_reset_at"):
|
|
330
315
|
console.print(f" Next cycle: {_to_local_date(q['next_reset_at'])}")
|
|
331
316
|
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
|