Skip to content

Commit

Permalink
add
Browse files Browse the repository at this point in the history
  • Loading branch information
farfun committed Dec 20, 2024
1 parent 5f3bdb8 commit c3c167d
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 4 deletions.
3 changes: 3 additions & 0 deletions logs/all.log
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
2024-12-20 14:01:14.904 |INFO | funbuild.core.core : core: 86 | funbuild | - fundrive build
2024-12-20 14:01:14.904 |INFO | funbuild.core.core : core: 74 | funbuild | - fundrive pull
2024-12-20 14:01:23.129 |INFO | funbuild.core.core : core: 78 | funbuild | - fundrive push
2024-12-20 15:10:44.414 |INFO | funbuild.core.core : core: 86 | funbuild | - fundrive build
2024-12-20 15:10:44.414 |INFO | funbuild.core.core : core: 74 | funbuild | - fundrive pull
2024-12-20 15:10:52.221 |INFO | funbuild.core.core : core: 78 | funbuild | - fundrive push
3 changes: 3 additions & 0 deletions logs/funbuild.log
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
2024-12-20 14:01:14.904 |INFO | funbuild.core.core : core: 86 | funbuild | - fundrive build
2024-12-20 14:01:14.904 |INFO | funbuild.core.core : core: 74 | funbuild | - fundrive pull
2024-12-20 14:01:23.129 |INFO | funbuild.core.core : core: 78 | funbuild | - fundrive push
2024-12-20 15:10:44.414 |INFO | funbuild.core.core : core: 86 | funbuild | - fundrive build
2024-12-20 15:10:44.414 |INFO | funbuild.core.core : core: 74 | funbuild | - fundrive pull
2024-12-20 15:10:52.221 |INFO | funbuild.core.core : core: 78 | funbuild | - fundrive push
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "fundrive"
version = "1.2.77"
version = "1.2.78"
description = "fundrive"
readme = "README.md"
requires-python = ">=3.8"
Expand Down
14 changes: 12 additions & 2 deletions src/fundrive/core/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,14 @@ def download_file(self, fid, local_dir, overwrite=False, *args, **kwargs) -> boo
raise NotImplementedError()

def download_dir(
self, fid, local_dir, recursion=True, overwrite=False, *args, **kwargs
self,
fid,
local_dir,
recursion=True,
overwrite=False,
ignore_filter=None,
*args,
**kwargs,
) -> bool:
"""
下载目录
Expand All @@ -117,14 +124,17 @@ def download_dir(
:param overwrite:
:param args:
:param kwargs:
:param ignore_filter
:return:
"""
if not self.exist(fid):
return False
if not os.path.exists(local_dir):
os.makedirs(local_dir, exist_ok=True)
for file in self.get_file_list(fid):
_drive_path = file["fid"]
if ignore_filter and ignore_filter(file.name):
continue
_drive_path = file.fid
self.download_file(
fid=file.fid, local_dir=local_dir, overwrite=overwrite, *args, **kwargs
)
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c3c167d

Please sign in to comment.