SHICTHRSMACE 1.6.0__tar.gz → 1.7.0__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.
- {shicthrsmace-1.6.0 → shicthrsmace-1.7.0}/PKG-INFO +1 -1
- shicthrsmace-1.7.0/SHICTHRSMACE/api/SHRMACE_get_mem_info.py +47 -0
- {shicthrsmace-1.6.0 → shicthrsmace-1.7.0}/SHICTHRSMACE.egg-info/PKG-INFO +1 -1
- {shicthrsmace-1.6.0 → shicthrsmace-1.7.0}/setup.py +1 -1
- shicthrsmace-1.6.0/SHICTHRSMACE/api/SHRMACE_get_mem_info.py +0 -35
- {shicthrsmace-1.6.0 → shicthrsmace-1.7.0}/SHICTHRSMACE/SHRMACE_Data.py +0 -0
- {shicthrsmace-1.6.0 → shicthrsmace-1.7.0}/SHICTHRSMACE/SHRMACE_ErrorBase.py +0 -0
- {shicthrsmace-1.6.0 → shicthrsmace-1.7.0}/SHICTHRSMACE/__init__.py +0 -0
- {shicthrsmace-1.6.0 → shicthrsmace-1.7.0}/SHICTHRSMACE/api/SHRMACE_get_cpu_id.py +0 -0
- {shicthrsmace-1.6.0 → shicthrsmace-1.7.0}/SHICTHRSMACE/api/SHRMACE_get_cpu_info.py +0 -0
- {shicthrsmace-1.6.0 → shicthrsmace-1.7.0}/SHICTHRSMACE/api/SHRMACE_get_cpu_vendor.py +0 -0
- {shicthrsmace-1.6.0 → shicthrsmace-1.7.0}/SHICTHRSMACE/api/SHRMACE_get_disk_id.py +0 -0
- {shicthrsmace-1.6.0 → shicthrsmace-1.7.0}/SHICTHRSMACE/api/SHRMACE_get_disk_info.py +0 -0
- {shicthrsmace-1.6.0 → shicthrsmace-1.7.0}/SHICTHRSMACE/api/SHRMACE_get_gpu_id.py +0 -0
- {shicthrsmace-1.6.0 → shicthrsmace-1.7.0}/SHICTHRSMACE/api/SHRMACE_get_gpu_info.py +0 -0
- {shicthrsmace-1.6.0 → shicthrsmace-1.7.0}/SHICTHRSMACE/api/SHRMACE_get_mac_info.py +0 -0
- {shicthrsmace-1.6.0 → shicthrsmace-1.7.0}/SHICTHRSMACE/api/SHRMACE_get_mb_id.py +0 -0
- {shicthrsmace-1.6.0 → shicthrsmace-1.7.0}/SHICTHRSMACE/api/SHRMACE_get_mb_info.py +0 -0
- {shicthrsmace-1.6.0 → shicthrsmace-1.7.0}/SHICTHRSMACE/api/SHRMACE_get_pdc_id.py +0 -0
- {shicthrsmace-1.6.0 → shicthrsmace-1.7.0}/SHICTHRSMACE/api/SHRMACE_get_system_info.py +0 -0
- {shicthrsmace-1.6.0 → shicthrsmace-1.7.0}/SHICTHRSMACE/api/SHRMACE_get_uuid.py +0 -0
- {shicthrsmace-1.6.0 → shicthrsmace-1.7.0}/SHICTHRSMACE/api/__init__.py +0 -0
- {shicthrsmace-1.6.0 → shicthrsmace-1.7.0}/SHICTHRSMACE/utils/SHRMACE_dispatcher.py +0 -0
- {shicthrsmace-1.6.0 → shicthrsmace-1.7.0}/SHICTHRSMACE/utils/__init__.py +0 -0
- {shicthrsmace-1.6.0 → shicthrsmace-1.7.0}/SHICTHRSMACE.egg-info/SOURCES.txt +0 -0
- {shicthrsmace-1.6.0 → shicthrsmace-1.7.0}/SHICTHRSMACE.egg-info/dependency_links.txt +0 -0
- {shicthrsmace-1.6.0 → shicthrsmace-1.7.0}/SHICTHRSMACE.egg-info/not-zip-safe +0 -0
- {shicthrsmace-1.6.0 → shicthrsmace-1.7.0}/SHICTHRSMACE.egg-info/requires.txt +0 -0
- {shicthrsmace-1.6.0 → shicthrsmace-1.7.0}/SHICTHRSMACE.egg-info/top_level.txt +0 -0
- {shicthrsmace-1.6.0 → shicthrsmace-1.7.0}/setup.cfg +0 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
|
|
2
|
+
import subprocess
|
|
3
|
+
import copy
|
|
4
|
+
from ..SHRMACE_ErrorBase import SHRMACEException
|
|
5
|
+
|
|
6
|
+
MEM_INFO_COMMAND : str = 'wmic memorychip get Manufacturer, PartNumber, SerialNumber, Capacity, Speed, DeviceLocator, MemoryType, FormFactor'
|
|
7
|
+
|
|
8
|
+
def get_mem_info(var) -> None:
|
|
9
|
+
try:
|
|
10
|
+
output = subprocess.check_output(
|
|
11
|
+
MEM_INFO_COMMAND,
|
|
12
|
+
shell=True,
|
|
13
|
+
text=True,
|
|
14
|
+
stderr=subprocess.STDOUT,
|
|
15
|
+
encoding='utf-8'
|
|
16
|
+
)
|
|
17
|
+
lines = [line.strip() for line in output.split('\n') if line.strip()]
|
|
18
|
+
if len(lines) < 2:
|
|
19
|
+
return []
|
|
20
|
+
|
|
21
|
+
headers = [h.strip() for h in lines[0].split(' ') if h.strip()]
|
|
22
|
+
modules = []
|
|
23
|
+
|
|
24
|
+
for line in lines[1:]:
|
|
25
|
+
values = []
|
|
26
|
+
remaining = line
|
|
27
|
+
for i in range(len(headers)):
|
|
28
|
+
if i == len(headers) - 1:
|
|
29
|
+
values.append(remaining.strip())
|
|
30
|
+
else:
|
|
31
|
+
parts = remaining.strip().split(' ', 1)
|
|
32
|
+
if len(parts) > 0:
|
|
33
|
+
values.append(parts[0].strip())
|
|
34
|
+
remaining = parts[1] if len(parts) > 1 else ''
|
|
35
|
+
else:
|
|
36
|
+
values.append('')
|
|
37
|
+
|
|
38
|
+
if len(values) == len(headers):
|
|
39
|
+
module_info = {}
|
|
40
|
+
for h, v in zip(headers, values):
|
|
41
|
+
module_info[h] = v
|
|
42
|
+
modules.append(module_info)
|
|
43
|
+
|
|
44
|
+
var.SHRMACEResult['MemeroyINFO'] = copy.deepcopy(modules)
|
|
45
|
+
|
|
46
|
+
except Exception as e:
|
|
47
|
+
raise SHRMACEException(f'SHRMACE [ERROR.2011] unable to get memory info. | {"".join(e.args)}')
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import subprocess
|
|
3
|
-
import copy
|
|
4
|
-
from ..SHRMACE_ErrorBase import SHRMACEException
|
|
5
|
-
|
|
6
|
-
MEM_INFO_COMMAND : str = 'wmic memorychip get Manufacturer, PartNumber, SerialNumber, Capacity, Speed, DeviceLocator, MemoryType, FormFactor'
|
|
7
|
-
|
|
8
|
-
def get_mem_info(var) -> None:
|
|
9
|
-
try:
|
|
10
|
-
output = subprocess.check_output(
|
|
11
|
-
MEM_INFO_COMMAND,
|
|
12
|
-
shell=True,
|
|
13
|
-
text=True,
|
|
14
|
-
stderr=subprocess.STDOUT,
|
|
15
|
-
encoding='utf-8'
|
|
16
|
-
)
|
|
17
|
-
lines = [line.strip() for line in output.split('\n') if line.strip()]
|
|
18
|
-
if len(lines) < 2:
|
|
19
|
-
return []
|
|
20
|
-
|
|
21
|
-
headers = [h.strip() for h in lines[0].split() if h.strip()]
|
|
22
|
-
modules = []
|
|
23
|
-
|
|
24
|
-
for line in lines[1:]:
|
|
25
|
-
values = [v.strip() for v in line.split(None, len(headers) - 1)]
|
|
26
|
-
if len(values) != len(headers):
|
|
27
|
-
continue
|
|
28
|
-
|
|
29
|
-
module_info = dict(zip(headers, values))
|
|
30
|
-
modules.append(module_info)
|
|
31
|
-
|
|
32
|
-
var.SHRMACEResult['MemeroyINFO'] = copy.deepcopy(modules)
|
|
33
|
-
|
|
34
|
-
except Exception as e:
|
|
35
|
-
raise SHRMACEException(f'SHRMACE [ERROR.2011] unable to get memory info. | {''.join(e.args)}')
|
|
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
|
|
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
|