statblk 1.22__py3-none-any.whl → 1.24__py3-none-any.whl
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.
- {statblk-1.22.dist-info → statblk-1.24.dist-info}/METADATA +1 -1
- statblk-1.24.dist-info/RECORD +6 -0
- statblk.py +14 -5
- statblk-1.22.dist-info/RECORD +0 -6
- {statblk-1.22.dist-info → statblk-1.24.dist-info}/WHEEL +0 -0
- {statblk-1.22.dist-info → statblk-1.24.dist-info}/entry_points.txt +0 -0
- {statblk-1.22.dist-info → statblk-1.24.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,6 @@
|
|
1
|
+
statblk.py,sha256=G4d4sAHSntx7yNDNGm4QraddfeaBE-4-1LvQK0wq1XA,27617
|
2
|
+
statblk-1.24.dist-info/METADATA,sha256=2myAwJWf7SBkiKQp-d9I3dwm_iV-lFH2TlJ-qdnvmGA,1465
|
3
|
+
statblk-1.24.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
4
|
+
statblk-1.24.dist-info/entry_points.txt,sha256=JDz-sa6FIdaOckmlz9NbnhZXQaB5Yle-cTKgUQmAV40,41
|
5
|
+
statblk-1.24.dist-info/top_level.txt,sha256=dBdU6_PD4tG_7uquWEs6YremqudiePASv3u3G59scf4,8
|
6
|
+
statblk-1.24.dist-info/RECORD,,
|
statblk.py
CHANGED
@@ -276,7 +276,7 @@ except :
|
|
276
276
|
def cache_decorator(func):
|
277
277
|
return func
|
278
278
|
|
279
|
-
version = '1.
|
279
|
+
version = '1.24'
|
280
280
|
VERSION = version
|
281
281
|
__version__ = version
|
282
282
|
COMMIT_DATE = '2025-09-10'
|
@@ -501,7 +501,9 @@ def get_read_write_rate_throughput_iter(sysfs_block_path):
|
|
501
501
|
|
502
502
|
# DRIVE_INFO = namedtuple("DRIVE_INFO",
|
503
503
|
# ["NAME", "FSTYPE", "SIZE", "FSUSEPCT", "MOUNTPOINT", "SMART","RTPT",'WTPT', "LABEL", "UUID", "MODEL", "SERIAL", "DISCARD"])
|
504
|
-
def get_drives_info(print_bytes = False, use_1024 = False, mounted_only=False, best_only=False,
|
504
|
+
def get_drives_info(print_bytes = False, use_1024 = False, mounted_only=False, best_only=False,
|
505
|
+
formated_only=False, show_zero_size_devices=False,pseudo=False,tptDict = {},
|
506
|
+
full=False,active_only=False):
|
505
507
|
lsblk_result = multiCMD.run_command(f'lsblk -brnp -o NAME,SIZE,FSTYPE,UUID,LABEL',timeout=2,quiet=True,wait_for_return=False,return_object=True)
|
506
508
|
block_devices = get_blocks()
|
507
509
|
smart_infos = {}
|
@@ -526,6 +528,8 @@ def get_drives_info(print_bytes = False, use_1024 = False, mounted_only=False, b
|
|
526
528
|
if lsblk_result.returncode == 0:
|
527
529
|
for line in lsblk_result.stdout:
|
528
530
|
lsblk_name, lsblk_size, lsblk_fstype, lsblk_uuid, lsblk_label = line.split(' ', 4)
|
531
|
+
if lsblk_name.startswith(os.path.sep):
|
532
|
+
lsblk_name = os.path.realpath(lsblk_name)
|
529
533
|
# the label can be \x escaped, we need to decode it
|
530
534
|
lsblk_uuid = bytes(lsblk_uuid, "utf-8").decode("unicode_escape")
|
531
535
|
lsblk_fstype = bytes(lsblk_fstype, "utf-8").decode("unicode_escape")
|
@@ -540,10 +544,12 @@ def get_drives_info(print_bytes = False, use_1024 = False, mounted_only=False, b
|
|
540
544
|
size_dict[lsblk_name] = int(lsblk_size)
|
541
545
|
except Exception:
|
542
546
|
pass
|
543
|
-
output = [["NAME", "FSTYPE", "SIZE", "FSUSE%", "MOUNTPOINT", "SMART", "LABEL", "UUID", "MODEL", "SERIAL", "DISCARD","
|
547
|
+
output = [["NAME", "FSTYPE", "SIZE", "FSUSE%", "MOUNTPOINT", "SMART", "LABEL", "UUID", "MODEL", "SERIAL", "DISCARD","READ",'WRITE']]
|
544
548
|
for device_name in target_devices:
|
545
549
|
if mounted_only and device_name not in mount_table:
|
546
550
|
continue
|
551
|
+
if active_only and device_name not in tptDict:
|
552
|
+
continue
|
547
553
|
fstype = ''
|
548
554
|
size = ''
|
549
555
|
fsusepct = ''
|
@@ -580,6 +586,8 @@ def get_drives_info(print_bytes = False, use_1024 = False, mounted_only=False, b
|
|
580
586
|
if device_name in tptDict:
|
581
587
|
try:
|
582
588
|
rtpt, wtpt = next(tptDict[device_name])
|
589
|
+
if active_only and rtpt == 0 and wtpt == 0:
|
590
|
+
continue
|
583
591
|
if print_bytes:
|
584
592
|
rtpt = str(rtpt)
|
585
593
|
wtpt = str(wtpt)
|
@@ -640,7 +648,8 @@ def main():
|
|
640
648
|
parser.add_argument('-F','-fo','--formated_only', help="Show only formated filesystems", action="store_true")
|
641
649
|
parser.add_argument('-M','-mo','--mounted_only', help="Show only mounted filesystems", action="store_true")
|
642
650
|
parser.add_argument('-B','-bo','--best_only', help="Show only shortest mount point for each device", action="store_true")
|
643
|
-
parser.add_argument('-
|
651
|
+
parser.add_argument('-A','-ao','--active_only', help="Show only active devices (positive read/write activity)", action="store_true")
|
652
|
+
parser.add_argument('-R','--full', help="Show full device information, do not collapse drive info when length > console length", action="store_true")
|
644
653
|
parser.add_argument('-P','--pseudo', help="Include pseudo file systems as well (tmpfs / nfs / cifs etc.)", action="store_true")
|
645
654
|
parser.add_argument('--show_zero_size_devices', help="Show devices with zero size", action="store_true")
|
646
655
|
parser.add_argument('print_period', nargs='?', default=0, type=int, help="If specified as a number, repeat the output every N seconds")
|
@@ -652,7 +661,7 @@ def main():
|
|
652
661
|
results = get_drives_info(print_bytes = args.bytes, use_1024 = not args.si,
|
653
662
|
mounted_only=args.mounted_only, best_only=args.best_only,
|
654
663
|
formated_only=args.formated_only, show_zero_size_devices=args.show_zero_size_devices,
|
655
|
-
pseudo=args.pseudo,tptDict=tptDict,full=args.full)
|
664
|
+
pseudo=args.pseudo,tptDict=tptDict,full=args.full,active_only=args.active_only)
|
656
665
|
if args.json:
|
657
666
|
import json
|
658
667
|
print(json.dumps(results, indent=1))
|
statblk-1.22.dist-info/RECORD
DELETED
@@ -1,6 +0,0 @@
|
|
1
|
-
statblk.py,sha256=C8_7zjjE0b5hKj7GtK73jXcQcaRr96uhtWb-RDenPug,27212
|
2
|
-
statblk-1.22.dist-info/METADATA,sha256=rVGQOV-ggZp3EHWxPqm9dp7ZaSWfYUkdhaPmhz0P-Cg,1465
|
3
|
-
statblk-1.22.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
4
|
-
statblk-1.22.dist-info/entry_points.txt,sha256=JDz-sa6FIdaOckmlz9NbnhZXQaB5Yle-cTKgUQmAV40,41
|
5
|
-
statblk-1.22.dist-info/top_level.txt,sha256=dBdU6_PD4tG_7uquWEs6YremqudiePASv3u3G59scf4,8
|
6
|
-
statblk-1.22.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|