Skip to content

Commit

Permalink
0.36.13:
Browse files Browse the repository at this point in the history
    1. alist版本支持到3.36.0
    2. 现在可以使用AlistPath(path, username="", password="", token="")的方式快速登录。
    3. 登录失败现在抛出异常。
    4. #3 Bugfix 为models中的全部可选字段添加默认值。
  • Loading branch information
lee-cq committed Aug 17, 2024
1 parent cc81958 commit a3b2e93
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,19 @@ client = AsyncClient(
asyncio.run(client.me())
```

像使用pathlib一样操作Alist上的文件,但是需要注意的是,AlistPath的方法都是同步的,如果需要异步操作,可以使用`asyncio.to_thread`将同步方法转为异步方法。
像使用pathlib一样操作Alist上的文件。
但是需要注意的是,AlistPath全部使用的同步方法(与Pathlib API保持一致)。
如果需要异步操作,可以使用`asyncio.to_thread`将同步方法转为异步方法。
```python
from alist_sdk.path_lib import login_server, AlistPath

# 登录方式1
login_server("http://localhost:5244", username='admin', password='123456')

path = AlistPath('http://localhost:5244/test')

# 登录方式2 version > 0.36.13
path = AlistPath('http://localhost:5244/test', username='admin', password='123456')

path.stat()
path.is_dir()
path.read_text()
Expand Down
3 changes: 2 additions & 1 deletion alist_sdk/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@
1. alist版本支持到3.36.0
2. 现在可以使用AlistPath(path, username="", password="", token="")的方式快速登录。
3. 登录失败现在抛出异常。
4. #3 Bugfix 为models中的全部可选字段添加默认值。
"""

__version__ = "0.36.13a3"
__version__ = "0.36.13a4"

ALIST_VERSION = "v3.36.0"

0 comments on commit a3b2e93

Please sign in to comment.