[sync] updated post events
This commit is contained in:
1 parent
10dd3d6316
commit
b98a809543
8 files changed
+41
-37
No files matched your search
@@ -38,6 +38,9 @@ class Provider:
|
||||
rel = os.path.relpath(path, self.root)
|
||||
return rel
|
||||
|
||||
def get_local(self, path):
|
||||
return path
|
||||
|
||||
def is_dir(self, path):
|
||||
return False
|
||||
|
||||
|
||||
@@ -44,3 +44,5 @@ class FSProvider(Provider):
|
||||
def is_dir(self, path):
|
||||
return os.path.isdir(self.get_abs(path))
|
||||
|
||||
def get_local(self, path):
|
||||
return self.get_abs(path)
|
||||
@@ -3,6 +3,8 @@ import os
|
||||
import re
|
||||
|
||||
import io
|
||||
from tempfile import mkstemp
|
||||
|
||||
import requests
|
||||
|
||||
from sync.data import Provider
|
||||
@@ -61,3 +63,8 @@ class YDProvider(Provider):
|
||||
def is_dir(self, path):
|
||||
res = self.api.get_content(self.get_abs(path))
|
||||
return res.type == 'dir'
|
||||
|
||||
def get_local(self, path):
|
||||
ext = os.path.splitext(path)[1]
|
||||
_, temp_in = mkstemp(suffix=ext)
|
||||
return self.copy(path, temp_in)
|
||||
Reference in new issue
Block a user