pyhw 0.1.0b0__tar.gz → 0.1.2b0__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. {pyhw-0.1.0b0/src/pyhw.egg-info → pyhw-0.1.2b0}/PKG-INFO +11 -6
  2. pyhw-0.1.2b0/README.md +31 -0
  3. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/pyproject.toml +1 -1
  4. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/src/pyhw/__main__.py +2 -2
  5. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/src/pyhw/frontend/color/colorConfig.py +19 -0
  6. pyhw-0.1.2b0/src/pyhw/frontend/logo/ascii/fedora_small.pyhw +17 -0
  7. pyhw-0.1.2b0/src/pyhw/frontend/logo/ascii/ubuntu_small.pyhw +11 -0
  8. pyhw-0.1.2b0/src/pyhw/pyhwUtil/__init__.py +3 -0
  9. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/src/pyhw/pyhwUtil/pyhwUtil.py +20 -0
  10. {pyhw-0.1.0b0 → pyhw-0.1.2b0/src/pyhw.egg-info}/PKG-INFO +11 -6
  11. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/src/pyhw.egg-info/SOURCES.txt +2 -0
  12. pyhw-0.1.0b0/README.md +0 -26
  13. pyhw-0.1.0b0/src/pyhw/pyhwUtil/__init__.py +0 -3
  14. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/LICENSE +0 -0
  15. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/MANIFEST.in +0 -0
  16. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/setup.cfg +0 -0
  17. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/setup.py +0 -0
  18. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/src/pyhw/__init__.py +0 -0
  19. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/src/pyhw/backend/__init__.py +0 -0
  20. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/src/pyhw/backend/backendBase.py +0 -0
  21. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/src/pyhw/backend/cpu/__init__.py +0 -0
  22. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/src/pyhw/backend/cpu/cpuBase.py +0 -0
  23. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/src/pyhw/backend/cpu/linux.py +0 -0
  24. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/src/pyhw/backend/gpu/__init__.py +0 -0
  25. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/src/pyhw/backend/gpu/gpuBase.py +0 -0
  26. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/src/pyhw/backend/gpu/linux.py +0 -0
  27. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/src/pyhw/backend/host/__init__.py +0 -0
  28. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/src/pyhw/backend/host/hostBase.py +0 -0
  29. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/src/pyhw/backend/host/linux.py +0 -0
  30. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/src/pyhw/backend/host/macos.py +0 -0
  31. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/src/pyhw/backend/host/windows.py +0 -0
  32. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/src/pyhw/backend/kernel/__init__.py +0 -0
  33. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/src/pyhw/backend/kernel/kernelBase.py +0 -0
  34. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/src/pyhw/backend/kernel/linux.py +0 -0
  35. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/src/pyhw/backend/kernel/macos.py +0 -0
  36. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/src/pyhw/backend/kernel/windows.py +0 -0
  37. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/src/pyhw/backend/memory/__init__.py +0 -0
  38. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/src/pyhw/backend/memory/linux.py +0 -0
  39. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/src/pyhw/backend/memory/memoryBase.py +0 -0
  40. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/src/pyhw/backend/metal/t.py +0 -0
  41. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/src/pyhw/backend/os/__init__.py +0 -0
  42. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/src/pyhw/backend/os/linux.py +0 -0
  43. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/src/pyhw/backend/os/osBase.py +0 -0
  44. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/src/pyhw/backend/shell/__init__.py +0 -0
  45. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/src/pyhw/backend/shell/shellBase.py +0 -0
  46. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/src/pyhw/backend/shell/unix.py +0 -0
  47. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/src/pyhw/backend/title/__init__.py +0 -0
  48. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/src/pyhw/backend/title/titleBase.py +0 -0
  49. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/src/pyhw/backend/title/unix.py +0 -0
  50. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/src/pyhw/backend/title/windows.py +0 -0
  51. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/src/pyhw/backend/uptime/__init__.py +0 -0
  52. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/src/pyhw/backend/uptime/linux.py +0 -0
  53. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/src/pyhw/backend/uptime/uptimeBase.py +0 -0
  54. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/src/pyhw/frontend/__init__.py +0 -0
  55. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/src/pyhw/frontend/color/__init__.py +0 -0
  56. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/src/pyhw/frontend/color/colorSet.py +0 -0
  57. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/src/pyhw/frontend/color/colorUtil.py +0 -0
  58. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/src/pyhw/frontend/frontendBase.py +0 -0
  59. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/src/pyhw/frontend/logo/__init__.py +0 -0
  60. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/src/pyhw/frontend/logo/ascii/debian.pyhw +0 -0
  61. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/src/pyhw/frontend/logo/ascii/fedora.pyhw +0 -0
  62. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/src/pyhw/frontend/logo/ascii/linux.pyhw +0 -0
  63. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/src/pyhw/frontend/logo/ascii/macOS.pyhw +0 -0
  64. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/src/pyhw/frontend/logo/ascii/ubuntu.pyhw +0 -0
  65. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/src/pyhw/frontend/logo/logoBase.py +0 -0
  66. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/src/pyhw/macos.py +0 -0
  67. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/src/pyhw/pyhwException/__init__.py +0 -0
  68. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/src/pyhw/pyhwException/pyhwException.py +0 -0
  69. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/src/pyhw.egg-info/dependency_links.txt +0 -0
  70. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/src/pyhw.egg-info/entry_points.txt +0 -0
  71. {pyhw-0.1.0b0 → pyhw-0.1.2b0}/src/pyhw.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyhw
3
- Version: 0.1.0b0
3
+ Version: 0.1.2b0
4
4
  Summary: PyHw, a neofetch-like command line tool for fetching system information but written mostly in python.
5
5
  Home-page: https://github.com/xiaoran007/pyhw
6
6
  Author: Xiao Ran
@@ -15,27 +15,32 @@ Description-Content-Type: text/markdown
15
15
  License-File: LICENSE
16
16
 
17
17
  # PyHw
18
- PyHw, a neofetch-like command line tool for fetching system information but written mostly in python. Currently, Linux and macOS are supported.
18
+ 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 are supported. macOS support will be added soon.
19
19
 
20
- 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 faster than neofetch's shell implementation and easier to maintain and extend than fastfetch's 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 🤔)
20
+ 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 🤔)
21
21
 
22
- There are already a lot of similar tools, so you can choose any one of them; they're all essentially no different. If you want to try this tool, just install it directly by pip.
22
+ 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.
23
23
  ```shell
24
24
  pip install pyhw
25
25
  ```
26
+ You can then use this tool directly from the command line with the following command, just like neofetch.
27
+ ```shell
28
+ pyhw
29
+ ```
26
30
 
27
31
  ## Build from source
28
32
  ### Build tools
29
- Make sure the following python build tools already installed.
33
+ Make sure the following Python build tools are already installed.
30
34
  * setuptools
31
35
  * build
36
+ * twine
32
37
 
33
38
  ### Build package
34
39
  clone the project, and run:
35
40
  ```shell
36
41
  python -m build
37
42
  ```
38
- or you can use old setup.py style command:
43
+ or you can use the old setup.py style command:
39
44
  ```shell
40
45
  python setup.py sdist bdist_wheel
41
46
  ```
pyhw-0.1.2b0/README.md ADDED
@@ -0,0 +1,31 @@
1
+ # PyHw
2
+ 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 are supported. macOS support will be added soon.
3
+
4
+ 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 🤔)
5
+
6
+ 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.
7
+ ```shell
8
+ pip install pyhw
9
+ ```
10
+ You can then use this tool directly from the command line with the following command, just like neofetch.
11
+ ```shell
12
+ pyhw
13
+ ```
14
+
15
+ ## Build from source
16
+ ### Build tools
17
+ Make sure the following Python build tools are already installed.
18
+ * setuptools
19
+ * build
20
+ * twine
21
+
22
+ ### Build package
23
+ clone the project, and run:
24
+ ```shell
25
+ python -m build
26
+ ```
27
+ or you can use the old setup.py style command:
28
+ ```shell
29
+ python setup.py sdist bdist_wheel
30
+ ```
31
+ After the build process, the source package and the binary whl package can be found in the dist folder.
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "pyhw"
7
- version = "0.1.0b"
7
+ version = "0.1.2b"
8
8
  description = "PyHw, a neofetch-like command line tool for fetching system information but written mostly in python."
9
9
  authors = [
10
10
  { name = "Xiao Ran", email = "xiaoran.007@icloud.com" }
@@ -10,7 +10,7 @@ from .backend.cpu import CPUDetect
10
10
  from .backend.gpu import GPUDetect
11
11
  from .backend.memory import MemoryDetect
12
12
  from .pyhwUtil import createDataString
13
- from .pyhwUtil import getOS
13
+ from .pyhwUtil import getOS, selectOSLogo
14
14
 
15
15
 
16
16
  def main():
@@ -30,7 +30,7 @@ def main():
30
30
  data.GPU = GPUDetect(os="linux").getGPUInfo().gpus
31
31
  data.Memory = MemoryDetect(os="linux").getMemoryInfo().memory
32
32
 
33
- Printer(logo_os=OSDetect(os="linux").getOSInfo().id, data=createDataString(data)).cPrint()
33
+ Printer(logo_os=selectOSLogo(OSDetect(os="linux").getOSInfo().id), data=createDataString(data)).cPrint()
34
34
 
35
35
 
36
36
  if __name__ == "__main__":
@@ -15,8 +15,12 @@ class ColorConfigSet:
15
15
  return ColorConfigSetL.linux
16
16
  elif self.__os_name == "fedora":
17
17
  return ColorConfigSetF.fedora
18
+ elif self.__os_name == "fedora_small":
19
+ return ColorConfigSetF.fedora_small
18
20
  elif self.__os_name == "ubuntu":
19
21
  return ColorConfigSetU.ubuntu
22
+ elif self.__os_name == "ubuntu_small":
23
+ return ColorConfigSetU.ubuntu_small
20
24
  else:
21
25
  return ColorConfigSetL.linux # default to Linux
22
26
 
@@ -48,6 +52,14 @@ class ColorConfigSetF:
48
52
  "colorKeys": ColorSet.COLOR_FG_BLUE,
49
53
  "colorTitle": ColorSet.COLOR_FG_BLUE
50
54
  }
55
+ fedora_small = {
56
+ "colors": [
57
+ ColorSet.COLOR_FG_BLUE,
58
+ ColorSet.COLOR_FG_WHITE
59
+ ],
60
+ "colorKeys": ColorSet.COLOR_FG_BLUE,
61
+ "colorTitle": ColorSet.COLOR_FG_BLUE
62
+ }
51
63
 
52
64
 
53
65
  @dataclass
@@ -88,3 +100,10 @@ class ColorConfigSetU:
88
100
  "colorKeys": ColorSet.COLOR_FG_RED,
89
101
  "colorTitle": ColorSet.COLOR_FG_RED
90
102
  }
103
+ ubuntu_small = {
104
+ "colors": [
105
+ ColorSet.COLOR_FG_RED
106
+ ],
107
+ "colorKeys": ColorSet.COLOR_FG_RED,
108
+ "colorTitle": ColorSet.COLOR_FG_RED
109
+ }
@@ -0,0 +1,17 @@
1
+ /:-------------:\
2
+ :-------------------::
3
+ :-----------$2/shhOHbmp$1---:\
4
+ /-----------$2omMMMNNNMMD$1 ---:
5
+ :-----------$2sMMMMNMNMP$1. ---:
6
+ :-----------$2:MMMdP$1------- ---\
7
+ ,------------$2:MMMd$1-------- ---:
8
+ :------------$2:MMMd$1------- .---:
9
+ :---- $2oNMMMMMMMMMNho$1 .----:
10
+ :-- .$2+shhhMMMmhhy++$1 .------/
11
+ :- -------$2:MMMd$1--------------:
12
+ :- --------$2/MMMd$1-------------;
13
+ :- ------$2/hMMMy$1------------:
14
+ :--$2 :dMNdhhdNMMNo$1------------;
15
+ :---$2:sdNMMMMNds:$1------------:
16
+ :------$2:://:$1-------------::
17
+ :---------------------://
@@ -0,0 +1,11 @@
1
+ ..;,; .,;,.
2
+ .,lool: .ooooo,
3
+ ;oo;: .coool.
4
+ .... ''' ,l;
5
+ :oooo, 'oo.
6
+ looooc :oo'
7
+ '::' ,oo:
8
+ ,., .... co,
9
+ lo:;. :oooo; .
10
+ ':ooo; cooooc
11
+ ''' ''''
@@ -0,0 +1,3 @@
1
+ from .pyhwUtil import getOS, getArch, createDataString, selectOSLogo
2
+
3
+ __all__ = ["getOS", "getArch", "createDataString", "selectOSLogo"]
@@ -1,5 +1,6 @@
1
1
  import platform
2
2
  from ..backend import Data
3
+ import os
3
4
 
4
5
  def getOS():
5
6
  """
@@ -48,3 +49,22 @@ def createDataString(data: Data):
48
49
  Memory: {data.Memory}
49
50
  """
50
51
  return data_string
52
+
53
+
54
+ def selectOSLogo(os_id: str):
55
+ """
56
+ Select the logo based on the os id and terminal size.
57
+ :param os_id: str, os id.
58
+ :return: str, logo id.
59
+ """
60
+ rows_str, columns_str = os.popen('stty size', 'r').read().split()
61
+ rows = int(rows_str)
62
+ columns = int(columns_str)
63
+ if columns <= 80:
64
+ if os_id in ["fedora", "ubuntu"]:
65
+ return f"{os_id}_small"
66
+ else:
67
+ return os_id
68
+ else:
69
+ return os_id
70
+
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyhw
3
- Version: 0.1.0b0
3
+ Version: 0.1.2b0
4
4
  Summary: PyHw, a neofetch-like command line tool for fetching system information but written mostly in python.
5
5
  Home-page: https://github.com/xiaoran007/pyhw
6
6
  Author: Xiao Ran
@@ -15,27 +15,32 @@ Description-Content-Type: text/markdown
15
15
  License-File: LICENSE
16
16
 
17
17
  # PyHw
18
- PyHw, a neofetch-like command line tool for fetching system information but written mostly in python. Currently, Linux and macOS are supported.
18
+ 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 are supported. macOS support will be added soon.
19
19
 
20
- 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 faster than neofetch's shell implementation and easier to maintain and extend than fastfetch's 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 🤔)
20
+ 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 🤔)
21
21
 
22
- There are already a lot of similar tools, so you can choose any one of them; they're all essentially no different. If you want to try this tool, just install it directly by pip.
22
+ 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.
23
23
  ```shell
24
24
  pip install pyhw
25
25
  ```
26
+ You can then use this tool directly from the command line with the following command, just like neofetch.
27
+ ```shell
28
+ pyhw
29
+ ```
26
30
 
27
31
  ## Build from source
28
32
  ### Build tools
29
- Make sure the following python build tools already installed.
33
+ Make sure the following Python build tools are already installed.
30
34
  * setuptools
31
35
  * build
36
+ * twine
32
37
 
33
38
  ### Build package
34
39
  clone the project, and run:
35
40
  ```shell
36
41
  python -m build
37
42
  ```
38
- or you can use old setup.py style command:
43
+ or you can use the old setup.py style command:
39
44
  ```shell
40
45
  python setup.py sdist bdist_wheel
41
46
  ```
@@ -56,9 +56,11 @@ src/pyhw/frontend/logo/__init__.py
56
56
  src/pyhw/frontend/logo/logoBase.py
57
57
  src/pyhw/frontend/logo/ascii/debian.pyhw
58
58
  src/pyhw/frontend/logo/ascii/fedora.pyhw
59
+ src/pyhw/frontend/logo/ascii/fedora_small.pyhw
59
60
  src/pyhw/frontend/logo/ascii/linux.pyhw
60
61
  src/pyhw/frontend/logo/ascii/macOS.pyhw
61
62
  src/pyhw/frontend/logo/ascii/ubuntu.pyhw
63
+ src/pyhw/frontend/logo/ascii/ubuntu_small.pyhw
62
64
  src/pyhw/pyhwException/__init__.py
63
65
  src/pyhw/pyhwException/pyhwException.py
64
66
  src/pyhw/pyhwUtil/__init__.py
pyhw-0.1.0b0/README.md DELETED
@@ -1,26 +0,0 @@
1
- # PyHw
2
- PyHw, a neofetch-like command line tool for fetching system information but written mostly in python. Currently, Linux and macOS are supported.
3
-
4
- 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 faster than neofetch's shell implementation and easier to maintain and extend than fastfetch's 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 🤔)
5
-
6
- There are already a lot of similar tools, so you can choose any one of them; they're all essentially no different. If you want to try this tool, just install it directly by pip.
7
- ```shell
8
- pip install pyhw
9
- ```
10
-
11
- ## Build from source
12
- ### Build tools
13
- Make sure the following python build tools already installed.
14
- * setuptools
15
- * build
16
-
17
- ### Build package
18
- clone the project, and run:
19
- ```shell
20
- python -m build
21
- ```
22
- or you can use old setup.py style command:
23
- ```shell
24
- python setup.py sdist bdist_wheel
25
- ```
26
- After the build process, the source package and the binary whl package can be found in the dist folder.
@@ -1,3 +0,0 @@
1
- from .pyhwUtil import getOS, getArch, createDataString
2
-
3
- __all__ = ["getOS", "getArch", "createDataString"]
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes