Skip to content

Commit

Permalink
utilities: Remove unused function render_template
Browse files Browse the repository at this point in the history
This was used when a QWebView was used to display a collection
information. This is not the case anymore.
  • Loading branch information
ptitjano committed Mar 6, 2024
1 parent e4e48a3 commit c3f4a6c
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions qgis_resource_sharing/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import ntpath
from pathlib import Path

import jinja2
from ext_libs.pathvalidate import sanitize_filename
from qgis.core import Qgis, QgsApplication, QgsSettings
from qgis.PyQt.QtCore import QDir
Expand Down Expand Up @@ -161,19 +160,3 @@ def qgis_version():
version = str(Qgis.QGIS_VERSION_INT)
version = int(version)
return version


def render_template(filename, context) -> dict:
"""Render a template with the specified filename.
:param filename: The filename (must be in the template directory)
:type filename: str
:param context: The context passed for the template
:type context: dict
"""
path = DIR_PLUGIN_ROOT / "resources" / "template"
return (
jinja2.Environment(loader=jinja2.FileSystemLoader(str(path)))
.get_template(filename)
.render(context)
)

0 comments on commit c3f4a6c

Please sign in to comment.