Mercurial > piecrust2
diff piecrust/commands/builtin/info.py @ 163:6d23473fab41
sources: Add `chef sources` command to list page sources.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Thu, 01 Jan 2015 21:21:00 -0800 |
parents | c4b155b08b52 |
children | 4534ccbdd2a3 |
line wrap: on
line diff
--- a/piecrust/commands/builtin/info.py Thu Jan 01 21:10:46 2015 -0800 +++ b/piecrust/commands/builtin/info.py Thu Jan 01 21:21:00 2015 -0800 @@ -49,6 +49,22 @@ ctx.result = 1 +class ShowSourcesCommand(ChefCommand): + def __init__(self): + super(ShowSourcesCommand, self).__init__() + self.name = 'sources' + self.description = "Shows the sources defined for this website." + + def setupParser(self, parser, app): + pass + + def run(self, ctx): + for src in ctx.app.sources: + logger.info("%s:" % src.name) + logger.info(" type: %s" % src.config.get('type')) + logger.info(" class: %s" % type(src)) + + class ShowRoutesCommand(ChefCommand): def __init__(self): super(ShowRoutesCommand, self).__init__()