Mercurial > piecrust2
diff piecrust/commands/builtin/baking.py @ 192:4c0ab0b044fe
cosmetic: Fix some PEP8 issues.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sun, 11 Jan 2015 23:03:12 -0800 |
parents | bc63dc20baa0 |
children | c2acf5f31936 |
line wrap: on
line diff
--- a/piecrust/commands/builtin/baking.py Sun Jan 11 23:01:21 2015 -0800 +++ b/piecrust/commands/builtin/baking.py Sun Jan 11 23:03:12 2015 -0800 @@ -21,16 +21,20 @@ self.description = "Bakes your website into static HTML files." def setupParser(self, parser, app): - parser.add_argument('-o', '--output', + parser.add_argument( + '-o', '--output', help="The directory to put all the baked HTML files into " "(defaults to `_counter`)") - parser.add_argument('-f', '--force', + parser.add_argument( + '-f', '--force', help="Force re-baking the entire website.", action='store_true') - parser.add_argument('--portable', + parser.add_argument( + '--portable', help="Uses relative paths for all URLs.", action='store_true') - parser.add_argument('--no-assets', + parser.add_argument( + '--no-assets', help="Don't process assets (only pages).", action='store_true') @@ -53,8 +57,8 @@ self._bakeAssets(ctx, out_dir) # All done. - logger.info('-------------------------'); - logger.info(format_timed(start_time, 'done baking')); + logger.info('-------------------------') + logger.info(format_timed(start_time, 'done baking')) return 0 except Exception as ex: if ctx.app.debug: @@ -88,19 +92,21 @@ proc.run() - class ShowRecordCommand(ChefCommand): def __init__(self): super(ShowRecordCommand, self).__init__() self.name = 'showrecord' - self.description = "Shows the bake record for a given output directory." + self.description = ("Shows the bake record for a given output " + "directory.") def setupParser(self, parser, app): - parser.add_argument('-o', '--output', + parser.add_argument( + '-o', '--output', help="The output directory for which to show the bake record " "(defaults to `_counter`)", nargs='?') - parser.add_argument('-p', '--path', + parser.add_argument( + '-p', '--path', help="A pattern that will be used to filter the relative path " "of entries to show.") @@ -119,17 +125,18 @@ record = BakeRecord.load(record_cache.getCachePath(record_name)) logging.info("Bake record for: %s" % record.out_dir) logging.info("Last baked: %s" % - datetime.datetime.fromtimestamp(record.bake_time)) + datetime.datetime.fromtimestamp(record.bake_time)) logging.info("Entries:") for entry in record.entries: if pattern: - rel_path = os.path.relpath(entry.path, ctx.app.root_dir) if not fnmatch.fnmatch(entry.rel_path, pattern): continue logging.info(" - ") - logging.info(" path: %s" % entry.path) - logging.info(" spec: %s:%s" % (entry.source_name, entry.rel_path)) - logging.info(" taxonomy: %s:%s" % (entry.taxonomy_name, entry.taxonomy_term)) + logging.info(" path: %s" % entry.rel_path) + logging.info(" spec: %s:%s" % (entry.source_name, + entry.rel_path)) + logging.info(" taxonomy: %s:%s" % (entry.taxonomy_name, + entry.taxonomy_term)) logging.info(" config: %s" % entry.config) logging.info(" out URLs: %s" % entry.out_uris) logging.info(" out paths: %s" % entry.out_paths)