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 | |
parent | Search web_data independent of working directory (diff) | |
download | radicaleinfcloud-53d3a95af5b58cfa3242cef645f8d40c731a7d95.tar.gz radicaleinfcloud-53d3a95af5b58cfa3242cef645f8d40c731a7d95.tar.bz2 radicaleinfcloud-53d3a95af5b58cfa3242cef645f8d40c731a7d95.zip |
-rw-r--r-- | radicale_infcloud/__init__.py | 9 | ||||
-rwxr-xr-x | setup.py | 4 |
2 files changed, 6 insertions, 7 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) @@ -4,7 +4,7 @@ import os from setuptools import setup -VERSION = "3.1.1" +VERSION = "3.1.6" package_path = os.path.join(os.path.dirname(__file__), "radicale_infcloud") web_data = sum(( @@ -23,4 +23,4 @@ setup( platforms="Any", packages=["radicale_infcloud"], package_data={"radicale_infcloud": web_data}, - install_requires=["radicale>=3.1.1"]) + install_requires=["radicale>=3.1.6"]) |