Skip to content

Commit 68ae6a1

Browse files
committed
allow to check if depenencies exist without downloading them
1 parent 44e6a87 commit 68ae6a1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

open_fortran_parser/dependencies.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
def ensure_dependencies(
1616
dependencies: t.Mapping[str, t.Tuple[urllib.parse.ParseResult, pathlib.Path]],
17-
target_dir: pathlib.Path, silent: bool = False) -> None:
17+
target_dir: pathlib.Path, download: bool = True, silent: bool = False) -> None:
1818
"""Download missing depenedencies."""
1919
if not target_dir.exists():
2020
_LOG.warning('Creating directory "%s"...', target_dir)
@@ -24,6 +24,9 @@ def ensure_dependencies(
2424
if path.is_file():
2525
_LOG.warning('%s is present already.', dependency)
2626
continue
27+
if not download:
28+
_LOG.warning('%s is not present!', dependency)
29+
continue
2730
url = urllib.parse.urlunparse(url_root) + str(filename)
2831
_LOG.warning('Downloading %s from URL "%s" to path "%s"...', dependency, url, path)
2932
wget.download(url, str(path), bar=None if silent else wget.bar_adaptive)

0 commit comments

Comments
 (0)