statblk 1.23__tar.gz → 1.25__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.
- {statblk-1.23 → statblk-1.25}/PKG-INFO +1 -1
- {statblk-1.23 → statblk-1.25}/statblk.egg-info/PKG-INFO +1 -1
- {statblk-1.23 → statblk-1.25}/statblk.py +14 -7
- {statblk-1.23 → statblk-1.25}/README.txt +0 -0
- {statblk-1.23 → statblk-1.25}/setup.cfg +0 -0
- {statblk-1.23 → statblk-1.25}/setup.py +0 -0
- {statblk-1.23 → statblk-1.25}/statblk.egg-info/SOURCES.txt +0 -0
- {statblk-1.23 → statblk-1.25}/statblk.egg-info/dependency_links.txt +0 -0
- {statblk-1.23 → statblk-1.25}/statblk.egg-info/entry_points.txt +0 -0
- {statblk-1.23 → statblk-1.25}/statblk.egg-info/requires.txt +0 -0
- {statblk-1.23 → statblk-1.25}/statblk.egg-info/top_level.txt +0 -0
@@ -276,7 +276,7 @@ except :
|
|
276
276
|
def cache_decorator(func):
|
277
277
|
return func
|
278
278
|
|
279
|
-
version = '1.
|
279
|
+
version = '1.25'
|
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 = {}
|
@@ -542,10 +544,12 @@ def get_drives_info(print_bytes = False, use_1024 = False, mounted_only=False, b
|
|
542
544
|
size_dict[lsblk_name] = int(lsblk_size)
|
543
545
|
except Exception:
|
544
546
|
pass
|
545
|
-
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']]
|
546
548
|
for device_name in target_devices:
|
547
549
|
if mounted_only and device_name not in mount_table:
|
548
550
|
continue
|
551
|
+
if active_only and device_name not in tptDict:
|
552
|
+
continue
|
549
553
|
fstype = ''
|
550
554
|
size = ''
|
551
555
|
fsusepct = ''
|
@@ -582,12 +586,14 @@ def get_drives_info(print_bytes = False, use_1024 = False, mounted_only=False, b
|
|
582
586
|
if device_name in tptDict:
|
583
587
|
try:
|
584
588
|
rtpt, wtpt = next(tptDict[device_name])
|
589
|
+
if active_only and rtpt == 0 and wtpt == 0:
|
590
|
+
continue
|
585
591
|
if print_bytes:
|
586
592
|
rtpt = str(rtpt)
|
587
593
|
wtpt = str(wtpt)
|
588
594
|
else:
|
589
|
-
rtpt = multiCMD.format_bytes(rtpt, use_1024_bytes=use_1024, to_str=True,str_format='.
|
590
|
-
wtpt = multiCMD.format_bytes(wtpt, use_1024_bytes=use_1024, to_str=True,str_format='.
|
595
|
+
rtpt = multiCMD.format_bytes(rtpt, use_1024_bytes=use_1024, to_str=True,str_format='.0f') + 'B/s'
|
596
|
+
wtpt = multiCMD.format_bytes(wtpt, use_1024_bytes=use_1024, to_str=True,str_format='.0f') + 'B/s'
|
591
597
|
except Exception:
|
592
598
|
rtpt = ''
|
593
599
|
wtpt = ''
|
@@ -642,7 +648,8 @@ def main():
|
|
642
648
|
parser.add_argument('-F','-fo','--formated_only', help="Show only formated filesystems", action="store_true")
|
643
649
|
parser.add_argument('-M','-mo','--mounted_only', help="Show only mounted filesystems", action="store_true")
|
644
650
|
parser.add_argument('-B','-bo','--best_only', help="Show only shortest mount point for each device", action="store_true")
|
645
|
-
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")
|
646
653
|
parser.add_argument('-P','--pseudo', help="Include pseudo file systems as well (tmpfs / nfs / cifs etc.)", action="store_true")
|
647
654
|
parser.add_argument('--show_zero_size_devices', help="Show devices with zero size", action="store_true")
|
648
655
|
parser.add_argument('print_period', nargs='?', default=0, type=int, help="If specified as a number, repeat the output every N seconds")
|
@@ -654,7 +661,7 @@ def main():
|
|
654
661
|
results = get_drives_info(print_bytes = args.bytes, use_1024 = not args.si,
|
655
662
|
mounted_only=args.mounted_only, best_only=args.best_only,
|
656
663
|
formated_only=args.formated_only, show_zero_size_devices=args.show_zero_size_devices,
|
657
|
-
pseudo=args.pseudo,tptDict=tptDict,full=args.full)
|
664
|
+
pseudo=args.pseudo,tptDict=tptDict,full=args.full,active_only=args.active_only)
|
658
665
|
if args.json:
|
659
666
|
import json
|
660
667
|
print(json.dumps(results, indent=1))
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|