From bb1cc6d3f4fcde36f26ec02b53592a57e401bae0 Mon Sep 17 00:00:00 2001 From: Jean Felder Date: Wed, 6 Mar 2024 11:55:41 +0100 Subject: [PATCH] collection_manager: Remove unused method get_html Its usage has been replaced by `get_collection` which does not need to render html. --- qgis_resource_sharing/collection_manager.py | 16 ---- .../template/collection_details.html | 87 ------------------- 2 files changed, 103 deletions(-) delete mode 100644 qgis_resource_sharing/resources/template/collection_details.html diff --git a/qgis_resource_sharing/collection_manager.py b/qgis_resource_sharing/collection_manager.py index 26afc860..9e29b049 100644 --- a/qgis_resource_sharing/collection_manager.py +++ b/qgis_resource_sharing/collection_manager.py @@ -16,8 +16,6 @@ from qgis_resource_sharing.utilities import ( SUPPORTED_RESOURCES_MAP, local_collection_path, - render_template, - resources_path, ) LOGGER = logging.getLogger("QGIS Resource Sharing") @@ -113,20 +111,6 @@ def get_resource_status(self, collection_id: str) -> str: return html - def get_html(self, collection_id): - """Return the details of a collection as HTML, given its id. - - :param collection_id: The id of the collection - :type collection_id: str - """ - resource_html = self.get_resource_status(collection_id) - config.COLLECTIONS[collection_id]["resources_html"] = resource_html - context = { - "resources_path": str(resources_path()), - "collection": config.COLLECTIONS[collection_id], - } - return render_template("collection_details.html", context) - def get_collection(self, collection_id: str) -> Dict[str, str]: """Return the details of a collection, given its id. diff --git a/qgis_resource_sharing/resources/template/collection_details.html b/qgis_resource_sharing/resources/template/collection_details.html deleted file mode 100644 index f5edf705..00000000 --- a/qgis_resource_sharing/resources/template/collection_details.html +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - {{ collection.name }} - - - - - - - - - -
- -
-

{{ collection.name }}

-
- -
- - - - - - - - - {% if collection.resources_html != 'Unknown before installation' %} - - - - {% endif %} - {% if collection.preview|length > 0 %} - - - - - {% endif %} - - - - {% if collection.license and collection.license != None %} - - - - - {% else %} - {% if collection.license_url and collection.license_url != None %} - - - - - {% endif %} - {% endif %} - - - - - - -
Description{{ collection.description }}
Tags{{ collection.tags }}
Resources{{ collection.resources_html }}
Preview{% if collection.preview|length > 1 %}s ({{ collection.preview|length }}){% endif %} - {% for preview in collection.preview %} - {% if loop.index > 1 %} -
- {% endif %} - - {% endfor %} -
URL{{ collection.repository_url }}
License{{ collection.license }} - {% if collection.license and collection.license_url != None %} - (read here) - {% endif %} -
License File - Read the license here -
Author{{ collection.author }}
E-mail{{ collection.author_email }}
- -
- -
- -