Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Connecting B2DROP for HPC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Marvin Winkens
Connecting B2DROP for HPC
Commits
40906944
Commit
40906944
authored
2 years ago
by
Marvin Winkens
Browse files
Options
Downloads
Patches
Plain Diff
restructure code and add jupyter notebook
parent
698fdf54
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
b2drop-webdav.ipynb
+0
-0
0 additions, 0 deletions
b2drop-webdav.ipynb
fingerhuete.py
+11
-5
11 additions, 5 deletions
fingerhuete.py
webdavsync.py
+12
-9
12 additions, 9 deletions
webdavsync.py
with
24 additions
and
14 deletions
.gitignore
+
1
−
0
View file @
40906944
fingerhuete_*/
fingerhuete_*/
__pycache__
__pycache__
.idea
.idea
.eudat-key
This diff is collapsed.
Click to expand it.
b2drop-webdav.ipynb
0 → 100644
+
0
−
0
View file @
40906944
This diff is collapsed.
Click to expand it.
fingerhuete.py
+
11
−
5
View file @
40906944
from
rembg
import
remove
from
rembg
import
remove
from
webdavsync
import
pull
,
push
,
get_info
,
list_b2drop
from
webdavsync
import
pull
,
push
,
get_info
,
list_b2drop
,
connect_webdav_b2drop
from
rembg
import
remove
as
remove_bg
from
rembg
import
remove
as
remove_bg
import
os
import
os
import
threading
import
threading
...
@@ -60,11 +60,17 @@ def push_data():
...
@@ -60,11 +60,17 @@ def push_data():
time
.
sleep
(
60
)
# sleep for a minute
time
.
sleep
(
60
)
# sleep for a minute
def
main
():
def
main
():
# b2drop_list = list_b2drop()
username
=
"
1686b184-4d7a-45ba-8cba-4c8aef619886
"
# for el in b2drop_list:
try
:
# print(el["path"])
f
=
open
(
"
.eudat-key
"
,
"
r
"
)
except
OSError
as
e
:
print
(
e
)
print
(
"
Make sure the file .eudat-key does exist and contains your B2DROP key
"
)
webdav_pw
=
f
.
read
()
f
.
close
()
connect_webdav_b2drop
(
username
,
webdav_pw
)
t1
=
threading
.
Thread
(
target
=
pull_data
)
t1
=
threading
.
Thread
(
target
=
pull_data
)
t2
=
threading
.
Thread
(
target
=
process
,
args
=
(
local_path_in
,
local_path_out
))
t2
=
threading
.
Thread
(
target
=
process
,
args
=
(
local_path_in
,
local_path_out
))
t3
=
threading
.
Thread
(
target
=
push_data
)
t3
=
threading
.
Thread
(
target
=
push_data
)
...
...
This diff is collapsed.
Click to expand it.
webdavsync.py
+
12
−
9
View file @
40906944
from
webdav3.client
import
Client
from
webdav3.client
import
Client
username
=
"
1686b184-4d7a-45ba-8cba-4c8aef619886
"
client
:
Client
def
connect_webdav_b2drop
(
username
,
webdav_pw
):
global
client
options
=
{
options
=
{
'
webdav_hostname
'
:
f
"
https://b2drop.eudat.eu/remote.php/dav/files/
{
username
}
"
,
'
webdav_hostname
'
:
f
"
https://b2drop.eudat.eu/remote.php/dav/files/
{
username
}
"
,
'
webdav_login
'
:
username
,
'
webdav_login
'
:
username
,
'
webdav_password
'
:
"
CYFfS-Ff7FG-yke27-XkjTe-dWJrw
"
,
'
webdav_password
'
:
webdav_pw
,
'
verbose
'
:
True
,
'
verbose
'
:
True
,
'
webdav_timeout
'
:
60
*
4
,
# 10 minutes
'
webdav_timeout
'
:
60
*
4
,
# 10 minutes
}
}
client
=
Client
(
options
)
client
=
Client
(
options
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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