HDpip 0.0.0__tar.gz
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.
Potentially problematic release.
This version of HDpip might be problematic. Click here for more details.
- HDpip-0.0.0/HDpip/LICENSE +8 -0
- HDpip-0.0.0/HDpip/README.md +22 -0
- HDpip-0.0.0/HDpip/__init__.py +11 -0
- HDpip-0.0.0/HDpip/core/__init__.py +7 -0
- HDpip-0.0.0/HDpip/core/base.py +105 -0
- HDpip-0.0.0/HDpip/core/data.py +62 -0
- HDpip-0.0.0/HDpip/main.py +16 -0
- HDpip-0.0.0/HDpip.egg-info/PKG-INFO +33 -0
- HDpip-0.0.0/HDpip.egg-info/SOURCES.txt +14 -0
- HDpip-0.0.0/HDpip.egg-info/dependency_links.txt +1 -0
- HDpip-0.0.0/HDpip.egg-info/entry_points.txt +3 -0
- HDpip-0.0.0/HDpip.egg-info/requires.txt +1 -0
- HDpip-0.0.0/HDpip.egg-info/top_level.txt +1 -0
- HDpip-0.0.0/PKG-INFO +33 -0
- HDpip-0.0.0/setup.cfg +4 -0
- HDpip-0.0.0/setup.py +31 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
Copyright © 2025 寒冬利刃
|
|
3
|
+
|
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
5
|
+
|
|
6
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
7
|
+
|
|
8
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"""
|
|
2
|
+
- HDpip: A pip GUI based on maliang
|
|
3
|
+
- Copyright © 2025 寒冬利刃.
|
|
4
|
+
- License: MIT
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import pathlib
|
|
8
|
+
import sys
|
|
9
|
+
import platform
|
|
10
|
+
import pip
|
|
11
|
+
|
|
12
|
+
class HDpipError(Exception):
|
|
13
|
+
"""
|
|
14
|
+
抛出一个HDpip错误,初始化函数可以接受一个`message`参数。
|
|
15
|
+
|
|
16
|
+
例如:
|
|
17
|
+
```
|
|
18
|
+
raise HDpip("炸了!")
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
***您不应该使用它**,如果您不是HDpip的开发者。*
|
|
22
|
+
"""
|
|
23
|
+
def __init__(self, message = None) -> None:
|
|
24
|
+
self.message = message
|
|
25
|
+
super().__init__(self.message)
|
|
26
|
+
|
|
27
|
+
def unfinshed() -> None:
|
|
28
|
+
"""
|
|
29
|
+
用于未完成功能的占位,使用`HDpipError`抛出一个错误。
|
|
30
|
+
"""
|
|
31
|
+
raise HDpipError("\033[1m\033[91m不是,哥们,你写了这个功能吗?!\033[0m")
|
|
32
|
+
|
|
33
|
+
def getBaseDir() -> pathlib.Path:
|
|
34
|
+
"""
|
|
35
|
+
获取HDpip的根目录,即`main.py`所在目录。
|
|
36
|
+
|
|
37
|
+
:return: 路径
|
|
38
|
+
:rtype: Path
|
|
39
|
+
"""
|
|
40
|
+
return pathlib.Path(__file__).parents[1]
|
|
41
|
+
|
|
42
|
+
def getPython() -> pathlib.Path:
|
|
43
|
+
"""
|
|
44
|
+
获取运行HDpip的Python的路径。
|
|
45
|
+
|
|
46
|
+
:return: 路径
|
|
47
|
+
:rtype: Path
|
|
48
|
+
"""
|
|
49
|
+
return pathlib.Path(sys.executable)
|
|
50
|
+
|
|
51
|
+
def switchVersion(ver: str | tuple[str, int] | list[str, int]) -> list[int]:
|
|
52
|
+
"""
|
|
53
|
+
输入一个类型为`str(分隔符为.)`、`tutple`或`list`的版本,且对每个元素`int`化,返回其列表形式。
|
|
54
|
+
|
|
55
|
+
:param ver: 输入的版本,如`0.1.0`
|
|
56
|
+
:type ver: str | tuple[str, int] | list [str]
|
|
57
|
+
:return: 输出的版本,如`[0, 1, 0]`
|
|
58
|
+
:rtype: list[int]
|
|
59
|
+
"""
|
|
60
|
+
result = []
|
|
61
|
+
if type(ver) == str:
|
|
62
|
+
result = ver.split(".")
|
|
63
|
+
elif type(ver) == tuple:
|
|
64
|
+
result = list(ver)
|
|
65
|
+
elif type(ver) == list:
|
|
66
|
+
result = ver
|
|
67
|
+
else:
|
|
68
|
+
raise TypeError(f"版本转换支持str、tuple或list类型,但您输入的是{type(ver)}!")
|
|
69
|
+
for i in range(0, len(result)):
|
|
70
|
+
result[i] = int(result[i])
|
|
71
|
+
return result
|
|
72
|
+
|
|
73
|
+
def compareUpdate(ver1: list[int], ver2: list[int]) -> bool:
|
|
74
|
+
"""
|
|
75
|
+
输入两个版本列表,返回是否需要更新。
|
|
76
|
+
|
|
77
|
+
:param ver1: 当前版本
|
|
78
|
+
:type ver1: list[int]
|
|
79
|
+
:param ver2: 对比版本
|
|
80
|
+
:type ver2: list[int]
|
|
81
|
+
:return: 是否需要更新
|
|
82
|
+
:rtype: bool
|
|
83
|
+
"""
|
|
84
|
+
for i1, i2 in zip(ver1, ver2):
|
|
85
|
+
if i1 < i2:
|
|
86
|
+
return True
|
|
87
|
+
return False
|
|
88
|
+
|
|
89
|
+
def getPythonVersion() -> list[int]:
|
|
90
|
+
"""
|
|
91
|
+
获取运行HDpip的Python的版本。
|
|
92
|
+
|
|
93
|
+
:return: 版本列表
|
|
94
|
+
:rtype: list[int]
|
|
95
|
+
"""
|
|
96
|
+
return switchVersion(platform.python_version_tuple())
|
|
97
|
+
|
|
98
|
+
def getPipVersion() -> list[int]:
|
|
99
|
+
"""
|
|
100
|
+
获取运行HDpip的Python所对应的pip的版本。
|
|
101
|
+
|
|
102
|
+
:return: 版本列表
|
|
103
|
+
:rtype: list[int]
|
|
104
|
+
"""
|
|
105
|
+
return switchVersion(pip.__version__)
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"""
|
|
2
|
+
- HDpip: A pip GUI based on maliang
|
|
3
|
+
- Copyright © 2025 寒冬利刃.
|
|
4
|
+
- License: MIT
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import json
|
|
8
|
+
|
|
9
|
+
class Data():
|
|
10
|
+
"""
|
|
11
|
+
接受一个`.json`文件(使用`open`函数打开文件,并使用`load`函数加载。),生成一个数据类。
|
|
12
|
+
|
|
13
|
+
但是,您应该如此获得数据:
|
|
14
|
+
```
|
|
15
|
+
d = Data()
|
|
16
|
+
d.open("data.json")
|
|
17
|
+
d.load() #这是必须的,因为在open后不会自动运行load函数。
|
|
18
|
+
print(d.data[0][0])
|
|
19
|
+
```
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
def open(self, file: str, encoding: str = "utf-8") -> dict[str: str]:
|
|
23
|
+
"""
|
|
24
|
+
绑定一个`.json`文件,且返回绑定的文件字典。
|
|
25
|
+
|
|
26
|
+
:param self: `Data`类
|
|
27
|
+
:param file: 一个指向`.json`文件的路径,如`data.json`
|
|
28
|
+
:type file: str
|
|
29
|
+
:param encoding: 编码字符串,如`utf-8`
|
|
30
|
+
:type encoding: str
|
|
31
|
+
:param mode: 文件打开模式,如`w+`
|
|
32
|
+
:type mode: str
|
|
33
|
+
:return: 文件字典
|
|
34
|
+
:rtype: dict[str: str]
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
self.file = {"file": file, "encoding": encoding}
|
|
38
|
+
return self.file
|
|
39
|
+
def load(self) -> list | dict:
|
|
40
|
+
"""
|
|
41
|
+
加载`.json`文件的数据至数据类并返回。
|
|
42
|
+
|
|
43
|
+
:param self: `Data`类
|
|
44
|
+
:return: 数据
|
|
45
|
+
:rtype: list | dict
|
|
46
|
+
"""
|
|
47
|
+
|
|
48
|
+
with open(**self.file, mode = "r") as f:
|
|
49
|
+
self.data = json.load(f)
|
|
50
|
+
return self.data
|
|
51
|
+
def save(self) -> list | dict:
|
|
52
|
+
"""
|
|
53
|
+
保存`.json`文件的数据至文件并返回。
|
|
54
|
+
|
|
55
|
+
:param self: `Data`类
|
|
56
|
+
:return: 数据
|
|
57
|
+
:rtype: list | dict
|
|
58
|
+
"""
|
|
59
|
+
|
|
60
|
+
with open(**self.file, mode = "w") as f:
|
|
61
|
+
json.dump(self.data, f)
|
|
62
|
+
return self.data
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"""
|
|
2
|
+
- HDpip: A pip GUI based on maliang
|
|
3
|
+
- Copyright © 2025 寒冬利刃.
|
|
4
|
+
- License: MIT
|
|
5
|
+
"""
|
|
6
|
+
try:
|
|
7
|
+
from . import core
|
|
8
|
+
except ImportError:
|
|
9
|
+
import core
|
|
10
|
+
|
|
11
|
+
def main():
|
|
12
|
+
print(core.base.getBaseDir())
|
|
13
|
+
print(core.base.getPython())
|
|
14
|
+
|
|
15
|
+
if __name__ == "__main__":
|
|
16
|
+
main()
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: HDpip
|
|
3
|
+
Version: 0.0.0
|
|
4
|
+
Summary: 寒冬pip(HDpip)
|
|
5
|
+
Home-page: https://gitee.com/handongliren
|
|
6
|
+
Author: 寒冬利刃(handongliren(hdlr))
|
|
7
|
+
Author-email: 1079489986@qq.com
|
|
8
|
+
License: MIT
|
|
9
|
+
Requires-Python: >=3.10
|
|
10
|
+
Description-Content-Type: text/Markdown
|
|
11
|
+
|
|
12
|
+
# 寒冬pip HDpip
|
|
13
|
+
## 一个基于马良框架的**pip GUI**
|
|
14
|
+
## **A pip GUI** based on maliang
|
|
15
|
+
|
|
16
|
+
## 安装
|
|
17
|
+
## Install
|
|
18
|
+
```shell
|
|
19
|
+
pip install HDpip
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## 使用
|
|
23
|
+
## Use
|
|
24
|
+
```shell
|
|
25
|
+
HDpip
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
或者
|
|
29
|
+
|
|
30
|
+
or
|
|
31
|
+
```shell
|
|
32
|
+
hdpip
|
|
33
|
+
```
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
setup.py
|
|
2
|
+
HDpip/LICENSE
|
|
3
|
+
HDpip/README.md
|
|
4
|
+
HDpip/__init__.py
|
|
5
|
+
HDpip/main.py
|
|
6
|
+
HDpip.egg-info/PKG-INFO
|
|
7
|
+
HDpip.egg-info/SOURCES.txt
|
|
8
|
+
HDpip.egg-info/dependency_links.txt
|
|
9
|
+
HDpip.egg-info/entry_points.txt
|
|
10
|
+
HDpip.egg-info/requires.txt
|
|
11
|
+
HDpip.egg-info/top_level.txt
|
|
12
|
+
HDpip/core/__init__.py
|
|
13
|
+
HDpip/core/base.py
|
|
14
|
+
HDpip/core/data.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
maliang[opt]>=3.0.0
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
HDpip
|
HDpip-0.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: HDpip
|
|
3
|
+
Version: 0.0.0
|
|
4
|
+
Summary: 寒冬pip(HDpip)
|
|
5
|
+
Home-page: https://gitee.com/handongliren
|
|
6
|
+
Author: 寒冬利刃(handongliren(hdlr))
|
|
7
|
+
Author-email: 1079489986@qq.com
|
|
8
|
+
License: MIT
|
|
9
|
+
Requires-Python: >=3.10
|
|
10
|
+
Description-Content-Type: text/Markdown
|
|
11
|
+
|
|
12
|
+
# 寒冬pip HDpip
|
|
13
|
+
## 一个基于马良框架的**pip GUI**
|
|
14
|
+
## **A pip GUI** based on maliang
|
|
15
|
+
|
|
16
|
+
## 安装
|
|
17
|
+
## Install
|
|
18
|
+
```shell
|
|
19
|
+
pip install HDpip
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## 使用
|
|
23
|
+
## Use
|
|
24
|
+
```shell
|
|
25
|
+
HDpip
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
或者
|
|
29
|
+
|
|
30
|
+
or
|
|
31
|
+
```shell
|
|
32
|
+
hdpip
|
|
33
|
+
```
|
HDpip-0.0.0/setup.cfg
ADDED
HDpip-0.0.0/setup.py
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import setuptools
|
|
2
|
+
|
|
3
|
+
with open("HDpip\\README.md", 'r', encoding="utf8") as fh:
|
|
4
|
+
long_description = fh.read()
|
|
5
|
+
|
|
6
|
+
setuptools.setup(
|
|
7
|
+
name = "HDpip",
|
|
8
|
+
version = "0.0.0",
|
|
9
|
+
author = "寒冬利刃(handongliren(hdlr))",
|
|
10
|
+
author_email = "1079489986@qq.com",
|
|
11
|
+
description = "寒冬pip(HDpip)",
|
|
12
|
+
long_description = long_description,
|
|
13
|
+
long_description_content_type = "text/Markdown",
|
|
14
|
+
license = "MIT",
|
|
15
|
+
url = "https://gitee.com/handongliren",
|
|
16
|
+
packages = setuptools.find_packages(),
|
|
17
|
+
package_data={
|
|
18
|
+
"HDpip": ["*"],
|
|
19
|
+
},
|
|
20
|
+
python_requires = ">=3.10",
|
|
21
|
+
install_requires = [
|
|
22
|
+
# "wheel>=0.40.0",
|
|
23
|
+
"maliang[opt]>=3.0.0",
|
|
24
|
+
],
|
|
25
|
+
entry_points={
|
|
26
|
+
"console_scripts": [
|
|
27
|
+
"HDpip=HDpip.main:main",
|
|
28
|
+
"hdpip=HDpip.main:main"
|
|
29
|
+
],
|
|
30
|
+
},
|
|
31
|
+
)
|