Skip to content

Commit 7ac6525

Browse files
author
Martin Journois
committed
add Plugin.env to load templates
1 parent 5ae326e commit 7ac6525

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

folium/plugins/plugin.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,17 @@
99
"""
1010
from uuid import uuid4
1111

12+
from jinja2 import Environment, PackageLoader
13+
ENV = Environment(loader=PackageLoader('folium', 'templates'))
14+
1215
class Plugin(object):
1316
"""Basic plugin object that does nothing.
1417
Other plugins may inherit from this one."""
1518
def __init__(self):
1619
"""Creates a plugin to append into a map with Map.add_plugin. """
1720
self.plugin_name = 'Plugin'
1821
self.object_name = uuid4().hex
22+
self.env = ENV
1923

2024
def add_to_map(self, map):
2125
"""Adds the plugin on a folium.map object."""

0 commit comments

Comments
 (0)