@@ -88,6 +88,7 @@ class Engine(Application): | |||||
incremental = False | incremental = False | ||||
gen.generate_all(incremental=incremental) | gen.generate_all(incremental=incremental) | ||||
logger.info("Generation complete.") | |||||
@subcommand('serve', help='Serve the website') | @subcommand('serve', help='Serve the website') | ||||
@store('-a', '--address', default='localhost', dest='address', | @store('-a', '--address', default='localhost', dest='address', | ||||
@@ -581,6 +581,13 @@ class Jinja2Template(Template): | |||||
if jinja2_filters: | if jinja2_filters: | ||||
jinja2_filters.register(self.env) | jinja2_filters.register(self.env) | ||||
def clear_caches(self): | |||||
""" | |||||
Clear all caches to prepare for regeneration | |||||
""" | |||||
if self.env.bytecode_cache: | |||||
self.env.bytecode_cache.clear() | |||||
def get_dependencies(self, path): | def get_dependencies(self, path): | ||||
""" | """ | ||||
@@ -190,6 +190,7 @@ class Generator(object): | |||||
""" | """ | ||||
logger.info("Reading site contents") | logger.info("Reading site contents") | ||||
self.load_template_if_needed() | self.load_template_if_needed() | ||||
self.template.clear_caches() | |||||
self.initialize() | self.initialize() | ||||
self.load_site_if_needed() | self.load_site_if_needed() | ||||
self.events.begin_site() | self.events.begin_site() | ||||
@@ -67,6 +67,12 @@ class Template(object): | |||||
""" | """ | ||||
return | return | ||||
def clear_caches(self): | |||||
""" | |||||
Clear all caches to prepare for regeneration | |||||
""" | |||||
return | |||||
def get_dependencies(self, text): | def get_dependencies(self, text): | ||||
""" | """ | ||||
Finds the dependencies based on the included | Finds the dependencies based on the included | ||||