diff --git a/dsi/_version.py b/dsi/_version.py index ecf384a..f5fe964 100644 --- a/dsi/_version.py +++ b/dsi/_version.py @@ -1 +1 @@ -__version__ = "0.5" \ No newline at end of file +__version__ = "1.0" \ No newline at end of file diff --git a/dsi/core.py b/dsi/core.py index 6ea5d65..9c131c2 100644 --- a/dsi/core.py +++ b/dsi/core.py @@ -4,6 +4,7 @@ from itertools import product import os import shutil +from pathlib import Path from dsi.backends.filesystem import Filesystem from dsi.backends.sqlite import Sqlite, DataType, Artifact @@ -346,6 +347,13 @@ def copy(self, local_loc, remote_loc, isVerbose=False): # Data movement # Future: have movement service handle type (cp,scp,ftp,rsync,etc.) for file,file_remote in zip(file_list,rfile_list): + abspath = os.path.dirname(os.path.abspath(file_remote)) + if not os.path.exists(abspath): + if isVerbose: + print( " mkdir " + abspath) + path = Path(abspath) + path.mkdir(parents=True) + if isVerbose: print( " cp " + file + " " + file_remote) shutil.copyfile(file , file_remote) diff --git a/examples/datasync/datacopy.py b/examples/datasync/datacopy.py index 9d8cee4..db348b0 100644 --- a/examples/datasync/datacopy.py +++ b/examples/datasync/datacopy.py @@ -1,9 +1,9 @@ from dsi.core import Sync #Origin -local_files = "H:/Data/shaped2d/" +local_files = "H:/Data/Scratch/shaped2d/" #Remote -remote_path = "C:/tmp/" +remote_path = "H:/tmp/" # Create Sync type with project name s = Sync("shape2d")