Phase 12 done... loading via adaptive collection, yadisk or local
This commit is contained in:
@@ -118,9 +118,10 @@ class _AdaptiveFile(ABC):
|
||||
local_path: str
|
||||
filename: str
|
||||
|
||||
def __init__(self, filename: str, extension: str):
|
||||
def __init__(self, filename: str, extension: str, local_path: str):
|
||||
self.filename = filename
|
||||
self.extension = extension
|
||||
self.local_path = local_path
|
||||
|
||||
# This method allows to work with file locally, and lambda should be provided for this.
|
||||
# Why separate method? For possible cleanup after work is done. And to download file, if needed
|
||||
@@ -138,11 +139,8 @@ class _AdaptiveCollection(ABC):
|
||||
|
||||
|
||||
class LocalFilesystemAdaptiveFile(_AdaptiveFile):
|
||||
local_path: str
|
||||
|
||||
def __init__(self, filename: str, extension: str, local_path: str):
|
||||
super().__init__(filename, extension)
|
||||
self.local_path = local_path
|
||||
super().__init__(filename, extension, local_path)
|
||||
|
||||
def work_with_file_locally(self, func: Callable[[str], None]):
|
||||
func(self.local_path)
|
||||
@@ -173,7 +171,7 @@ class YandexDiskAdaptiveFile(_AdaptiveFile):
|
||||
remote_path: str
|
||||
|
||||
def __init__(self, filename: str, extension: str, remote_path: str, token: str):
|
||||
super().__init__(filename, extension)
|
||||
super().__init__(filename, extension, remote_path)
|
||||
self.token = token
|
||||
self.remote_path = remote_path
|
||||
|
||||
|
||||
Reference in New Issue
Block a user