From 53d3a95af5b58cfa3242cef645f8d40c731a7d95 Mon Sep 17 00:00:00 2001 From: Unrud Date: Mon, 18 Apr 2022 23:45:34 +0200 Subject: Update for Radicale 3.1.6 --- radicale_infcloud/__init__.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'radicale_infcloud') diff --git a/radicale_infcloud/__init__.py b/radicale_infcloud/__init__.py index c65d03f..33815fc 100644 --- a/radicale_infcloud/__init__.py +++ b/radicale_infcloud/__init__.py @@ -18,8 +18,6 @@ from http import client from radicale import httputils from radicale.web import internal -import pkg_resources - PLUGIN_CONFIG_SCHEMA = {"web": { "infcloud_config": { "value": "", @@ -27,14 +25,15 @@ PLUGIN_CONFIG_SCHEMA = {"web": { 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): if path == "/.web/infcloud/" or path.startswith("/.web/infcloud"): - status, headers, answer = httputils.serve_folder( - self.infcloud_folder, base_prefix, path, "/.web/infcloud") + status, headers, answer = httputils.serve_resource( + "radicale_infcloud", "web", base_prefix, path, + "/.web/infcloud") else: status, headers, answer = super().get( environ, base_prefix, path, user) -- cgit