Skip to content

Commit 0ef4aea

Browse files
committed
Version 0.7.0
1 parent 2d80b02 commit 0ef4aea

6 files changed

Lines changed: 66 additions & 33 deletions

File tree

.github/workflows/main.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,9 @@ jobs:
2222
- name: Install and configure Poetry
2323
uses: snok/install-poetry@v1
2424
with:
25-
version: 1.1.10
26-
virtualenvs-create: false
25+
virtualenvs-create: true
2726
- name: Install dependencies
28-
run: poetry install
27+
run: poetry install --no-root
2928
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
3029
- name: Format check with black
3130
run: poetry run black --check .

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## v0.7.0 - 2022-08-03
4+
5+
### Added
6+
7+
- 支持设置帐号名。
8+
- 支持命令行自动完成。
9+
310
## v0.6.32 - 2022-01-23
411

512
### Updated

README.md

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,12 @@ BaiduPCS-Py 是百度网盘 pcs 的非官方 api 和一个命令行运用程序
2424
- [用法](#用法)
2525
- [命令别名](#命令别名)
2626
- [对多个帐号进行相同操作](#对多个帐号进行相同操作)
27+
- [自动补全](#自动补全)
2728

2829
#### 用户相关命令
2930

3031
- [添加用户](#添加用户)
32+
- [设置账号名](#设置账号名)
3133
- [显示当前用户的信息](#显示当前用户的信息)
3234
- [更新用户信息](#更新用户信息)
3335
- [显示所有用户](#显示所有用户)
@@ -139,6 +141,7 @@ BaiduPCS-Py --help
139141
| su | su |
140142
| ul | userlist |
141143
| ua | useradd |
144+
| an | accountname |
142145
| ep | encryptpwd |
143146
| ud | userdel |
144147
| l | ls |
@@ -170,31 +173,31 @@ BaiduPCS-Py --help
170173

171174
BaiduPCS-Py 支持对多个帐号进行相同操作。比如,用相同关键字搜索多个帐号,上传相同的文件/目录到多个帐号,等等。
172175

173-
使用者只需用 `--users` 选项来指定要操作的帐号名即可。
176+
使用者只需用 `--accounts` (或 `-u`) 选项来指定要操作的帐号名即可。
174177

175-
`--users` 接受一个参数,这个参数是用“,”连接的要进行操作帐号名的部分字符。假设我们现在有 3 个帐号,帐号名分别是 `Tom``Peter``Joy`
178+
`--accounts` 接受一个参数,这个参数是用“,”连接的要进行操作帐号名的部分字符。假设我们现在有 3 个帐号,帐号名分别是 `Tom``Peter``Joy`
176179
现在我要同时对`Tom``Joy`进行关键字搜索。我们可以用下面的命令进行:
177180

178181
```
179-
BaiduPCS-Py --users 'Tom,Joy' search 'keyword' / -R
182+
BaiduPCS-Py --accounts 'Tom,Joy' search 'keyword' / -R
180183
```
181184

182185
或者给出帐号名的部分片段:
183186

184187
```
185-
BaiduPCS-Py --users 'om,oy' search 'keyword' / -R
188+
BaiduPCS-Py --accounts 'om,oy' search 'keyword' / -R
186189
```
187190

188191
更简单可以用:
189192

190193
```
191194
# Tom, Joy 都包含字符 "o"
192-
BaiduPCS-Py --users 'o' search 'keyword' / -R
195+
BaiduPCS-Py --accounts 'o' search 'keyword' / -R
193196
```
194197

195-
如果要对所有帐号进行操作用 `--users ''`
198+
如果要对所有帐号进行操作用 `--accounts ''`
196199

197-
如果不使用 `--users` 选项,默认只对当前帐号进行操作。
200+
如果不使用 `--accounts` 选项,默认只对当前帐号进行操作。
198201

199202
以下命令支持对多个帐号进行操作:
200203

@@ -223,7 +226,23 @@ BaiduPCS-Py --users 'o' search 'keyword' / -R
223226
- purgetasks
224227
- server
225228

226-
**注意**: `--users` 一定要跟在 `BaiduPCS-Py` 后,命令前。
229+
**注意**: `--accounts` 一定要跟在 `BaiduPCS-Py` 后,命令前。
230+
231+
## 自动补全
232+
233+
在 Bash, Zsh 和 Fish 上 `BaiduPCS-Py` 命令支持自动补全。
234+
235+
- 在 Bash 上,加入下面一行到 `~/.bashrc`
236+
237+
`eval "$(_BAIDUPCS_PY_COMPLETE=bash_source BaiduPCS-Py)"`
238+
239+
- 在 Zsh 上,加入下面一行到 `~/.zshrc`
240+
241+
`eval "$(_BAIDUPCS_PY_COMPLETE=zsh_source BaiduPCS-Py)"`
242+
243+
- 在 Fish 上,加入下面一行到 `~/.config/fish/completions/foo-bar.fish`
244+
245+
`eval (env _BAIDUPCS_PY_COMPLETE=fish_source BaiduPCS-Py)`
227246

228247
## 添加用户
229248

@@ -257,6 +276,16 @@ BaiduPCS-Py useradd --cookies "cookies 值" --bduss "bduss 值"
257276

258277
BaiduPCS-Py 支持多用户,你只需一直用 `useradd` 来添加用户即可。
259278

279+
## 设置账号名
280+
281+
```
282+
BaiduPCS-Py accountname --account-name "my account"
283+
```
284+
285+
| Option | Description |
286+
| ------------------------- | ---------------------------------- |
287+
| --account-name, --an TEXT | 设置账号名,用于指定运行帐号和显示 |
288+
260289
## 显示当前用户的信息
261290

262291
```

baidupcs_py/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
from baidupcs_py.baidupcs import BaiduPCS, BaiduPCSApi
22

3-
__version__ = "0.6.32"
3+
__version__ = "0.7.0"

pyproject.toml

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[tool.poetry]
22
name = "BaiduPCS-Py"
33
homepage = "https://github.com/PeterDing/BaiduPCS-Py"
4-
version = "0.6.32"
4+
version = "0.7.0"
55
description = "Baidu Pcs Api and App"
66
authors = ["PeterDing <dfhayst@gmail.com>"]
77
license = "MIT"
@@ -20,32 +20,30 @@ build = "build.py"
2020

2121
[tool.poetry.dependencies]
2222
python = "^3.7"
23-
requests = "^2.27.1"
24-
rich = "^11.0.0"
23+
requests = "^2.28.1"
24+
rich = "^12.5.1"
2525
requests-toolbelt = "^0.9.1"
26-
Pillow = "^9.0.0"
27-
click = "^8.0.3"
28-
typing-extensions = "^4.0.1"
26+
Pillow = "^9.2.0"
27+
click = "^8.1.3"
28+
typing-extensions = "^4.3.0"
2929
aget = "^0.1.17"
30-
chardet = "^4.0.0"
31-
fastapi = "^0.71.0"
32-
uvicorn = "^0.16.0"
33-
Jinja2 = "^3.0.3"
34-
cryptography = "^36.0.1"
35-
filelock = "^3.4.2"
36-
Cython = "^0.29.26"
30+
chardet = "^5.0.0"
31+
fastapi = "^0.79.0"
32+
uvicorn = "^0.18.2"
33+
Jinja2 = "^3.1.2"
34+
cryptography = "^37.0.4"
35+
Cython = "^0.29.32"
3736
passlib = "^1.7.4"
3837

39-
[tool.poetry.dev-dependencies]
40-
pytest = "^6.2.5"
41-
mypy = "^0.931"
42-
black = "^21.12b0"
43-
setuptools = "^60.5.0"
44-
Cython = "^0.29.26"
45-
4638
[tool.poetry.scripts]
4739
BaiduPCS-Py = 'baidupcs_py.app:main'
4840

41+
[tool.poetry.dev-dependencies]
42+
pytest = "^7.1.2"
43+
mypy = "^0.971"
44+
black = "^22.6.0"
45+
setuptools = "^63.4.0"
46+
Cython = "^0.29.32"
4947
[build-system]
5048
requires = ["poetry-core>=1.0.0", "cython", "wheel", "setuptools"]
5149
build-backend = "poetry.core.masonry.api"

tests/test_common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ def test_chunkio():
392392

393393

394394
def test_u64_u8x8():
395-
i = 2 ** 32
395+
i = 2**32
396396
b = u64_to_u8x8(i)
397397
x = u8x8_to_u64(b)
398398
assert i == x

0 commit comments

Comments
 (0)