commiefetch 1.2.2__tar.gz → 1.2.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.
- {commiefetch-1.2.2/src/commiefetch.egg-info → commiefetch-1.2.3}/PKG-INFO +1 -1
- {commiefetch-1.2.2 → commiefetch-1.2.3}/pyproject.toml +1 -1
- {commiefetch-1.2.2 → commiefetch-1.2.3}/src/commiefetch/__init__.py +1 -1
- {commiefetch-1.2.2 → commiefetch-1.2.3}/src/commiefetch/modules.py +25 -20
- {commiefetch-1.2.2 → commiefetch-1.2.3/src/commiefetch.egg-info}/PKG-INFO +1 -1
- {commiefetch-1.2.2 → commiefetch-1.2.3}/LICENSE +0 -0
- {commiefetch-1.2.2 → commiefetch-1.2.3}/README.md +0 -0
- {commiefetch-1.2.2 → commiefetch-1.2.3}/setup.cfg +0 -0
- {commiefetch-1.2.2 → commiefetch-1.2.3}/setup.py +0 -0
- {commiefetch-1.2.2 → commiefetch-1.2.3}/src/commiefetch/__main__.py +0 -0
- {commiefetch-1.2.2 → commiefetch-1.2.3}/src/commiefetch/cli.py +0 -0
- {commiefetch-1.2.2 → commiefetch-1.2.3}/src/commiefetch/colors.py +0 -0
- {commiefetch-1.2.2 → commiefetch-1.2.3}/src/commiefetch/config.py +0 -0
- {commiefetch-1.2.2 → commiefetch-1.2.3}/src/commiefetch/logos.py +0 -0
- {commiefetch-1.2.2 → commiefetch-1.2.3}/src/commiefetch.egg-info/SOURCES.txt +0 -0
- {commiefetch-1.2.2 → commiefetch-1.2.3}/src/commiefetch.egg-info/dependency_links.txt +0 -0
- {commiefetch-1.2.2 → commiefetch-1.2.3}/src/commiefetch.egg-info/entry_points.txt +0 -0
- {commiefetch-1.2.2 → commiefetch-1.2.3}/src/commiefetch.egg-info/top_level.txt +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
__version__ = "1.2.
|
|
1
|
+
__version__ = "1.2.3"
|
|
2
2
|
__app_name__ = "commiefetch"
|
|
@@ -440,19 +440,27 @@ def get_memory():
|
|
|
440
440
|
system = platform.system()
|
|
441
441
|
if system == "Linux":
|
|
442
442
|
meminfo = {}
|
|
443
|
-
raw = None
|
|
444
443
|
try:
|
|
445
444
|
with open("/proc/meminfo") as f:
|
|
446
|
-
|
|
445
|
+
for line in f:
|
|
446
|
+
parts = line.split(":")
|
|
447
|
+
if len(parts) == 2:
|
|
448
|
+
val = parts[1].strip()
|
|
449
|
+
if val.endswith(" kB"):
|
|
450
|
+
val = int(val.split()[0]) // 1024
|
|
451
|
+
meminfo[parts[0]] = val
|
|
447
452
|
except Exception:
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
453
|
+
out = run_cmd(["cat", "/proc/meminfo"], timeout=3)
|
|
454
|
+
if out:
|
|
455
|
+
for line in out.split("\n"):
|
|
456
|
+
parts = line.split(":")
|
|
457
|
+
if len(parts) == 2:
|
|
458
|
+
val = parts[1].strip()
|
|
459
|
+
if val.endswith(" kB"):
|
|
460
|
+
val = int(val.split()[0]) // 1024
|
|
461
|
+
meminfo[parts[0]] = val
|
|
454
462
|
total = meminfo.get("MemTotal", 0)
|
|
455
|
-
if not isinstance(total, (int, float))
|
|
463
|
+
if not isinstance(total, (int, float)):
|
|
456
464
|
total = 0
|
|
457
465
|
if total == 0:
|
|
458
466
|
result = _get_sysinfo_memory()
|
|
@@ -467,17 +475,14 @@ def get_memory():
|
|
|
467
475
|
if line.startswith("Mem:"):
|
|
468
476
|
cols = line.split()
|
|
469
477
|
if len(cols) >= 3:
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
}
|
|
479
|
-
except Exception:
|
|
480
|
-
pass
|
|
478
|
+
t = int(cols[1])
|
|
479
|
+
if t > 0:
|
|
480
|
+
u = int(cols[2])
|
|
481
|
+
return {
|
|
482
|
+
"total": t, "used": u,
|
|
483
|
+
"available": t - u, "unit": "MiB",
|
|
484
|
+
"percent": round(u / t * 100, 1),
|
|
485
|
+
}
|
|
481
486
|
return None
|
|
482
487
|
avail = meminfo.get("MemAvailable", 0)
|
|
483
488
|
if not isinstance(avail, (int, float)):
|
|
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
|