Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
N
nctool
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Andri Joos
nctool
Commits
d2cba538
Commit
d2cba538
authored
1 year ago
by
Andri Joos
Browse files
Options
Downloads
Patches
Plain Diff
fix nc bug
parent
8dc6852c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
main.py
+3
-3
3 additions, 3 deletions
main.py
with
3 additions
and
3 deletions
main.py
+
3
−
3
View file @
d2cba538
...
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment