Mercurial > piecrust2
changeset 721:234d0c7c02cf
bake: Add the timestamp of the page to each record entry.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sun, 29 May 2016 20:15:30 -0700 |
parents | 3e188d88a9ac |
children | f0a3af3fbea2 |
files | piecrust/baking/baker.py piecrust/baking/records.py piecrust/baking/worker.py |
diffstat | 3 files changed, 5 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/piecrust/baking/baker.py Sat May 28 15:43:45 2016 -0700 +++ b/piecrust/baking/baker.py Sun May 29 20:15:30 2016 -0700 @@ -217,6 +217,7 @@ # than the last bake. record_entry = BakeRecordEntry(res['source_name'], res['path']) record_entry.config = res['config'] + record_entry.timestamp = res['timestamp'] if res['errors']: record_entry.errors += res['errors'] record.current.success = False
--- a/piecrust/baking/records.py Sat May 28 15:43:45 2016 -0700 +++ b/piecrust/baking/records.py Sun May 29 20:15:30 2016 -0700 @@ -16,7 +16,7 @@ class BakeRecord(Record): - RECORD_VERSION = 18 + RECORD_VERSION = 19 def __init__(self): super(BakeRecord, self).__init__() @@ -78,6 +78,7 @@ self.extra_key = extra_key self.flags = self.FLAG_NONE self.config = None + self.timestamp = None self.errors = [] self.subs = []
--- a/piecrust/baking/worker.py Sat May 28 15:43:45 2016 -0700 +++ b/piecrust/baking/worker.py Sun May 29 20:15:30 2016 -0700 @@ -134,11 +134,13 @@ 'source_name': fac.source.name, 'path': fac.path, 'config': None, + 'timestamp': None, 'errors': None} try: page = fac.buildPage() page._load() result['config'] = page.config.getAll() + result['timestamp'] = page.datetime.timestamp() except Exception as ex: logger.debug("Got loading error. Sending it to master.") result['errors'] = _get_errors(ex)