|
@@ -1,7 +1,7 @@
|
|
|
from pathlib import Path
|
|
|
from typing import Optional, Union
|
|
|
|
|
|
-from .. import globals
|
|
|
+from .. import globals, helpers
|
|
|
|
|
|
|
|
|
def download(src: Union[str, Path], filename: Optional[str] = None) -> None:
|
|
@@ -9,9 +9,9 @@ def download(src: Union[str, Path], filename: Optional[str] = None) -> None:
|
|
|
|
|
|
Function to trigger the download of a file.
|
|
|
|
|
|
- :param src: target URL or local filename which should be downloaded
|
|
|
+ :param src: target URL or local path of the file which should be downloaded
|
|
|
:param filename: name of the file to download (default: name of the file on the server)
|
|
|
"""
|
|
|
- if Path(src).is_file():
|
|
|
+ if helpers.is_file(src):
|
|
|
src = globals.app.add_static_file(local_file=src)
|
|
|
globals.get_client().download(src, filename)
|