aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPjotr Prins2024-03-25 05:19:52 -0500
committerFrederick Muriuki Muriithi2024-09-12 07:29:20 -0500
commit02e9d4c0363e9bce0f866c702272c514378de98a (patch)
treecab1457dfb75afe0c5702ce993dee4b12b1e87e3
parent047df9c4a01f860f76c5c8c605780009e3e3ce03 (diff)
downloadgenenetwork3-02e9d4c0363e9bce0f866c702272c514378de98a.tar.gz
assert_paths_exist: make throw_error optional
-rw-r--r--gn3/fs_helpers.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/gn3/fs_helpers.py b/gn3/fs_helpers.py
index 6b0a00a..74e7ada 100644
--- a/gn3/fs_helpers.py
+++ b/gn3/fs_helpers.py
@@ -1,4 +1,5 @@
"""Procedures that operate on files/ directories"""
+import errno
import hashlib
import json
import os
@@ -9,9 +10,10 @@ import tarfile
from functools import partial
from typing import Dict
from typing import List
+from typing import ValuesView
from werkzeug.utils import secure_filename
-def assert_paths_exist(paths: ValuesView) -> bool:
+def assert_paths_exist(paths: ValuesView, throw_error: bool = True) -> bool:
"""Given a list of PATHS, throw error if any of them do not exist."""
for path in paths:
if not os.path.isfile(path):