Skip to content

Commit

Permalink
path_lib.AlistPath.write_* 支持as_task参数
Browse files Browse the repository at this point in the history
  • Loading branch information
lee-cq committed Feb 23, 2024
1 parent 766c6c6 commit b901f65
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
8 changes: 4 additions & 4 deletions alist_sdk/path_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,14 +309,14 @@ def read_bytes(self):
""""""
return self._client.get(self.as_download_uri()).content

def write_text(self, data: str):
def write_text(self, data: str, as_task=False):
""""""
return self.write_bytes(data.encode())
return self.write_bytes(data.encode(), as_task=as_task)

def write_bytes(self, data: bytes):
def write_bytes(self, data: bytes, as_task=False):
""""""

_res = self._client.upload_file_put(data, self.as_posix(), False)
_res = self._client.upload_file_put(data, self.as_posix(), as_task=as_task)
if _res.code == 200:
return self.stat()
return None
9 changes: 8 additions & 1 deletion alist_sdk/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
__version__ = "0.30.3"
"""
0.30.4:
path_lib.AlistPath.write_* 支持as_task参数
"""

__version__ = "0.30.4"

ALIST_VERSION = "v3.30.0"

0 comments on commit b901f65

Please sign in to comment.