diff options
author | Unrud <unrud@outlook.com> | 2022-04-18 23:45:34 +0200 |
---|---|---|
committer | Unrud <unrud@outlook.com> | 2022-04-18 23:45:34 +0200 |
commit | 53d3a95af5b58cfa3242cef645f8d40c731a7d95 (patch) | |
tree | 3e2dda783f914abfb5441600064f22b0a75a4625 /radicale_infcloud/__init__.py | |
parent | Search web_data independent of working directory (diff) | |
download | radicaleinfcloud-53d3a95af5b58cfa3242cef645f8d40c731a7d95.tar.gz radicaleinfcloud-53d3a95af5b58cfa3242cef645f8d40c731a7d95.tar.bz2 radicaleinfcloud-53d3a95af5b58cfa3242cef645f8d40c731a7d95.zip |
Diffstat (limited to 'radicale_infcloud/__init__.py')
-rw-r--r-- | radicale_infcloud/__init__.py | 9 |
1 files changed, 4 insertions, 5 deletions
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) |