pyhw 0.1.0b0__py3-none-any.whl → 0.1.2b0__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- pyhw/__main__.py +2 -2
- pyhw/frontend/color/colorConfig.py +19 -0
- pyhw/frontend/logo/ascii/fedora_small.pyhw +17 -0
- pyhw/frontend/logo/ascii/ubuntu_small.pyhw +11 -0
- pyhw/pyhwUtil/__init__.py +2 -2
- pyhw/pyhwUtil/pyhwUtil.py +20 -0
- {pyhw-0.1.0b0.dist-info → pyhw-0.1.2b0.dist-info}/METADATA +11 -6
- {pyhw-0.1.0b0.dist-info → pyhw-0.1.2b0.dist-info}/RECORD +12 -10
- {pyhw-0.1.0b0.dist-info → pyhw-0.1.2b0.dist-info}/LICENSE +0 -0
- {pyhw-0.1.0b0.dist-info → pyhw-0.1.2b0.dist-info}/WHEEL +0 -0
- {pyhw-0.1.0b0.dist-info → pyhw-0.1.2b0.dist-info}/entry_points.txt +0 -0
- {pyhw-0.1.0b0.dist-info → pyhw-0.1.2b0.dist-info}/top_level.txt +0 -0
pyhw/__main__.py
CHANGED
@@ -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
|
+
:---------------------://
|
pyhw/pyhwUtil/__init__.py
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
from .pyhwUtil import getOS, getArch, createDataString
|
1
|
+
from .pyhwUtil import getOS, getArch, createDataString, selectOSLogo
|
2
2
|
|
3
|
-
__all__ = ["getOS", "getArch", "createDataString"]
|
3
|
+
__all__ = ["getOS", "getArch", "createDataString", "selectOSLogo"]
|
pyhw/pyhwUtil/pyhwUtil.py
CHANGED
@@ -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.
|
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
|
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
|
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
|
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
|
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
|
```
|
@@ -1,5 +1,5 @@
|
|
1
1
|
pyhw/__init__.py,sha256=IMjkMO3twhQzluVTo8Z6rE7Eg-9U79_LGKMcsWLKBkY,22
|
2
|
-
pyhw/__main__.py,sha256=
|
2
|
+
pyhw/__main__.py,sha256=HH17lyJ0KJVmlES4pOanM-hWcK1qi03Cwb-s0jxT3PA,1452
|
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
|
@@ -39,23 +39,25 @@ pyhw/backend/uptime/uptimeBase.py,sha256=_sloK7fKJB3qwKT-1jBJXJPkKB-eBDKqkn4ZbEv
|
|
39
39
|
pyhw/frontend/__init__.py,sha256=xgv_iVv9w4cLXklbdtFWXu7J7KJxBCUw-ZcUQb_abFc,57
|
40
40
|
pyhw/frontend/frontendBase.py,sha256=I3jSBeoVAp22XEiK1qOkVLN3Okx-kroU0Rn7fO7bVkw,3711
|
41
41
|
pyhw/frontend/color/__init__.py,sha256=xk511qWwdYWEVjk_zOaC4fs81HtwR4ELr3wi1tTL824,191
|
42
|
-
pyhw/frontend/color/colorConfig.py,sha256=
|
42
|
+
pyhw/frontend/color/colorConfig.py,sha256=jPjLzv67haEr6rNC2hoNLJLWHO5LQx4zBbLTy3FHA0E,2718
|
43
43
|
pyhw/frontend/color/colorSet.py,sha256=spH8PlRu7capouf-yUgDHgoPCnM5aJ_ncascISZfz2g,1421
|
44
44
|
pyhw/frontend/color/colorUtil.py,sha256=VhcPmAJmXGIiRBfVZE2jg_iy-SfbxqwOSvkRz-nbUOQ,94
|
45
45
|
pyhw/frontend/logo/__init__.py,sha256=mozEarHueBUgtDHKSd-RDaFysMLUiW3VQ8KcBtlKGCI,47
|
46
46
|
pyhw/frontend/logo/logoBase.py,sha256=NjRCg0CXjmW4_7UZp2ZBgy2PZOAqaR6SYHg9zd90kRo,634
|
47
47
|
pyhw/frontend/logo/ascii/debian.pyhw,sha256=ZmO1fg3Uc_ofF-CZSOP0Qo298luDASh2Zt50UmY6DBQ,437
|
48
48
|
pyhw/frontend/logo/ascii/fedora.pyhw,sha256=IuFE6BByaNfVgn1pn7rKH7QVlIJyEmgGopCAOpXa6oM,742
|
49
|
+
pyhw/frontend/logo/ascii/fedora_small.pyhw,sha256=_LSBzuCJjMa8pzmiJ3KN7Ndi-TryYPmtEfKqxxPAFfE,601
|
49
50
|
pyhw/frontend/logo/ascii/linux.pyhw,sha256=IMe6YNElwCjLtv6kgSkERbATyyJAK531vcrT-otaLWE,300
|
50
51
|
pyhw/frontend/logo/ascii/macOS.pyhw,sha256=HBGROtBb7wrNtRqAQ9ND7zxK0l17BRsmpgc2dMo_m6s,474
|
51
52
|
pyhw/frontend/logo/ascii/ubuntu.pyhw,sha256=l-Q0PfutxXYMwTojqeiM88063x4V0RBkZUHmi6YdsNc,833
|
53
|
+
pyhw/frontend/logo/ascii/ubuntu_small.pyhw,sha256=Xf8LSZdZUu9aEG3efhb1FUlUEuJ-3UztcIOJISpKhPw,229
|
52
54
|
pyhw/pyhwException/__init__.py,sha256=8JsFvtF13g0Y5t4z9fRndDXtfCzuBM59jDf6PhWSFSk,220
|
53
55
|
pyhw/pyhwException/pyhwException.py,sha256=wxuzFQa9g7XB1q9TUKO_55lw7wMEJMpzG8w1GVTFVa0,197
|
54
|
-
pyhw/pyhwUtil/__init__.py,sha256=
|
55
|
-
pyhw/pyhwUtil/pyhwUtil.py,sha256=
|
56
|
-
pyhw-0.1.
|
57
|
-
pyhw-0.1.
|
58
|
-
pyhw-0.1.
|
59
|
-
pyhw-0.1.
|
60
|
-
pyhw-0.1.
|
61
|
-
pyhw-0.1.
|
56
|
+
pyhw/pyhwUtil/__init__.py,sha256=T87U8jEL-Z0jBZOYAzZpqu_8jBYRkqIONG6ZCARl8nc,137
|
57
|
+
pyhw/pyhwUtil/pyhwUtil.py,sha256=MNAePrn17jNugorg8WLPhl_aFjfQxEpJQ8pBWLhd9gA,1611
|
58
|
+
pyhw-0.1.2b0.dist-info/LICENSE,sha256=hJs6RBqSVCexbTsalkMLNFI5t06kekQEsSVaOt_-yLs,1497
|
59
|
+
pyhw-0.1.2b0.dist-info/METADATA,sha256=XODZ4iRBefEfj47us4NDEPSXZX3HKmk1_8b7mHJmCEQ,2028
|
60
|
+
pyhw-0.1.2b0.dist-info/WHEEL,sha256=HiCZjzuy6Dw0hdX5R3LCFPDmFS4BWl8H-8W39XfmgX4,91
|
61
|
+
pyhw-0.1.2b0.dist-info/entry_points.txt,sha256=q-AB8im_QahpmNrmy4aPTJRGi0LlbNlnI3kF7s6pKss,44
|
62
|
+
pyhw-0.1.2b0.dist-info/top_level.txt,sha256=7Inxvxt1TngEricKZEex9_WJZS3DbKYFUXDz4v5WHYU,5
|
63
|
+
pyhw-0.1.2b0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|