aboutsummaryrefslogtreecommitdiff
path: root/src/uploader.py
diff options
context:
space:
mode:
authorgabrielgio <gabriel.giovanini@pm.me>2021-07-14 21:47:48 +0200
committergabrielgio <gabriel.giovanini@pm.me>2021-07-14 21:47:48 +0200
commit417fb93a9368057e85e4c8bbaabc2ae5aca123d3 (patch)
treec41889fa5f1d7835d933b4a937ffc43e07344e58 /src/uploader.py
parent4d43e402b2b4e27bbbbfe557216d95963a27af72 (diff)
downloadreddit-nextcloud-importer-417fb93a9368057e85e4c8bbaabc2ae5aca123d3.tar.gz
reddit-nextcloud-importer-417fb93a9368057e85e4c8bbaabc2ae5aca123d3.tar.bz2
reddit-nextcloud-importer-417fb93a9368057e85e4c8bbaabc2ae5aca123d3.zip
fix: Fix pathing
The module imports aren't working.
Diffstat (limited to 'src/uploader.py')
-rw-r--r--src/uploader.py19
1 files changed, 0 insertions, 19 deletions
diff --git a/src/uploader.py b/src/uploader.py
deleted file mode 100644
index 7c7641a..0000000
--- a/src/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)