Skip to content

Commit 9edc0dc

Browse files
committed
added webdav-url argument
1 parent 3f73738 commit 9edc0dc

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Then registers them on the databus.
1515
cd databusclient
1616

1717
python deploy.py \
18+
--webdav-url https://cloud.scadsai.uni-leipzig.de/remote.php/webdav \
1819
--remote scads-nextcloud \
1920
--path test \
2021
--version-id https://databus.dbpedia.org/gg46ixav/test_group/test_artifact/2023-07-03 \

databusclient/deploy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ def deploy_to_databus(
6464

6565
def parse_args():
6666
parser = argparse.ArgumentParser(description="Upload files to Nextcloud and deploy to DBpedia Databus.")
67-
6867
parser.add_argument("files", nargs="+", help="Path(s) to file(s) or folder(s) to upload")
68+
parser.add_argument("--webdav-url", required=True, help="URL to webdav cloud(e.g., 'https://cloud.scadsai.uni-leipzig.de/remote.php/webdav')")
6969
parser.add_argument("--remote", required=True, help="rclone remote name (e.g., 'nextcloud')")
7070
parser.add_argument("--path", required=True, help="Remote path on Nextcloud (e.g., 'datasets/mydataset')")
7171
parser.add_argument("--version-id", required=True, help="Databus version URI")
@@ -80,7 +80,7 @@ def parse_args():
8080

8181
args = parse_args()
8282

83-
metadata = upload_to_nextcloud(args.files, args.remote, args.path)
83+
metadata = upload_to_nextcloud(args.files, args.remote, args.path, args.webdav_url)
8484

8585
deploy_to_databus(
8686
metadata,

nextcloudclient/upload.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
import subprocess
44
import posixpath
55

6-
BASE_URL = "https://cloud.scadsai.uni-leipzig.de"
7-
86
def compute_sha256_and_length(filepath):
97
sha256 = hashlib.sha256()
108
total_length = 0
@@ -26,7 +24,7 @@ def get_all_files(path):
2624
files.append(os.path.join(root, name))
2725
return files
2826

29-
def upload_to_nextcloud(source_paths: str, remote_name: str, remote_path: str):
27+
def upload_to_nextcloud(source_paths: str, remote_name: str, remote_path: str, webdav_url: str):
3028
result = []
3129
for path in source_paths:
3230
if not os.path.exists(path):
@@ -46,7 +44,7 @@ def upload_to_nextcloud(source_paths: str, remote_name: str, remote_path: str):
4644
else:
4745
remote_webdav_path = posixpath.join(remote_path, os.path.basename(file))
4846

49-
url = f"{BASE_URL}/remote.php/webdav/{remote_webdav_path}"
47+
url = posixpath.join(webdav_url,remote_webdav_path)
5048

5149
filename = file.split("/")[-1]
5250
result.append((filename, checksum, size, url))

0 commit comments

Comments
 (0)