Mercurial > piecrust2
comparison piecrust/baking/single.py @ 698:33ab9badfd7a
render: Change how we store render passes info.
Previously we used a dictionary with integers as keys, which doesn't go well
with JSON serialization. Now replace with an array of fixed length with items
that are `None` by default.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Wed, 23 Mar 2016 16:39:22 -0700 |
parents | 59268b4d8c71 |
children | 3e4049022869 |
comparison
equal
deleted
inserted
replaced
697:9e5393fcfab2 | 698:33ab9badfd7a |
---|---|
223 | 223 |
224 | 224 |
225 def _get_dirty_source_names_and_render_passes(sub_entry, dirty_source_names): | 225 def _get_dirty_source_names_and_render_passes(sub_entry, dirty_source_names): |
226 dirty_for_this = set() | 226 dirty_for_this = set() |
227 invalidated_render_passes = set() | 227 invalidated_render_passes = set() |
228 assert sub_entry.render_info is not None | 228 for p, pinfo in enumerate(sub_entry.render_info): |
229 for p, pinfo in sub_entry.render_info.items(): | 229 if pinfo: |
230 for src_name in pinfo.used_source_names: | 230 for src_name in pinfo.used_source_names: |
231 is_dirty = (src_name in dirty_source_names) | 231 is_dirty = (src_name in dirty_source_names) |
232 if is_dirty: | 232 if is_dirty: |
233 invalidated_render_passes.add(p) | 233 invalidated_render_passes.add(p) |
234 dirty_for_this.add(src_name) | 234 dirty_for_this.add(src_name) |
235 break | 235 break |
236 return dirty_for_this, invalidated_render_passes | 236 return dirty_for_this, invalidated_render_passes |
237 | 237 |
238 | 238 |
239 def _ensure_dir_exists(path): | 239 def _ensure_dir_exists(path): |
240 try: | 240 try: |