xywechatpad-binary 0.2__py3-none-manylinux2014_x86_64.whl
Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,56 @@
|
|
1
|
+
import platform
|
2
|
+
import shutil
|
3
|
+
from pathlib import Path
|
4
|
+
|
5
|
+
def copy_binary(target_dir: Path) -> Path:
|
6
|
+
"""
|
7
|
+
将当前平台的二进制文件复制到指定目录
|
8
|
+
:param target_dir: 必须存在的目标目录
|
9
|
+
:return: 复制后的完整文件路径
|
10
|
+
:raises FileNotFoundError: 当目标目录不存在时
|
11
|
+
:raises OSError: 平台不受支持时
|
12
|
+
"""
|
13
|
+
system = platform.system().lower()
|
14
|
+
machine = platform.machine().lower()
|
15
|
+
|
16
|
+
# 平台到二进制路径的映射
|
17
|
+
BIN_MAP = {
|
18
|
+
"linux": {
|
19
|
+
"x86_64": "binaries/linux_x64/XYBotWechatPad",
|
20
|
+
"amd64": "binaries/linux_x64/XYBotWechatPad",
|
21
|
+
"aarch64": "binaries/linux_aarch64/XYBotWechatPad"
|
22
|
+
},
|
23
|
+
"darwin": { # macOS
|
24
|
+
"x86_64": "binaries/macos_x64/XYBotWechatPad",
|
25
|
+
"arm64": "binaries/macos_arm64/XYBotWechatPad"
|
26
|
+
},
|
27
|
+
"windows": {
|
28
|
+
"x86_64": "binaries/win_x64/XYBotWechatPad.exe",
|
29
|
+
"amd64": "binaries/win_x64/XYBotWechatPad.exe"
|
30
|
+
}
|
31
|
+
}
|
32
|
+
|
33
|
+
# 验证平台支持
|
34
|
+
if system not in BIN_MAP or machine not in BIN_MAP[system]:
|
35
|
+
raise OSError(f"Unsupported platform: {system}-{machine}")
|
36
|
+
|
37
|
+
# 获取源文件路径
|
38
|
+
src_path = Path(__file__).parent / BIN_MAP[system][machine]
|
39
|
+
if not src_path.exists():
|
40
|
+
raise FileNotFoundError(f"Binary not found: {src_path}")
|
41
|
+
|
42
|
+
# 验证目标目录
|
43
|
+
if not target_dir.is_dir():
|
44
|
+
raise FileNotFoundError(f"Target directory does not exist: {target_dir}")
|
45
|
+
|
46
|
+
# 构建目标路径
|
47
|
+
dest_path = target_dir / src_path.name
|
48
|
+
|
49
|
+
# 执行复制
|
50
|
+
shutil.copy2(src_path, dest_path)
|
51
|
+
|
52
|
+
# 设置可执行权限(非Windows)
|
53
|
+
if system != "windows":
|
54
|
+
dest_path.chmod(0o755)
|
55
|
+
|
56
|
+
return dest_path
|
@@ -0,0 +1,31 @@
|
|
1
|
+
Metadata-Version: 2.2
|
2
|
+
Name: xywechatpad-binary
|
3
|
+
Version: 0.2
|
4
|
+
Summary: XYBotV2 Binary Distribution
|
5
|
+
Home-page: https://github.com/HenryXiaoYang/xywechatpad-binary
|
6
|
+
Author: HenryXiaoYang
|
7
|
+
Author-email: henryyang666@hotmail.com
|
8
|
+
Platform: Linux-x86_64
|
9
|
+
Platform: Linux-aarch64
|
10
|
+
Platform: macosx-x86_64
|
11
|
+
Platform: macosx-arm64
|
12
|
+
Platform: Windows-x86_64
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
14
|
+
Classifier: Operating System :: POSIX :: Linux
|
15
|
+
Classifier: Operating System :: MacOS
|
16
|
+
Classifier: Operating System :: Microsoft :: Windows
|
17
|
+
Requires-Python: >=3.11
|
18
|
+
Description-Content-Type: text/markdown
|
19
|
+
Dynamic: author
|
20
|
+
Dynamic: author-email
|
21
|
+
Dynamic: classifier
|
22
|
+
Dynamic: description
|
23
|
+
Dynamic: description-content-type
|
24
|
+
Dynamic: home-page
|
25
|
+
Dynamic: platform
|
26
|
+
Dynamic: requires-python
|
27
|
+
Dynamic: summary
|
28
|
+
|
29
|
+
# XYWechatPad Binary Distribution
|
30
|
+
|
31
|
+
Binary distribution for XYBotV2
|
@@ -0,0 +1,5 @@
|
|
1
|
+
xywechatpad_binary/__init__.py,sha256=2giITP8Ossj09FKCREcCg1VdIIYSOQxYxumaKY0o1m0,1779
|
2
|
+
xywechatpad_binary-0.2.dist-info/METADATA,sha256=yDjqidvoCEFBS0Tm4dU5GLIQWIP_xLEcdTAJPOaTrrU,850
|
3
|
+
xywechatpad_binary-0.2.dist-info/WHEEL,sha256=q0csfyxC0CgL_VbODy1dAROUKOBO6j0wA7STVVTEknI,108
|
4
|
+
xywechatpad_binary-0.2.dist-info/top_level.txt,sha256=BRNwtnBow_nuNSwzbRI87oDT3yD0UME9sQZ0vLtvRzQ,19
|
5
|
+
xywechatpad_binary-0.2.dist-info/RECORD,,
|
@@ -0,0 +1 @@
|
|
1
|
+
xywechatpad_binary
|