From 3f8f30f6b5c67742a5f86e8ce65555106d4a775a Mon Sep 17 00:00:00 2001 From: Lakshmi Vyasarajan Date: Mon, 14 Mar 2011 10:23:28 +0530 Subject: [PATCH] Changed -i to -r - performs incremental generation by default --- hyde/engine.py | 9 +++++++-- hyde/ext/plugins/meta.py | 6 +++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/hyde/engine.py b/hyde/engine.py index f631304..2cf3c76 100644 --- a/hyde/engine.py +++ b/hyde/engine.py @@ -70,7 +70,7 @@ class Engine(Application): help='The configuration used to generate the site') @store('-d', '--deploy-path', dest='deploy', default=None, help='Where should the site be generated?') - @true('-i', '--incremental', dest='incremental', default=False, + @true('-r', '--regen', dest='regen', default=False, help='Only process changed files') def gen(self, args): """ @@ -81,7 +81,12 @@ class Engine(Application): site = self.make_site(args.sitepath, args.config, args.deploy) from hyde.generator import Generator gen = Generator(site) - gen.generate_all(incremental=args.incremental) + incremental = True + if args.regen: + logger.info("Regenerating the site...") + incremental = False + + gen.generate_all(incremental=incremental) @subcommand('serve', help='Serve the website') @store('-a', '--address', default='localhost', dest='address', diff --git a/hyde/ext/plugins/meta.py b/hyde/ext/plugins/meta.py index d939c14..5f69d40 100644 --- a/hyde/ext/plugins/meta.py +++ b/hyde/ext/plugins/meta.py @@ -76,13 +76,13 @@ class MetaPlugin(Plugin): the resource. Load meta data by looking for the marker. Once loaded, remove the meta area from the text. """ - self.logger.info("Trying to load metadata from resource [%s]" % resource) + self.logger.debug("Trying to load metadata from resource [%s]" % resource) yaml_finder = re.compile( r"^\s*(?:---|===)\s*\n((?:.|\n)+?)\n\s*(?:---|===)\s*\n*", re.MULTILINE) match = re.match(yaml_finder, text) if not match: - self.logger.info("No metadata found in resource [%s]" % resource) + self.logger.debug("No metadata found in resource [%s]" % resource) data = {} else: text = text[match.end():] @@ -95,7 +95,7 @@ class MetaPlugin(Plugin): else: resource.meta.update(data) self.__update_standard_attributes__(resource) - self.logger.info("Successfully loaded metadata from resource [%s]" + self.logger.debug("Successfully loaded metadata from resource [%s]" % resource) return text or ' '