From df781c1058e8827b2113bf2e4f7555f522766f67 Mon Sep 17 00:00:00 2001 From: Giulio Date: Tue, 22 May 2018 11:40:12 +0200 Subject: [PATCH] Basic webdav support --- apkdroid.py | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/apkdroid.py b/apkdroid.py index a8c68e6..d3c6b76 100644 --- a/apkdroid.py +++ b/apkdroid.py @@ -3,6 +3,13 @@ import logging import re import os import shutil +import webdav.client as wc + +davoptions = { + 'webdav_hostname': "https://fdroid.lsd.cat", + 'webdav_login': "login", + 'webdav_password': "password" +} repo_url = "https://fdroid.lsd.cat" repo_name = "lsd.cat Proprietary Apps Repo" @@ -80,8 +87,17 @@ def check_env(repo): def build(repo): os.system('fdroid update -c') +def publish(repo, davoptions): + client = wc.Client(davoptions) + files = [f for f in os.listdir('.') if os.path.isfile(f)] + for file in files: + client.upload_sync(remote_path="/" + file, local_path=file) -check_env(repo) -for i in urls: - get_apk(i) -build(repo) \ No newline at end of file +def main(): + check_env(repo) + for url in urls: + get_apk(url) + build(repo) + publish(repo, davoptions) + +main() \ No newline at end of file