File tree 2 files changed +8
-2
lines changed
2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 6
6
Sequence ,
7
7
)
8
8
from functools import partial
9
+ import pathlib
9
10
import re
10
11
from typing import (
11
12
TYPE_CHECKING ,
@@ -71,7 +72,9 @@ class StylerRenderer:
71
72
Base class to process rendering a Styler with a specified jinja2 template.
72
73
"""
73
74
74
- loader = jinja2 .PackageLoader ("pandas" , "io/formats/templates" )
75
+ thisdir = pathlib .Path (__file__ ).parent .resolve ()
76
+ template_dir = thisdir / "templates"
77
+ loader = jinja2 .FileSystemLoader (template_dir )
75
78
env = jinja2 .Environment (loader = loader , trim_blocks = True )
76
79
template_html = env .get_template ("html.tpl" )
77
80
template_html_table = env .get_template ("html_table.tpl" )
Original file line number Diff line number Diff line change
1
+ import pathlib
1
2
from textwrap import (
2
3
dedent ,
3
4
indent ,
18
19
19
20
@pytest .fixture
20
21
def env ():
21
- loader = jinja2 .PackageLoader ("pandas" , "io/formats/templates" )
22
+ project_dir = pathlib .Path (__file__ ).parent .parent .parent .parent .parent .resolve ()
23
+ template_dir = project_dir / "io" / "formats" / "templates"
24
+ loader = jinja2 .FileSystemLoader (template_dir )
22
25
env = jinja2 .Environment (loader = loader , trim_blocks = True )
23
26
return env
24
27
You can’t perform that action at this time.
0 commit comments