refactor(synctool): 改进同步方案

This commit is contained in:
2025-12-21 21:18:31 +08:00
parent d4dce68449
commit 56038afefe
5 changed files with 25 additions and 486 deletions

View File

@@ -2,4 +2,15 @@
得益于 FSSpec, 无需实现大部分虚拟文件系统的 Providers
"""
import fsspec
from pathlib import Path
import fsspec as fs
class VFSObject():
def __init__(self, protocol, base_url):
self.base_url = base_url
self.protocol = protocol
self.fs = fs.filesystem(protocol=protocol, base_url = base_url)
def open(self, path: Path):
return self.fs.open(path)
def open_by_list(self, path_list: list[Path]):
return self.fs.open_files(path_list)