Mercurial > piecrust2
diff piecrust/chefutil.py @ 120:133845647083
Better error management and removal support in baking/processing.
* Baker and processor pipeline now store errors in their records.
* They also support deleting output files that are no longer valid.
* The basic transitional record class implements more boilerplate code.
* The processor pipeline is run from the `bake` command directly.
* New unit tests.
* Unit test mocking now mocks `os.remove` too.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sun, 09 Nov 2014 14:46:23 -0800 |
parents | 8703be118430 |
children | a561fbad0b7f |
line wrap: on
line diff
--- a/piecrust/chefutil.py Wed Oct 29 08:19:58 2014 -0700 +++ b/piecrust/chefutil.py Sun Nov 09 14:46:23 2014 -0800 @@ -2,12 +2,13 @@ from colorama import Fore -def format_timed(start_time, message, colored=True): +def format_timed(start_time, message, indent_level=0, colored=True): end_time = time.clock() + indent = indent_level * ' ' time_str = '%8.1f ms' % ((end_time - start_time) * 1000.0) if colored: return '[%s%s%s] %s' % (Fore.GREEN, time_str, Fore.RESET, message) - return '[%s] %s' % (time_str, message) + return '%s[%s] %s' % (indent, time_str, message) def log_friendly_exception(logger, ex):