mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
fs: move NoDirectoriesMixin to http filesystem
This commit is contained in:
committed by
Saugat Pachhai
parent
b4dcadbc9c
commit
c0580c740b
@@ -198,21 +198,3 @@ class ObjectFSWrapper(FSSpecWrapper):
|
||||
return None
|
||||
|
||||
yield from files
|
||||
|
||||
|
||||
# pylint: disable=arguments-differ
|
||||
class NoDirectoriesMixin:
|
||||
def isdir(self, *args, **kwargs):
|
||||
return False
|
||||
|
||||
def isfile(self, *args, **kwargs):
|
||||
return True
|
||||
|
||||
def find(self, *args, **kwargs):
|
||||
raise NotImplementedError
|
||||
|
||||
def walk(self, *args, **kwargs):
|
||||
raise NotImplementedError
|
||||
|
||||
def ls(self, *args, **kwargs):
|
||||
raise NotImplementedError
|
||||
|
||||
+21
-2
@@ -7,7 +7,7 @@ from dvc import prompt
|
||||
from dvc.scheme import Schemes
|
||||
|
||||
from ._callback import DEFAULT_CALLBACK
|
||||
from .fsspec_wrapper import AnyFSPath, FSSpecWrapper, NoDirectoriesMixin
|
||||
from .fsspec_wrapper import AnyFSPath, FSSpecWrapper
|
||||
|
||||
|
||||
@wrap_with(threading.Lock())
|
||||
@@ -33,7 +33,7 @@ def make_context(ssl_verify):
|
||||
|
||||
|
||||
# pylint: disable=abstract-method
|
||||
class HTTPFileSystem(NoDirectoriesMixin, FSSpecWrapper):
|
||||
class HTTPFileSystem(FSSpecWrapper):
|
||||
scheme = Schemes.HTTP
|
||||
PARAM_CHECKSUM = "checksum"
|
||||
REQUIRES = {"aiohttp": "aiohttp", "aiohttp-retry": "aiohttp_retry"}
|
||||
@@ -148,3 +148,22 @@ class HTTPFileSystem(NoDirectoriesMixin, FSSpecWrapper):
|
||||
) -> None:
|
||||
kwargs.setdefault("method", self.upload_method)
|
||||
super().put_file(from_file, to_info, callback=callback, **kwargs)
|
||||
|
||||
# pylint: disable=arguments-differ
|
||||
|
||||
def find(self, *args, **kwargs):
|
||||
raise NotImplementedError
|
||||
|
||||
def isdir(self, *args, **kwargs):
|
||||
return False
|
||||
|
||||
def isfile(self, *args, **kwargs):
|
||||
return True
|
||||
|
||||
def ls(self, *args, **kwargs):
|
||||
raise NotImplementedError
|
||||
|
||||
def walk(self, *args, **kwargs):
|
||||
raise NotImplementedError
|
||||
|
||||
# pylint: enable=arguments-differ
|
||||
|
||||
Reference in New Issue
Block a user