Browse Source

Changed -i to -r - performs incremental generation by default

main
Lakshmi Vyasarajan 13 years ago
parent
commit
3f8f30f6b5
2 changed files with 10 additions and 5 deletions
  1. +7
    -2
      hyde/engine.py
  2. +3
    -3
      hyde/ext/plugins/meta.py

+ 7
- 2
hyde/engine.py View File

@@ -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',


+ 3
- 3
hyde/ext/plugins/meta.py View File

@@ -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 ' '



Loading…
Cancel
Save