Skip to content

Commit 40a66f4

Browse files
authored
Use jinja2.PackageLoader instead FS (#4)
1 parent aaccda0 commit 40a66f4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pycli/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def __init__(self,
4747
descr: discription of your application
4848
global_opts: Options which will be parsed with all commands
4949
"""
50-
self.__messager = Messager(jinja2.FileSystemLoader("pycli/templates"))
50+
self.__messager = Messager()
5151
self.root_cmd = self.RootCommand(name, descr, self.opt_help)
5252
if global_opts:
5353
self.root_cmd.opts += global_opts

pycli/output.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ class Messager(object):
99
console: Console
1010
template_engine: jinja2.Environment
1111

12-
def __init__(self, templates: jinja2.BaseLoader) -> None:
12+
def __init__(self) -> None:
1313
self.console = Console()
14-
self.template_engine = jinja2.Environment(loader=templates)
14+
self.template_engine = jinja2.Environment(loader=jinja2.PackageLoader("pycli", "templates"))
1515

1616
def show_help(self, cmd: Command, cpath: list[str]):
1717
self.console.print(

0 commit comments

Comments
 (0)