Skip to content
Snippets Groups Projects
Commit d2cba538 authored by Andri Joos's avatar Andri Joos :blush:
Browse files

fix nc bug

parent 8dc6852c
No related branches found
No related tags found
No related merge requests found
......@@ -24,7 +24,7 @@ def create_remote_path_if_not_exists(path: str, nc: Client):
for path_split in path_splits:
current_path = os.path.join(current_path, path_split)
if not exists_remote_path(current_path):
if not exists_remote_path(current_path, nc):
print("creating directory {}".format(current_path))
nc.mkdir(current_path)
......@@ -44,7 +44,7 @@ def upload(_in: str, out: str, server_address: str = None, username: str = None,
uploading_files = [f for f in files_and_directories if os.path.isfile(f)]
already_uploaded = []
if exists_remote_path(out):
if exists_remote_path(out, nc):
already_uploaded = nc.list(out, depth="infinity")
already_uploaded_files = [a.path for a in already_uploaded if not a.is_dir()]
......@@ -57,7 +57,7 @@ def upload(_in: str, out: str, server_address: str = None, username: str = None,
if remote_file_path not in already_uploaded_files:
remote_dir_path = os.path.dirname(remote_file_path)
create_remote_path_if_not_exists(remote_dir_path)
create_remote_path_if_not_exists(remote_dir_path, nc)
file_stats = os.stat(file_path)
file_size = humanize.naturalsize(file_stats.st_size)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment