aboutsummaryrefslogtreecommitdiff
path: root/importer
diff options
context:
space:
mode:
authorGabriel Arakaki Giovanini <mail@gabrielgio.me>2022-08-29 22:24:22 +0200
committerGabriel Arakaki Giovanini <mail@gabrielgio.me>2022-08-29 22:24:22 +0200
commit61223f0d1a16904866283c13acacc1992b0c6d5f (patch)
tree631a7ceb5f6b57a883d949b454fdcc2ca83fb0af /importer
parentbd9588afd7f2c53363dfa83474ca8a258085739b (diff)
downloadreddit-nextcloud-importer-61223f0d1a16904866283c13acacc1992b0c6d5f.tar.gz
reddit-nextcloud-importer-61223f0d1a16904866283c13acacc1992b0c6d5f.tar.bz2
reddit-nextcloud-importer-61223f0d1a16904866283c13acacc1992b0c6d5f.zip
ref: move project to the write folder
Also update the dependencies
Diffstat (limited to 'importer')
-rw-r--r--importer/uploader.py19
1 files changed, 0 insertions, 19 deletions
diff --git a/importer/uploader.py b/importer/uploader.py
deleted file mode 100644
index 7c7641a..0000000
--- a/importer/uploader.py
+++ /dev/null
@@ -1,19 +0,0 @@
-from functools import reduce
-
-from nextcloud import NextCloud
-
-
-def _create_folder(folder: str, nxc: NextCloud) -> str:
- nxc.create_folder(folder, True)
- return folder
-
-
-def create_folders(path: str, nxc: NextCloud):
- # remove first "/" if there is one.
- path = path if path[0] != '/' else path[1:]
- folders = path.split("/")
- reduce(lambda x, y: _create_folder(f"{x}/{y}", nxc), folders, "")
-
-
-def upload_file(local_filename: str, remote_filename: str, nxc: NextCloud):
- nxc.upload_file(local_filename, remote_filename)