pyhw 0.11.8__py3-none-any.whl → 0.11.10__py3-none-any.whl
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.
- pyhw/__init__.py +2 -1
- pyhw/backend/host/linux.py +1 -1
- pyhw/backend/shell/shellInfo.py +3 -0
- pyhw/backend/shell/windows.py +22 -2
- {pyhw-0.11.8.dist-info → pyhw-0.11.10.dist-info}/METADATA +2 -2
- {pyhw-0.11.8.dist-info → pyhw-0.11.10.dist-info}/RECORD +10 -10
- {pyhw-0.11.8.dist-info → pyhw-0.11.10.dist-info}/WHEEL +1 -1
- {pyhw-0.11.8.dist-info → pyhw-0.11.10.dist-info}/LICENSE +0 -0
- {pyhw-0.11.8.dist-info → pyhw-0.11.10.dist-info}/entry_points.txt +0 -0
- {pyhw-0.11.8.dist-info → pyhw-0.11.10.dist-info}/top_level.txt +0 -0
pyhw/__init__.py
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
__version__ = '0.11.
|
1
|
+
__version__ = '0.11.10'
|
2
|
+
__author__ = 'xiaoran007'
|
pyhw/backend/host/linux.py
CHANGED
@@ -32,7 +32,7 @@ class HostDetectLinux:
|
|
32
32
|
self._hostInfo.name = product_name
|
33
33
|
with open("/sys/devices/virtual/dmi/id/product_version", "r") as f:
|
34
34
|
version = f.read().strip()
|
35
|
-
if version.startswith("To be filled by O.E.M."):
|
35
|
+
if version.startswith("To be filled by O.E.M.") or product_name.startswith("Default string"):
|
36
36
|
self._hostInfo.version = ""
|
37
37
|
else:
|
38
38
|
self._hostInfo.version = version
|
pyhw/backend/shell/shellInfo.py
CHANGED
pyhw/backend/shell/windows.py
CHANGED
@@ -5,6 +5,7 @@ from ...pyhwException import BackendException
|
|
5
5
|
from .shellInfo import ShellInfo
|
6
6
|
import json
|
7
7
|
import subprocess
|
8
|
+
import os
|
8
9
|
|
9
10
|
|
10
11
|
class ShellDetectWindows:
|
@@ -12,6 +13,27 @@ class ShellDetectWindows:
|
|
12
13
|
self.__shellInfo = ShellInfo()
|
13
14
|
|
14
15
|
def getShellInfo(self):
|
16
|
+
if not self.__getShellBash():
|
17
|
+
self.__getShellPowerShell()
|
18
|
+
self.__shellInfo.info = self.__shellInfo.shell + " " + self.__shellInfo.version
|
19
|
+
return self.__shellInfo
|
20
|
+
|
21
|
+
def __getShellBash(self) -> bool:
|
22
|
+
try:
|
23
|
+
shell_env = os.getenv("SHELL", "")
|
24
|
+
if "bash" in shell_env:
|
25
|
+
self.__shellInfo.shell = "bash"
|
26
|
+
self.__shellInfo.path = shell_env
|
27
|
+
result = subprocess.run(["bash", "-c", "echo $BASH_VERSION"], capture_output=True, text=True)
|
28
|
+
self.__shellInfo.version = result.stdout.strip().split("(")[0]
|
29
|
+
self.__shellInfo.info = self.__shellInfo.shell + " " + self.__shellInfo.version
|
30
|
+
return True
|
31
|
+
else:
|
32
|
+
return False
|
33
|
+
except:
|
34
|
+
return False
|
35
|
+
|
36
|
+
def __getShellPowerShell(self):
|
15
37
|
COMMAND = "$PSVersionTable.PSVersion | ConvertTo-JSON"
|
16
38
|
|
17
39
|
try:
|
@@ -25,5 +47,3 @@ class ShellDetectWindows:
|
|
25
47
|
|
26
48
|
self.__shellInfo.shell = "PowerShell"
|
27
49
|
self.__shellInfo.version = f"{major}.{minor}"
|
28
|
-
self.__shellInfo.info = f"PowerShell {major}.{minor}"
|
29
|
-
return self.__shellInfo
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: pyhw
|
3
|
-
Version: 0.11.
|
3
|
+
Version: 0.11.10
|
4
4
|
Summary: PyHw, a neofetch-like command line tool for fetching system information but written mostly in python.
|
5
5
|
Author: Xiao Ran
|
6
6
|
Maintainer-email: Xiao Ran <xiaoran.007@icloud.com>
|
@@ -14,7 +14,7 @@ Classifier: Operating System :: OS Independent
|
|
14
14
|
Requires-Python: >=3.9
|
15
15
|
Description-Content-Type: text/markdown
|
16
16
|
License-File: LICENSE
|
17
|
-
Requires-Dist: pypci-ng>=0.2.
|
17
|
+
Requires-Dist: pypci-ng>=0.2.1
|
18
18
|
|
19
19
|
# PyHw
|
20
20
|
[](https://pepy.tech/project/pyhw)
|
@@ -1,4 +1,4 @@
|
|
1
|
-
pyhw/__init__.py,sha256=
|
1
|
+
pyhw/__init__.py,sha256=51EhxNmqRbY7RGnf2x4Cq6QrC2M2HrqJJRwsZUMmn8I,50
|
2
2
|
pyhw/__main__.py,sha256=oZpFtvSyYTM8cMsulvi51zJV0gtmw3OCQVdgoaHbtxc,4977
|
3
3
|
pyhw/backend/__init__.py,sha256=knn_3Yroow1h0dqdrozk3zyy3vz-kQyNBRjR6OLmVoY,50
|
4
4
|
pyhw/backend/backendBase.py,sha256=mloo8mPEbgbIdmyQ3I4vdEXMSSjxWi_wnwACmzvHbEo,506
|
@@ -20,7 +20,7 @@ pyhw/backend/host/__init__.py,sha256=Efaj7-Oya7H8HdpZHQCLrwn-mcfPb-d6yfh4dzsE_7I
|
|
20
20
|
pyhw/backend/host/bsd.py,sha256=9gKnM6yysHBKwS3EQvb0pCeylh3dzHvoEuPe14zo9wQ,382
|
21
21
|
pyhw/backend/host/hostBase.py,sha256=gM49SY6rEaxec_0bUOMk7QlEfR7vjfWp3BXEUqgdncc,762
|
22
22
|
pyhw/backend/host/hostInfo.py,sha256=grz15M2t3f_enqQvc7Qn6HlEfYwa66bu2NYvm8VpJ-g,452
|
23
|
-
pyhw/backend/host/linux.py,sha256=
|
23
|
+
pyhw/backend/host/linux.py,sha256=aU-tWTI2Wjg1HCx2lGFenoaiM94axutXmL7Auu8ilhM,2925
|
24
24
|
pyhw/backend/host/macos.py,sha256=KW-EJK9g1xHNrFsVxJv5GPLpc_ZevX0Zv1WjZUzRkzo,15369
|
25
25
|
pyhw/backend/host/windows.py,sha256=qn2QiTK2wIijyyw_QKdiSizY3teyS-9RNBu5RxEPRSw,1185
|
26
26
|
pyhw/backend/kernel/__init__.py,sha256=fGjwjpOhwA_PnsWbwoq102hwhTay2ufYKaTqxjSV2-I,65
|
@@ -59,9 +59,9 @@ pyhw/backend/os/osInfo.py,sha256=NEr76aicI9N3SFrwi1skcpUEjzsyCryTjdE9X1nBjBM,536
|
|
59
59
|
pyhw/backend/os/windows.py,sha256=xjU8NaQwcLusuRw6J7RwwwJiGSv5H_LRBvg2LYEyvNg,1514
|
60
60
|
pyhw/backend/shell/__init__.py,sha256=SeQ7OLNSl_V1JCCWnJGjLilAWiSe9e5kgsMEt63TMS0,62
|
61
61
|
pyhw/backend/shell/shellBase.py,sha256=829rchiqXfyA-oKT81mkGGoKBjZflM5NHIRs0_ZSwaY,531
|
62
|
-
pyhw/backend/shell/shellInfo.py,sha256=
|
62
|
+
pyhw/backend/shell/shellInfo.py,sha256=8Z2geV-2agtpKQl1OJ58cdiEiyVsCbC59AL3MgYnY_E,261
|
63
63
|
pyhw/backend/shell/unix.py,sha256=qTP3Mk8prI2lnQmUJ41G1Fgu1l8nGn9PB3pyBoewtJg,2010
|
64
|
-
pyhw/backend/shell/windows.py,sha256=
|
64
|
+
pyhw/backend/shell/windows.py,sha256=FT8m7pijSw0vtAEtES25ulFCmEyziNor4B7o9q1E-Q8,1639
|
65
65
|
pyhw/backend/title/__init__.py,sha256=l6_WqreSBeK7krapCrbrr4ndnydrXB1aZ50Ve-beV_w,62
|
66
66
|
pyhw/backend/title/titleBase.py,sha256=RVWwtTea8G1MutrN3Ttkjky9wwVtRxnHIsOJKpBbvF8,519
|
67
67
|
pyhw/backend/title/titleInfo.py,sha256=lUsbQNx80MLHuSCgMzWhc72mj0ykcRuWngn9wydYSos,166
|
@@ -111,9 +111,9 @@ pyhw/pyhwUtil/__init__.py,sha256=34ygvVBBqfJ_9OMzHToCcV_BVahixNsa_Z5yh6VsaPQ,304
|
|
111
111
|
pyhw/pyhwUtil/cliUtil.py,sha256=42Gdi9wTg5XOYuEvGHEgOaZJ6dJk1qSuHIprR8pCA-g,2344
|
112
112
|
pyhw/pyhwUtil/pyhwUtil.py,sha256=RokrE7X99pkS0LtN4wyJS_ZQmjtMwiNxA7MwXMoO96c,7664
|
113
113
|
pyhw/pyhwUtil/sysctlUtil.py,sha256=S-rUvqi7ZrMyMouIhxlyHEQ4agM7sCT1Y7uzs3Hu5-o,841
|
114
|
-
pyhw-0.11.
|
115
|
-
pyhw-0.11.
|
116
|
-
pyhw-0.11.
|
117
|
-
pyhw-0.11.
|
118
|
-
pyhw-0.11.
|
119
|
-
pyhw-0.11.
|
114
|
+
pyhw-0.11.10.dist-info/LICENSE,sha256=hJs6RBqSVCexbTsalkMLNFI5t06kekQEsSVaOt_-yLs,1497
|
115
|
+
pyhw-0.11.10.dist-info/METADATA,sha256=nYeHe8DmO9ZjgNcUzearCGdJCDz_3xOEFoofWWzjXq8,6754
|
116
|
+
pyhw-0.11.10.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
|
117
|
+
pyhw-0.11.10.dist-info/entry_points.txt,sha256=q-AB8im_QahpmNrmy4aPTJRGi0LlbNlnI3kF7s6pKss,44
|
118
|
+
pyhw-0.11.10.dist-info/top_level.txt,sha256=7Inxvxt1TngEricKZEex9_WJZS3DbKYFUXDz4v5WHYU,5
|
119
|
+
pyhw-0.11.10.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|