Skip to content

Commit

Permalink
directory fix and version upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
jpulidojr committed May 6, 2024
1 parent e15468e commit fda81cb
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dsi/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.5"
__version__ = "1.0"
8 changes: 8 additions & 0 deletions dsi/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions examples/datasync/datacopy.py
Original file line number Diff line number Diff line change
@@ -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")
Expand Down

0 comments on commit fda81cb

Please sign in to comment.