From c4925ae7db6704ca440a6bf3bc3195e0262d7722 Mon Sep 17 00:00:00 2001 From: Unrud Date: Tue, 19 May 2020 07:25:21 +0200 Subject: Update for Radicale 3.0.x --- radicale_infcloud/__init__.py | 45 ++++++++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 20 deletions(-) (limited to 'radicale_infcloud') diff --git a/radicale_infcloud/__init__.py b/radicale_infcloud/__init__.py index 7f1b3ea..8dc04df 100644 --- a/radicale_infcloud/__init__.py +++ b/radicale_infcloud/__init__.py @@ -1,5 +1,5 @@ # RadicaleWeb web interface for Radicale. -# Copyright (C) 2017 Unrud +# Copyright © 2017-2018, 2020 Unrud # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -15,18 +15,22 @@ # along with this program. If not, see . import os -import pkg_resources import posixpath import time - from http import client -from radicale import storage, web -from radicale.web import NOT_FOUND, MIMETYPES, FALLBACK_MIMETYPE +from radicale import httputils, pathutils +from radicale.log import logger +from radicale.web import internal +from radicale.web.internal import MIMETYPES, FALLBACK_MIMETYPE + +import pkg_resources + +PLUGIN_CONFIG_SCHEMA = {"web": {}} -class Web(web.Web): - def __init__(self, *args, **kwargs): - super().__init__(*args, **kwargs) +class Web(internal.Web): + def __init__(self, configuration): + super().__init__(configuration.copy(PLUGIN_CONFIG_SCHEMA)) self.infcloud_folder = pkg_resources.resource_filename(__name__, "web") def get(self, environ, base_prefix, path, user): @@ -35,28 +39,29 @@ class Web(web.Web): user) if status == client.OK and path in ("/.web/", "/.web/index.html"): answer = answer.replace(b"""\ -