Skip to content

Commit

Permalink
bugix
Browse files Browse the repository at this point in the history
  • Loading branch information
knowsuchagency committed Jul 2, 2017
1 parent f9986f6 commit 363eea3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ninjadog/ext/pyramid.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,13 @@ def remove_file_if_exists(file: Path) -> True:


class PugRendererFactory:
template_cache = {}

def __init__(self, info):
self.reload = info.settings['reload_all'] or info.settings['reload_templates']
self.cached = truth(info.settings.get('ninjadog.cache', False))

self.template_path = resolve(info.name, info.package)
self.template_cache = {}

def __call__(self, value, system):
if not isinstance(value, dict): raise ValueError('view must return dict')
Expand All @@ -97,9 +98,8 @@ def __call__(self, value, system):

if self.reload:
template_text = self.template_path.read_text()
template_changed = changed(self.template_cache, self.template_path, template_text)
if not template_changed:
print(f"template {self.template_path} didn't change")
template_changed = changed(PugRendererFactory.template_cache,
self.template_path, template_text)

if (not html_file.exists()) or (self.reload and template_changed):
html = render(file=self.template_path, context=context, with_jinja=True)
Expand Down

0 comments on commit 363eea3

Please sign in to comment.