From 64d79c0a29c900ee604d35147dc608aaa120383c Mon Sep 17 00:00:00 2001 From: Vadzim Hushchanskou Date: Mon, 25 Nov 2024 10:14:10 +0300 Subject: [PATCH] Small refactoring --- app/commons/object_saving/filesystem_saver.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/commons/object_saving/filesystem_saver.py b/app/commons/object_saving/filesystem_saver.py index d01718b3..de296dff 100644 --- a/app/commons/object_saving/filesystem_saver.py +++ b/app/commons/object_saving/filesystem_saver.py @@ -47,7 +47,7 @@ def put_project_object(self, data: Any, path: str, object_name: str, using_json: filename = unify_path_separator(os.path.join(self._base_path, path, object_name)) if folder_to_save: os.makedirs(folder_to_save, exist_ok=True) - with open(filename, "wb") as f: + with open(filename, 'wb') as f: if using_json: f.write(json.dumps(data).encode('utf-8')) else: @@ -59,7 +59,7 @@ def get_project_object(self, path: str, object_name: str, using_json: bool = Fal filename = unify_path_separator(os.path.join(self._base_path, path, object_name)) if not utils.validate_file(filename): raise ValueError(f'Unable to get file: {filename}') - with open(filename, "rb") as f: + with open(filename, 'rb') as f: return json.loads(f.read()) if using_json else pickle.load(f) def does_object_exists(self, path: str, object_name: str) -> bool: