removing unnecessary method

This commit is contained in:
msramalho
2022-06-08 11:46:00 +02:00
parent f0a276e3a5
commit 6dcb59fea6
2 changed files with 2 additions and 8 deletions

View File

@@ -22,9 +22,3 @@ class Storage(ABC):
logger.debug(f'[{self.__class__.__name__}] uploading file {filename} with key {key}')
with open(filename, 'rb') as f:
self.uploadf(f, key, **kwargs)
#TODO: is this really necessary if only use os.path operations
def _clean_path(self, folder, default="", add_forward_slash=True):
if folder is None or type(folder) != str or len(folder.strip()) == 0:
return default
return str(Path(folder)) + ("/" if add_forward_slash else "")

View File

@@ -13,8 +13,8 @@ class LocalConfig:
class LocalStorage(Storage):
def __init__(self, config:LocalConfig):
self.folder = self._clean_path(config.folder)
self.save_to = self._clean_path(config.save_to)
self.folder = config.folder
self.save_to = config.save_to
mkdir_if_not_exists(self.save_to)
def get_cdn_url(self, key):