Include RAM details in report

* Addresses issue #88
This commit is contained in:
2Shirt 2019-05-13 18:07:52 -06:00
parent 3088a2452a
commit 6fe273cf8b
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C

View file

@ -59,6 +59,14 @@ class CpuObj():
report.append('{BLUE}Device{CLEAR}'.format(**COLORS))
report.append(' {}'.format(self.name))
# Include RAM details
ram_details = get_ram_details()
ram_total = human_readable_size(ram_details.pop('Total', 0)).strip()
ram_dimms = ['{}x {}'.format(v, k) for k, v in sorted(ram_details.items())]
report.append(' ')
report.append('{BLUE}RAM{CLEAR}'.format(**COLORS))
report.append(' {} ({})'.format(ram_total, ', '.join(ram_dimms)))
# Tests
for test in self.tests.values():
report.extend(test.report)
@ -760,10 +768,6 @@ def get_ram_details():
result = run_program(cmd, encoding='utf-8', errors='ignore')
dmi_data = result.stdout.splitlines()
# Testing
with open('dmi_mem.log', 'r') as f:
dmi_data = f.readlines()
# Parse data
for line in dmi_data:
line = line.strip()