pyhw 0.2.0b0__py3-none-any.whl → 0.2.1b0__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/backend/cpu/linux.py CHANGED
@@ -10,6 +10,8 @@ class CPUDetectLinux:
10
10
  def getCPUInfo(self):
11
11
  self.__getCPUInfo()
12
12
  self.__modelClean()
13
+ if self.__cpuInfo.model == "":
14
+ self.__cpuInfo.model = "Unknown"
13
15
  if self.__cpuInfo.model != "":
14
16
  self.__cpuInfo.cpu = self.__cpuInfo.model
15
17
  if self.__cpuInfo.cores != "":
@@ -3,6 +3,7 @@
3
3
  """
4
4
  from ...pyhwUtil import getArch
5
5
  from .hostInfo import HostInfo
6
+ import os
6
7
 
7
8
 
8
9
  class HostDetectLinux:
@@ -25,11 +26,23 @@ class HostDetectLinux:
25
26
  except FileNotFoundError:
26
27
  pass
27
28
  elif self.__arch in ["aarch64", "arm32"]:
28
- try:
29
- with open("/sys/firmware/devicetree/base/model", "r") as f:
30
- self.__hostInfo.model = f.read().strip()
31
- except FileNotFoundError:
32
- pass
29
+ # try to find dmi folder since some arm based desktops and servers may have same structure as x86_64 machines.
30
+ if os.path.exists("/sys/devices/virtual/dmi/id"):
31
+ try:
32
+ with open("/sys/devices/virtual/dmi/id/product_name", "r") as f:
33
+ self.__hostInfo.name = f.read().strip()
34
+ with open("/sys/devices/virtual/dmi/id/product_version", "r") as f:
35
+ self.__hostInfo.version = f.read().strip()
36
+ self.__hostInfo.model = self.__hostInfo.name + " " + self.__hostInfo.version
37
+ except FileNotFoundError:
38
+ pass
39
+ else:
40
+ # some single board computers may not have dmi folder, try to find model name in device tree.
41
+ try:
42
+ with open("/sys/firmware/devicetree/base/model", "r") as f:
43
+ self.__hostInfo.model = f.read().strip()
44
+ except FileNotFoundError:
45
+ pass
33
46
 
34
47
  def __getHostFamily(self):
35
48
  pass
pyhw/pyhwUtil/pyhwUtil.py CHANGED
@@ -61,6 +61,10 @@ def selectOSLogo(os_id: str):
61
61
  """
62
62
  if getOS() == "macos":
63
63
  return os_id
64
+ if os_id in ["debian", "ubuntu", "macOS", "fedora"]:
65
+ pass
66
+ else:
67
+ return "linux"
64
68
  rows_str, columns_str = os.popen('stty size', 'r').read().split()
65
69
  rows = int(rows_str)
66
70
  columns = int(columns_str)
@@ -1,10 +1,12 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyhw
3
- Version: 0.2.0b0
3
+ Version: 0.2.1b0
4
4
  Summary: PyHw, a neofetch-like command line tool for fetching system information but written mostly in python.
5
5
  Author-email: Xiao Ran <xiaoran.007@icloud.com>
6
6
  License: BSD-3-Clause
7
7
  Project-URL: homepage, https://github.com/xiaoran007/pyhw
8
+ Keywords: neofetch,system information,command line tool,python,hardware information,fastfetch,fetching
9
+ Classifier: Development Status :: 4 - Beta
8
10
  Classifier: Programming Language :: Python :: 3
9
11
  Classifier: License :: OSI Approved :: BSD License
10
12
  Classifier: Operating System :: OS Independent
@@ -16,21 +18,33 @@ License-File: LICENSE
16
18
  ![PyPI - Downloads](https://img.shields.io/pypi/dw/pyhw?label=PyPI)
17
19
  ![PyPI - Version](https://img.shields.io/pypi/v/pyhw?label=version)
18
20
 
21
+ ![Static Badge](https://img.shields.io/badge/macOS-brightgreen)
22
+ ![Static Badge](https://img.shields.io/badge/Linux-blue)
19
23
 
20
24
 
21
25
  PyHw, a neofetch-like command line tool for fetching system information but written mostly in Python. **Currently, this project is still in the initial stage, only part of the linux systems and macOS are supported.**
22
26
 
23
- This project is a Python reimplementation of [neofetch](https://github.com/dylanaraps/neofetch) and references the [fastfetch](https://github.com/fastfetch-cli/fastfetch) project for logo style settings. Since this project is implemented in Python, it will be easier to maintain and extend than bash and c implementation. Also, this project only relies on the Python standard library, so you can run it on any device that has a Python environment (I hope so 🤔)
27
+ This project is a Python reimplementation of [neofetch](https://github.com/dylanaraps/neofetch) and references the [fastfetch](https://github.com/fastfetch-cli/fastfetch) project for logo style settings. Since this project is implemented in Python, it will be easier to maintain and extend than bash and c implementation. Also, this project only relies on the Python standard library, so you can run it on any device that has a Python environment (I hope so 🤔).
24
28
 
25
29
  There are already a lot of similar tools so you can choose any of them; they're all essentially no different. If you want to try this tool, just install it directly by pip.
26
30
  ```shell
27
31
  pip install pyhw
28
32
  ```
33
+ To upgrade pyhw:
34
+ ```shell
35
+ pip install pyhw --upgrade
36
+ ```
29
37
  You can then use this tool directly from the command line with the following command, just like neofetch.
30
38
  ```shell
31
39
  pyhw
32
40
  ```
33
41
 
42
+ ## Supported (Tested) OS
43
+ * macOS arm64, x86_64
44
+ * debian-based distro x86_64
45
+ * RaspberryPi OS arm64
46
+
47
+
34
48
  ## Build from source
35
49
  ### Build tools
36
50
  Make sure the following Python build tools are already installed.
@@ -6,7 +6,7 @@ pyhw/backend/backendBase.py,sha256=t9FKQPdK7yFZF0vrsXpjIUJNKrB-cXYeL5MDohlgguA,4
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=J_oKa4BB_E5pBrMMuIORhNauXzPsyB2vsoJcUei9Ljg,2271
9
+ pyhw/backend/cpu/linux.py,sha256=sbhgzhunzQEI3gXzfmk7-al3P7tKYoTn_yOlAS2vJCM,2355
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
@@ -16,7 +16,7 @@ pyhw/backend/gpu/macos.py,sha256=sgrROfJC59KWjxfW2n90thVEjgDNYYLWo_pETDFPKQA,230
16
16
  pyhw/backend/host/__init__.py,sha256=Efaj7-Oya7H8HdpZHQCLrwn-mcfPb-d6yfh4dzsE_7I,58
17
17
  pyhw/backend/host/hostBase.py,sha256=POyDW3f5JSWtEKyCfrVSBEddSwoywe_OBgUExCEuje8,563
18
18
  pyhw/backend/host/hostInfo.py,sha256=Xvz0LugPiCSWMkcDsp4p2rrojYFZauL6Q-gCZ6NLz5k,184
19
- pyhw/backend/host/linux.py,sha256=Ozl3tkDx-5OQ6mcocn4ap2KN7F8eE1JKB9g3qypHkxQ,1173
19
+ pyhw/backend/host/linux.py,sha256=dr82gDA4SQgyTTI3Kq5V3V6qEDH4DXoJo0wyqeXYdHk,2005
20
20
  pyhw/backend/host/macos.py,sha256=u-Orwcq0FCcr2eR9mOKUc85LGkyuiO6rZ-ggIwob92k,14593
21
21
  pyhw/backend/host/windows.py,sha256=rjDJaIs-5zspzFsNCMCh6m2yZXEXI0vccqeBpmAdEBk,53
22
22
  pyhw/backend/kernel/__init__.py,sha256=fGjwjpOhwA_PnsWbwoq102hwhTay2ufYKaTqxjSV2-I,65
@@ -65,11 +65,11 @@ pyhw/frontend/logo/ascii/ubuntu_small.pyhw,sha256=Xf8LSZdZUu9aEG3efhb1FUlUEuJ-3U
65
65
  pyhw/pyhwException/__init__.py,sha256=8JsFvtF13g0Y5t4z9fRndDXtfCzuBM59jDf6PhWSFSk,220
66
66
  pyhw/pyhwException/pyhwException.py,sha256=wxuzFQa9g7XB1q9TUKO_55lw7wMEJMpzG8w1GVTFVa0,197
67
67
  pyhw/pyhwUtil/__init__.py,sha256=PzeP9fXsIhvr3sUpJ4DxW9_H25DEIasBFfXd_NztfR4,226
68
- pyhw/pyhwUtil/pyhwUtil.py,sha256=Y_i_LUAAtQ8pLTna0mThzEh6ekrDfQ5JZ44Rtp2jSx4,1944
68
+ pyhw/pyhwUtil/pyhwUtil.py,sha256=Erobyk0R7jiXeSNWQ0Flj0-tNHJ5NZLONmGMF7jnUSM,2047
69
69
  pyhw/pyhwUtil/sysctlUtil.py,sha256=S-rUvqi7ZrMyMouIhxlyHEQ4agM7sCT1Y7uzs3Hu5-o,841
70
- pyhw-0.2.0b0.dist-info/LICENSE,sha256=hJs6RBqSVCexbTsalkMLNFI5t06kekQEsSVaOt_-yLs,1497
71
- pyhw-0.2.0b0.dist-info/METADATA,sha256=gmaNKWAc2PSWue_I__lz1BsVa7nMLSkz3O2ADqt62Tg,2084
72
- pyhw-0.2.0b0.dist-info/WHEEL,sha256=HiCZjzuy6Dw0hdX5R3LCFPDmFS4BWl8H-8W39XfmgX4,91
73
- pyhw-0.2.0b0.dist-info/entry_points.txt,sha256=q-AB8im_QahpmNrmy4aPTJRGi0LlbNlnI3kF7s6pKss,44
74
- pyhw-0.2.0b0.dist-info/top_level.txt,sha256=7Inxvxt1TngEricKZEex9_WJZS3DbKYFUXDz4v5WHYU,5
75
- pyhw-0.2.0b0.dist-info/RECORD,,
70
+ pyhw-0.2.1b0.dist-info/LICENSE,sha256=hJs6RBqSVCexbTsalkMLNFI5t06kekQEsSVaOt_-yLs,1497
71
+ pyhw-0.2.1b0.dist-info/METADATA,sha256=1SBzPjhfcujNjeN2zwD5KhwwckmmtU7TzPVLqv-Ajl4,2510
72
+ pyhw-0.2.1b0.dist-info/WHEEL,sha256=nCVcAvsfA9TDtwGwhYaRrlPhTLV9m-Ga6mdyDtuwK18,91
73
+ pyhw-0.2.1b0.dist-info/entry_points.txt,sha256=q-AB8im_QahpmNrmy4aPTJRGi0LlbNlnI3kF7s6pKss,44
74
+ pyhw-0.2.1b0.dist-info/top_level.txt,sha256=7Inxvxt1TngEricKZEex9_WJZS3DbKYFUXDz4v5WHYU,5
75
+ pyhw-0.2.1b0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (72.2.0)
2
+ Generator: setuptools (73.0.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5