pbox-cli 0.2.29__py3-none-any.whl
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.
- pbox_cli/__init__.py +2 -0
- pbox_cli/__main__.py +64 -0
- pbox_cli/bin/pbox +0 -0
- pbox_cli/bin/pbox-darwin-arm64 +0 -0
- pbox_cli/bin/pbox-darwin-x64 +0 -0
- pbox_cli/bin/pbox-linux-x64 +0 -0
- pbox_cli-0.2.29.dist-info/METADATA +41 -0
- pbox_cli-0.2.29.dist-info/RECORD +11 -0
- pbox_cli-0.2.29.dist-info/WHEEL +5 -0
- pbox_cli-0.2.29.dist-info/entry_points.txt +3 -0
- pbox_cli-0.2.29.dist-info/top_level.txt +1 -0
pbox_cli/__init__.py
ADDED
pbox_cli/__main__.py
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
import sys
|
|
3
|
+
import os
|
|
4
|
+
import subprocess
|
|
5
|
+
import shutil
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
|
|
8
|
+
def get_binary_path():
|
|
9
|
+
pkg_dir = Path(__file__).resolve().parent
|
|
10
|
+
bin_dir = pkg_dir / "bin"
|
|
11
|
+
is_win = sys.platform.startswith("win")
|
|
12
|
+
bin_name = "pbox.exe" if is_win else "pbox"
|
|
13
|
+
|
|
14
|
+
import platform as sys_platform_mod
|
|
15
|
+
machine = sys_platform_mod.machine().lower()
|
|
16
|
+
norm_arch = "arm64" if machine in ("arm64", "aarch64") else ("x64" if machine in ("x86_64", "amd64", "x64") else machine)
|
|
17
|
+
|
|
18
|
+
plat_key = "darwin" if sys.platform == "darwin" else ("win32" if sys.platform.startswith("win") else "linux")
|
|
19
|
+
arch_bin_name = f"pbox-{plat_key}-{norm_arch}.exe" if is_win else f"pbox-{plat_key}-{norm_arch}"
|
|
20
|
+
|
|
21
|
+
# 1. 尝试匹配具体平台和架构的二进制 (如 pbox-darwin-arm64, pbox-linux-x64, pbox-win32-x64.exe)
|
|
22
|
+
arch_bin = bin_dir / arch_bin_name
|
|
23
|
+
if arch_bin.exists():
|
|
24
|
+
return arch_bin
|
|
25
|
+
|
|
26
|
+
# 2. 尝试匹配通用名称二进制 (pbox / pbox.exe)
|
|
27
|
+
local_bin = bin_dir / bin_name
|
|
28
|
+
if local_bin.exists():
|
|
29
|
+
return local_bin
|
|
30
|
+
|
|
31
|
+
# 3. 尝试匹配系统 PATH 里的 pbox
|
|
32
|
+
which_pbox = shutil.which("pbox")
|
|
33
|
+
if which_pbox and os.path.exists(which_pbox):
|
|
34
|
+
return Path(which_pbox)
|
|
35
|
+
|
|
36
|
+
return None
|
|
37
|
+
|
|
38
|
+
def main():
|
|
39
|
+
bin_path = get_binary_path()
|
|
40
|
+
if not bin_path:
|
|
41
|
+
sys.stderr.write(
|
|
42
|
+
f"❌ 错误: 未能在当前环境找到 pbox 原生二进制。\n"
|
|
43
|
+
f"系统平台: {sys.platform}\n"
|
|
44
|
+
f"请访问 https://newonet.com 获取适合您平台的版本。\n"
|
|
45
|
+
)
|
|
46
|
+
sys.exit(1)
|
|
47
|
+
|
|
48
|
+
if not sys.platform.startswith("win"):
|
|
49
|
+
try:
|
|
50
|
+
os.chmod(bin_path, 0o755)
|
|
51
|
+
except Exception:
|
|
52
|
+
pass
|
|
53
|
+
|
|
54
|
+
try:
|
|
55
|
+
ret = subprocess.call([str(bin_path)] + sys.argv[1:])
|
|
56
|
+
sys.exit(ret)
|
|
57
|
+
except KeyboardInterrupt:
|
|
58
|
+
sys.exit(130)
|
|
59
|
+
except Exception as e:
|
|
60
|
+
sys.stderr.write(f"执行失败: {e}\n")
|
|
61
|
+
sys.exit(1)
|
|
62
|
+
|
|
63
|
+
if __name__ == "__main__":
|
|
64
|
+
main()
|
pbox_cli/bin/pbox
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pbox-cli
|
|
3
|
+
Version: 0.2.29
|
|
4
|
+
Summary: P-Box CLI - 高性能跨平台整合包管理与下载命令行工具
|
|
5
|
+
Author: newonet.com
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: Operating System :: OS Independent
|
|
9
|
+
Classifier: Topic :: Utilities
|
|
10
|
+
Requires-Python: >=3.7
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
Dynamic: requires-python
|
|
13
|
+
|
|
14
|
+
# pbox-cli
|
|
15
|
+
|
|
16
|
+
P-Box 命令行工具 (CLI) - 高性能跨平台整合包管理与下载。
|
|
17
|
+
|
|
18
|
+
## 安装与快速使用
|
|
19
|
+
|
|
20
|
+
### 1. 使用 pipx 免安装即用 (推荐)
|
|
21
|
+
```bash
|
|
22
|
+
pipx run pbox-cli whoami
|
|
23
|
+
pipx run pbox-cli list
|
|
24
|
+
pipx run pbox-cli download <PACKAGE_ID>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### 2. 使用 pip 全局安装
|
|
28
|
+
```bash
|
|
29
|
+
pip install pbox-cli
|
|
30
|
+
|
|
31
|
+
# 查看帮助
|
|
32
|
+
pbox --help
|
|
33
|
+
|
|
34
|
+
# 登录
|
|
35
|
+
pbox login
|
|
36
|
+
|
|
37
|
+
# 下载整合包
|
|
38
|
+
pbox download 5 -y
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
官网与更多信息:[https://newonet.com](https://newonet.com)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
pbox_cli/__init__.py,sha256=ndcAU52f_hYpQyTCGthJ41UPAFrKDkC7dj-ExcTdQ9o,54
|
|
2
|
+
pbox_cli/__main__.py,sha256=WEE5eDFpBaR1SxF5w5YZqbYTbf6LZijcBGbvvjkkJX0,2016
|
|
3
|
+
pbox_cli/bin/pbox,sha256=g4NB3bx8FXd-K2SSDnHQfjgWfKluSnJHxISYpD72Rvo,3874064
|
|
4
|
+
pbox_cli/bin/pbox-darwin-arm64,sha256=g4NB3bx8FXd-K2SSDnHQfjgWfKluSnJHxISYpD72Rvo,3874064
|
|
5
|
+
pbox_cli/bin/pbox-darwin-x64,sha256=8nq2pA48yxNu8RGmk6FGwBCcbu6msGrEPNohZv5hD8s,4110192
|
|
6
|
+
pbox_cli/bin/pbox-linux-x64,sha256=afRUAA8ITBFj_8V1lL2ItOhNfpiVbXN7wZWE-zhPycA,3643216
|
|
7
|
+
pbox_cli-0.2.29.dist-info/METADATA,sha256=yyJEF4DEt4v9d6KGCadwTyVkxsEJHiYLW2eNpuzMZ7o,877
|
|
8
|
+
pbox_cli-0.2.29.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
|
|
9
|
+
pbox_cli-0.2.29.dist-info/entry_points.txt,sha256=txU2xGl14qqjHSwou-24l2erDAOSoRWAe_bimXTWfPg,82
|
|
10
|
+
pbox_cli-0.2.29.dist-info/top_level.txt,sha256=PUSPlieW9IxLDGTVrJiCpvgYD1ijhpMFGJtXuPcotI8,9
|
|
11
|
+
pbox_cli-0.2.29.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
pbox_cli
|