Skip to content
Snippets Groups Projects
Commit 40906944 authored by Marvin Winkens's avatar Marvin Winkens
Browse files

restructure code and add jupyter notebook

parent 698fdf54
No related branches found
No related tags found
No related merge requests found
fingerhuete_*/ fingerhuete_*/
__pycache__ __pycache__
.idea .idea
.eudat-key
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)
......
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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment