Skip to content

Commit

Permalink
0.30.11a3. UPDATE: 更新AplistPath.__repl__方法。
Browse files Browse the repository at this point in the history
  • Loading branch information
lee-cq committed Mar 3, 2024
1 parent 0997198 commit 117ffbf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
10 changes: 8 additions & 2 deletions alist_sdk/path_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
像使用Path一样的易于使用Alist中的文件
"""

import time
from functools import lru_cache, cached_property
from pathlib import Path
Expand Down Expand Up @@ -60,8 +61,8 @@ def login_server(
class PureAlistPath(PurePosixPath):
_flavour = alistpath

# def __get_pydantic_core_schema__(self, source_type: Any, handler):
# """"""
def __repr__(self):
return "{}({!r})".format(self.__class__.__name__, self.as_uri())

def is_absolute(self):
"""True if the path is absolute (has both a root and, if applicable,
Expand Down Expand Up @@ -96,6 +97,11 @@ def relative_to(self, other, /, *_deprecated, walk_up=False) -> str:
parts = [".."] * step + self._tail[len(path._tail) :]
return PurePosixPath(*parts).as_posix()

# def match(self, path_pattern, *, case_sensitive=True):
# _pps = path_pattern.split("**")
#
# return self._flavour.fnmatch(str(self), path_pattern, case_sensitive)


class AlistPath(PureAlistPath):
""""""
Expand Down
3 changes: 2 additions & 1 deletion alist_sdk/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@
0.30.11:
1. BUGFIX: 从其他站点导入配置时,数据模型错误。
2. BUGFIX: http://localhost:5244 无法正常识别
3. UPDATE: 更新AplistPath.__repl__方法
"""

__version__ = "0.30.11a2"
__version__ = "0.30.11a3"

ALIST_VERSION = "v3.31.0"

0 comments on commit 117ffbf

Please sign in to comment.