pyhw 0.2.3b0__py3-none-any.whl → 0.3.1__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- pyhw/__main__.py +0 -1
- pyhw/backend/cpu/linux.py +9 -18
- pyhw/backend/os/macos.py +21 -3
- pyhw/frontend/logo/ascii/raspbian.pyhw +10 -23
- {pyhw-0.2.3b0.dist-info → pyhw-0.3.1.dist-info}/METADATA +1 -1
- {pyhw-0.2.3b0.dist-info → pyhw-0.3.1.dist-info}/RECORD +10 -10
- {pyhw-0.2.3b0.dist-info → pyhw-0.3.1.dist-info}/LICENSE +0 -0
- {pyhw-0.2.3b0.dist-info → pyhw-0.3.1.dist-info}/WHEEL +0 -0
- {pyhw-0.2.3b0.dist-info → pyhw-0.3.1.dist-info}/entry_points.txt +0 -0
- {pyhw-0.2.3b0.dist-info → pyhw-0.3.1.dist-info}/top_level.txt +0 -0
pyhw/__main__.py
CHANGED
@@ -15,7 +15,6 @@ from .pyhwUtil import getOS, selectOSLogo
|
|
15
15
|
|
16
16
|
def main():
|
17
17
|
current_os = getOS()
|
18
|
-
print("This is a test version of PyHw. Currently, it only supports Linux and macOS.")
|
19
18
|
if current_os != "linux" and current_os != "macos":
|
20
19
|
print(f"Only Linux and macOS is supported for now. Current os: {current_os}")
|
21
20
|
return
|
pyhw/backend/cpu/linux.py
CHANGED
@@ -58,26 +58,17 @@ class CPUDetectLinux:
|
|
58
58
|
def __handleSBC(self):
|
59
59
|
# some values should be double-checked
|
60
60
|
# Info source: https://github.com/raspberrypi/firmware/tree/master/boot
|
61
|
-
|
62
|
-
"Raspberry Pi 2 Model B Rev 1.1": "BCM2836",
|
63
|
-
"Raspberry Pi 2 Model B Rev 1.2": "BCM2837",
|
64
|
-
"Raspberry Pi 3 Model B": "BCM2837",
|
65
|
-
"Raspberry Pi 3 Model B+": "BCM2837",
|
66
|
-
"Raspberry Pi 4 Model B": "BCM2711",
|
67
|
-
"Raspberry Pi 5": "BCM2712",
|
68
|
-
}
|
69
|
-
if os.path.exists("/sys/firmware/devicetree/base/model"):
|
61
|
+
if os.path.exists("/sys/firmware/devicetree/base/compatible"):
|
70
62
|
try:
|
71
|
-
with open("/sys/firmware/devicetree/base/
|
72
|
-
|
63
|
+
with open("/sys/firmware/devicetree/base/compatible", "r") as f:
|
64
|
+
compatible = f.read().strip()
|
73
65
|
except FileNotFoundError:
|
74
|
-
|
75
|
-
if "
|
76
|
-
|
77
|
-
if
|
78
|
-
self.__cpuInfo.model =
|
79
|
-
else:
|
80
|
-
pass
|
66
|
+
compatible = ""
|
67
|
+
if "raspberrypi" in compatible:
|
68
|
+
model = compatible.split(",")[-1]
|
69
|
+
if model.startswith("bcm"):
|
70
|
+
self.__cpuInfo.model = model.upper()
|
81
71
|
else:
|
82
72
|
pass
|
83
73
|
|
74
|
+
|
pyhw/backend/os/macos.py
CHANGED
@@ -13,7 +13,11 @@ class OSDetectMacOS:
|
|
13
13
|
|
14
14
|
def getOSInfo(self):
|
15
15
|
self.__getOS()
|
16
|
-
self.
|
16
|
+
self.__handelOSName()
|
17
|
+
if self.__VersionName != "":
|
18
|
+
self.__osInfo.prettyName = f"{self.__ProductName} {self.__VersionName} {self.__ProductVersion} {self.__BuildVersion} {getArch()}"
|
19
|
+
else:
|
20
|
+
self.__osInfo.prettyName = f"{self.__ProductName} {self.__ProductVersion} {self.__BuildVersion} {getArch()}"
|
17
21
|
self.__osInfo.id = "macOS"
|
18
22
|
return self.__osInfo
|
19
23
|
|
@@ -32,5 +36,19 @@ class OSDetectMacOS:
|
|
32
36
|
self.__BuildVersion = sw_ver.split(":")[1].strip()
|
33
37
|
|
34
38
|
def __handelOSName(self):
|
35
|
-
#
|
36
|
-
|
39
|
+
# Only supports modern macOS
|
40
|
+
macOSVersionMap = {
|
41
|
+
"11": "Big Sur",
|
42
|
+
"12": "Monterey",
|
43
|
+
"13": "Ventura",
|
44
|
+
"14": "Sonoma",
|
45
|
+
"15": "Sequoia"
|
46
|
+
}
|
47
|
+
if "." in self.__ProductVersion:
|
48
|
+
major = self.__ProductVersion.split(".")[0]
|
49
|
+
else:
|
50
|
+
major = self.__ProductVersion
|
51
|
+
version_name = macOSVersionMap.get(major, "")
|
52
|
+
if version_name != "":
|
53
|
+
self.__VersionName = version_name
|
54
|
+
|
@@ -1,23 +1,10 @@
|
|
1
|
-
$2
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
.::::::::` -::::::::` `
|
12
|
-
.::` .:::::::::- `::::::::::``::.
|
13
|
-
-:::` ::::::::::. ::::::::::.`:::-
|
14
|
-
:::: -::::::::. `-:::::::: ::::
|
15
|
-
-::- .-:::-.``....``.-::-. -::-
|
16
|
-
.. `` .::::::::. `..`..
|
17
|
-
-:::-` -::::::::::` .:::::`
|
18
|
-
:::::::` -::::::::::` :::::::.
|
19
|
-
.::::::: -::::::::. ::::::::
|
20
|
-
`-:::::` ..--.` ::::::.
|
21
|
-
`...` `...--..` `...`
|
22
|
-
.::::::::::
|
23
|
-
`.-::::-`
|
1
|
+
$2.~~. .~~.
|
2
|
+
'. \ ' ' / .'$1
|
3
|
+
.~ .~~~..~.
|
4
|
+
: .~.'~'.~. :
|
5
|
+
~ ( ) ( ) ~
|
6
|
+
( : '~'.~.'~' : )
|
7
|
+
~ .~ ( ) ~. ~
|
8
|
+
( : '~' : )
|
9
|
+
'~ .~~~. ~'
|
10
|
+
'~'
|
@@ -1,12 +1,12 @@
|
|
1
1
|
pyhw/__init__.py,sha256=IMjkMO3twhQzluVTo8Z6rE7Eg-9U79_LGKMcsWLKBkY,22
|
2
|
-
pyhw/__main__.py,sha256=
|
2
|
+
pyhw/__main__.py,sha256=EZPquqahE-4VvSJK3kHbxBHNR_1_Yah9T640ZUtXKO8,1467
|
3
3
|
pyhw/macos.py,sha256=kF973QvtEFky4m8RnYTJ-HWPuJi3625tvnWqJAT_DHM,4598
|
4
4
|
pyhw/backend/__init__.py,sha256=knn_3Yroow1h0dqdrozk3zyy3vz-kQyNBRjR6OLmVoY,50
|
5
5
|
pyhw/backend/backendBase.py,sha256=t9FKQPdK7yFZF0vrsXpjIUJNKrB-cXYeL5MDohlgguA,450
|
6
6
|
pyhw/backend/cpu/__init__.py,sha256=5YfANJVRwNwTRodG0ENOgusrdN592aaSnfq5ok4dKTo,56
|
7
7
|
pyhw/backend/cpu/cpuBase.py,sha256=AGWqVjdvb82NiH4kxk3GERdBLwBNhkR23j2ei_l3S18,464
|
8
8
|
pyhw/backend/cpu/cpuInfo.py,sha256=A_nNGElq9W7oZ5DFJowLdFBE0ZvXKr5h29E6TGAvbRc,251
|
9
|
-
pyhw/backend/cpu/linux.py,sha256=
|
9
|
+
pyhw/backend/cpu/linux.py,sha256=HZHJ4gYl0jHS8cNNbamwj-lpzt7vOZjqYlGNr7JY0rU,3054
|
10
10
|
pyhw/backend/cpu/macos.py,sha256=mnnH9ABiBgAiyA8-H9_tq2PC5OeneVLj67nMGoLDXh4,2873
|
11
11
|
pyhw/backend/gpu/__init__.py,sha256=EpMjPvUaXt0LTNMvGmB8WgXbUB9keCxuOhu8NT3Re6o,56
|
12
12
|
pyhw/backend/gpu/gpuBase.py,sha256=Ge0DX2P8_EB7ovM7glmPUnVsPJL3OUHV2t_1T5mimR0,409
|
@@ -32,7 +32,7 @@ pyhw/backend/memory/memoryInfo.py,sha256=OQF165uEyuapAsi7cKacQYDRnKdrQHeldfyFwzS
|
|
32
32
|
pyhw/backend/metal/t.py,sha256=52yv-JoXNfaIOfcxEEidIg0MoyFtzWvTRm550kQKPZA,391
|
33
33
|
pyhw/backend/os/__init__.py,sha256=rPHQYdQK3qU6ZwwodqVoEWeqBnKffXlJyi4k3-8ViPY,53
|
34
34
|
pyhw/backend/os/linux.py,sha256=fGVmJoKw65JdgWsJjbjAxOVqw0dqkmw-BQSb-TnSQQc,1782
|
35
|
-
pyhw/backend/os/macos.py,sha256=
|
35
|
+
pyhw/backend/os/macos.py,sha256=DwgpwRD1a2oTANR_XL3kkMzNawqrt23F79dqBw3ULK8,1906
|
36
36
|
pyhw/backend/os/osBase.py,sha256=AA17HIwmWy7E6nCtqbojTNsHKtcNuehf51FxGcfXu7A,462
|
37
37
|
pyhw/backend/os/osInfo.py,sha256=iLPc7INFHH3izascwooj4JBVgvBsSgVPXWBlFXG47mQ,378
|
38
38
|
pyhw/backend/shell/__init__.py,sha256=SeQ7OLNSl_V1JCCWnJGjLilAWiSe9e5kgsMEt63TMS0,62
|
@@ -61,7 +61,7 @@ pyhw/frontend/logo/ascii/fedora.pyhw,sha256=IuFE6BByaNfVgn1pn7rKH7QVlIJyEmgGopCA
|
|
61
61
|
pyhw/frontend/logo/ascii/fedora_small.pyhw,sha256=_LSBzuCJjMa8pzmiJ3KN7Ndi-TryYPmtEfKqxxPAFfE,601
|
62
62
|
pyhw/frontend/logo/ascii/linux.pyhw,sha256=IMe6YNElwCjLtv6kgSkERbATyyJAK531vcrT-otaLWE,300
|
63
63
|
pyhw/frontend/logo/ascii/macOS.pyhw,sha256=HBGROtBb7wrNtRqAQ9ND7zxK0l17BRsmpgc2dMo_m6s,474
|
64
|
-
pyhw/frontend/logo/ascii/raspbian.pyhw,sha256=
|
64
|
+
pyhw/frontend/logo/ascii/raspbian.pyhw,sha256=jEl6WMKF-FGx359ipQ1kzweUJS-NuauYQCFaYime4PQ,159
|
65
65
|
pyhw/frontend/logo/ascii/ubuntu.pyhw,sha256=l-Q0PfutxXYMwTojqeiM88063x4V0RBkZUHmi6YdsNc,833
|
66
66
|
pyhw/frontend/logo/ascii/ubuntu_small.pyhw,sha256=Xf8LSZdZUu9aEG3efhb1FUlUEuJ-3UztcIOJISpKhPw,229
|
67
67
|
pyhw/pyhwException/__init__.py,sha256=8JsFvtF13g0Y5t4z9fRndDXtfCzuBM59jDf6PhWSFSk,220
|
@@ -69,9 +69,9 @@ pyhw/pyhwException/pyhwException.py,sha256=wxuzFQa9g7XB1q9TUKO_55lw7wMEJMpzG8w1G
|
|
69
69
|
pyhw/pyhwUtil/__init__.py,sha256=PzeP9fXsIhvr3sUpJ4DxW9_H25DEIasBFfXd_NztfR4,226
|
70
70
|
pyhw/pyhwUtil/pyhwUtil.py,sha256=qJREsuPU_lq7T0Ictc-_BkGEp0Zh24Ptq8aklkEe6GY,2292
|
71
71
|
pyhw/pyhwUtil/sysctlUtil.py,sha256=S-rUvqi7ZrMyMouIhxlyHEQ4agM7sCT1Y7uzs3Hu5-o,841
|
72
|
-
pyhw-0.
|
73
|
-
pyhw-0.
|
74
|
-
pyhw-0.
|
75
|
-
pyhw-0.
|
76
|
-
pyhw-0.
|
77
|
-
pyhw-0.
|
72
|
+
pyhw-0.3.1.dist-info/LICENSE,sha256=hJs6RBqSVCexbTsalkMLNFI5t06kekQEsSVaOt_-yLs,1497
|
73
|
+
pyhw-0.3.1.dist-info/METADATA,sha256=aZwdNsKzvDGlqqVCG4lK8udYm8lUDhiLd5aNgdNH8wQ,3912
|
74
|
+
pyhw-0.3.1.dist-info/WHEEL,sha256=Mdi9PDNwEZptOjTlUcAth7XJDFtKrHYaQMPulZeBCiQ,91
|
75
|
+
pyhw-0.3.1.dist-info/entry_points.txt,sha256=q-AB8im_QahpmNrmy4aPTJRGi0LlbNlnI3kF7s6pKss,44
|
76
|
+
pyhw-0.3.1.dist-info/top_level.txt,sha256=7Inxvxt1TngEricKZEex9_WJZS3DbKYFUXDz4v5WHYU,5
|
77
|
+
pyhw-0.3.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|