pass lshw dict instead of raw data
This commit is contained in:
parent
76336ff34d
commit
7e3904700f
|
@ -1,4 +1,3 @@
|
||||||
import json
|
|
||||||
import re
|
import re
|
||||||
from contextlib import suppress
|
from contextlib import suppress
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
@ -418,7 +417,7 @@ class Computer(Device):
|
||||||
self._ram = None
|
self._ram = None
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def run(cls, lshw_raw, hwinfo_raw):
|
def run(cls, lshw, hwinfo_raw):
|
||||||
"""
|
"""
|
||||||
Gets hardware information from the computer and its components,
|
Gets hardware information from the computer and its components,
|
||||||
like serial numbers or model names, and benchmarks them.
|
like serial numbers or model names, and benchmarks them.
|
||||||
|
@ -426,7 +425,6 @@ class Computer(Device):
|
||||||
This function uses ``LSHW`` as the main source of hardware information,
|
This function uses ``LSHW`` as the main source of hardware information,
|
||||||
which is obtained once when it is instantiated.
|
which is obtained once when it is instantiated.
|
||||||
"""
|
"""
|
||||||
lshw = json.loads(lshw_raw)
|
|
||||||
hwinfo = hwinfo_raw.splitlines()
|
hwinfo = hwinfo_raw.splitlines()
|
||||||
computer = cls(lshw)
|
computer = cls(lshw)
|
||||||
components = []
|
components = []
|
||||||
|
|
Reference in New Issue