pyhw 0.2.0b0__tar.gz → 0.2.1b0__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. {pyhw-0.2.0b0/src/pyhw.egg-info → pyhw-0.2.1b0}/PKG-INFO +16 -2
  2. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/README.md +13 -1
  3. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/pyproject.toml +3 -1
  4. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/backend/cpu/linux.py +2 -0
  5. pyhw-0.2.1b0/src/pyhw/backend/host/linux.py +51 -0
  6. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/pyhwUtil/pyhwUtil.py +4 -0
  7. {pyhw-0.2.0b0 → pyhw-0.2.1b0/src/pyhw.egg-info}/PKG-INFO +16 -2
  8. pyhw-0.2.0b0/src/pyhw/backend/host/linux.py +0 -38
  9. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/LICENSE +0 -0
  10. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/MANIFEST.in +0 -0
  11. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/setup.cfg +0 -0
  12. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/__init__.py +0 -0
  13. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/__main__.py +0 -0
  14. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/backend/__init__.py +0 -0
  15. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/backend/backendBase.py +0 -0
  16. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/backend/cpu/__init__.py +0 -0
  17. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/backend/cpu/cpuBase.py +0 -0
  18. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/backend/cpu/cpuInfo.py +0 -0
  19. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/backend/cpu/macos.py +0 -0
  20. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/backend/gpu/__init__.py +0 -0
  21. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/backend/gpu/gpuBase.py +0 -0
  22. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/backend/gpu/gpuInfo.py +0 -0
  23. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/backend/gpu/linux.py +0 -0
  24. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/backend/gpu/macos.py +0 -0
  25. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/backend/host/__init__.py +0 -0
  26. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/backend/host/hostBase.py +0 -0
  27. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/backend/host/hostInfo.py +0 -0
  28. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/backend/host/macos.py +0 -0
  29. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/backend/host/windows.py +0 -0
  30. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/backend/kernel/__init__.py +0 -0
  31. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/backend/kernel/kernelBase.py +0 -0
  32. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/backend/kernel/kernelInfo.py +0 -0
  33. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/backend/kernel/unix.py +0 -0
  34. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/backend/kernel/windows.py +0 -0
  35. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/backend/memory/__init__.py +0 -0
  36. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/backend/memory/linux.py +0 -0
  37. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/backend/memory/macos.py +0 -0
  38. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/backend/memory/memoryBase.py +0 -0
  39. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/backend/memory/memoryInfo.py +0 -0
  40. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/backend/metal/t.py +0 -0
  41. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/backend/os/__init__.py +0 -0
  42. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/backend/os/linux.py +0 -0
  43. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/backend/os/macos.py +0 -0
  44. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/backend/os/osBase.py +0 -0
  45. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/backend/os/osInfo.py +0 -0
  46. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/backend/shell/__init__.py +0 -0
  47. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/backend/shell/shellBase.py +0 -0
  48. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/backend/shell/unix.py +0 -0
  49. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/backend/title/__init__.py +0 -0
  50. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/backend/title/titleBase.py +0 -0
  51. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/backend/title/unix.py +0 -0
  52. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/backend/title/windows.py +0 -0
  53. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/backend/uptime/__init__.py +0 -0
  54. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/backend/uptime/linux.py +0 -0
  55. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/backend/uptime/macos.py +0 -0
  56. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/backend/uptime/uptimeBase.py +0 -0
  57. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/backend/uptime/uptimeInfo.py +0 -0
  58. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/frontend/__init__.py +0 -0
  59. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/frontend/color/__init__.py +0 -0
  60. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/frontend/color/colorConfig.py +0 -0
  61. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/frontend/color/colorSet.py +0 -0
  62. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/frontend/color/colorUtil.py +0 -0
  63. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/frontend/frontendBase.py +0 -0
  64. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/frontend/logo/__init__.py +0 -0
  65. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/frontend/logo/ascii/debian.pyhw +0 -0
  66. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/frontend/logo/ascii/fedora.pyhw +0 -0
  67. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/frontend/logo/ascii/fedora_small.pyhw +0 -0
  68. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/frontend/logo/ascii/linux.pyhw +0 -0
  69. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/frontend/logo/ascii/macOS.pyhw +0 -0
  70. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/frontend/logo/ascii/ubuntu.pyhw +0 -0
  71. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/frontend/logo/ascii/ubuntu_small.pyhw +0 -0
  72. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/frontend/logo/logoBase.py +0 -0
  73. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/macos.py +0 -0
  74. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/pyhwException/__init__.py +0 -0
  75. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/pyhwException/pyhwException.py +0 -0
  76. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/pyhwUtil/__init__.py +0 -0
  77. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw/pyhwUtil/sysctlUtil.py +0 -0
  78. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw.egg-info/SOURCES.txt +0 -0
  79. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw.egg-info/dependency_links.txt +0 -0
  80. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw.egg-info/entry_points.txt +0 -0
  81. {pyhw-0.2.0b0 → pyhw-0.2.1b0}/src/pyhw.egg-info/top_level.txt +0 -0
@@ -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.
@@ -2,21 +2,33 @@
2
2
  ![PyPI - Downloads](https://img.shields.io/pypi/dw/pyhw?label=PyPI)
3
3
  ![PyPI - Version](https://img.shields.io/pypi/v/pyhw?label=version)
4
4
 
5
+ ![Static Badge](https://img.shields.io/badge/macOS-brightgreen)
6
+ ![Static Badge](https://img.shields.io/badge/Linux-blue)
5
7
 
6
8
 
7
9
  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.**
8
10
 
9
- 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 🤔)
11
+ 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 🤔).
10
12
 
11
13
  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.
12
14
  ```shell
13
15
  pip install pyhw
14
16
  ```
17
+ To upgrade pyhw:
18
+ ```shell
19
+ pip install pyhw --upgrade
20
+ ```
15
21
  You can then use this tool directly from the command line with the following command, just like neofetch.
16
22
  ```shell
17
23
  pyhw
18
24
  ```
19
25
 
26
+ ## Supported (Tested) OS
27
+ * macOS arm64, x86_64
28
+ * debian-based distro x86_64
29
+ * RaspberryPi OS arm64
30
+
31
+
20
32
  ## Build from source
21
33
  ### Build tools
22
34
  Make sure the following Python build tools are already installed.
@@ -4,8 +4,9 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "pyhw"
7
- version = "0.2.0b"
7
+ version = "0.2.1b"
8
8
  description = "PyHw, a neofetch-like command line tool for fetching system information but written mostly in python."
9
+ keywords = ["neofetch", "system information", "command line tool", "python", "hardware information", "fastfetch", "fetching"]
9
10
  authors = [
10
11
  { name = "Xiao Ran", email = "xiaoran.007@icloud.com" }
11
12
  ]
@@ -13,6 +14,7 @@ readme = "README.md"
13
14
  license = {text = "BSD-3-Clause"}
14
15
  requires-python = ">=3.9"
15
16
  classifiers = [
17
+ "Development Status :: 4 - Beta",
16
18
  "Programming Language :: Python :: 3",
17
19
  "License :: OSI Approved :: BSD License",
18
20
  "Operating System :: OS Independent"
@@ -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 != "":
@@ -0,0 +1,51 @@
1
+ """
2
+ In dev.
3
+ """
4
+ from ...pyhwUtil import getArch
5
+ from .hostInfo import HostInfo
6
+ import os
7
+
8
+
9
+ class HostDetectLinux:
10
+ def __init__(self):
11
+ self.__hostInfo = HostInfo()
12
+ self.__arch = getArch()
13
+
14
+ def getHostInfo(self):
15
+ self.__getModel()
16
+ return self.__hostInfo
17
+
18
+ def __getModel(self):
19
+ if self.__arch in ["x86_64", "x86"]:
20
+ try:
21
+ with open("/sys/devices/virtual/dmi/id/product_name", "r") as f:
22
+ self.__hostInfo.name = f.read().strip()
23
+ with open("/sys/devices/virtual/dmi/id/product_version", "r") as f:
24
+ self.__hostInfo.version = f.read().strip()
25
+ self.__hostInfo.model = self.__hostInfo.name + " " + self.__hostInfo.version
26
+ except FileNotFoundError:
27
+ pass
28
+ elif self.__arch in ["aarch64", "arm32"]:
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
46
+
47
+ def __getHostFamily(self):
48
+ pass
49
+
50
+ def __getHostProductName(self):
51
+ pass
@@ -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.
@@ -1,38 +0,0 @@
1
- """
2
- In dev.
3
- """
4
- from ...pyhwUtil import getArch
5
- from .hostInfo import HostInfo
6
-
7
-
8
- class HostDetectLinux:
9
- def __init__(self):
10
- self.__hostInfo = HostInfo()
11
- self.__arch = getArch()
12
-
13
- def getHostInfo(self):
14
- self.__getModel()
15
- return self.__hostInfo
16
-
17
- def __getModel(self):
18
- if self.__arch in ["x86_64", "x86"]:
19
- try:
20
- with open("/sys/devices/virtual/dmi/id/product_name", "r") as f:
21
- self.__hostInfo.name = f.read().strip()
22
- with open("/sys/devices/virtual/dmi/id/product_version", "r") as f:
23
- self.__hostInfo.version = f.read().strip()
24
- self.__hostInfo.model = self.__hostInfo.name + " " + self.__hostInfo.version
25
- except FileNotFoundError:
26
- pass
27
- 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
33
-
34
- def __getHostFamily(self):
35
- pass
36
-
37
- def __getHostProductName(self):
38
- pass
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes