diff 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
line wrap: on
line diff
--- a/piecrust/baking/single.py	Wed Mar 23 12:19:35 2016 -0700
+++ b/piecrust/baking/single.py	Wed Mar 23 16:39:22 2016 -0700
@@ -225,14 +225,14 @@
 def _get_dirty_source_names_and_render_passes(sub_entry, dirty_source_names):
     dirty_for_this = set()
     invalidated_render_passes = set()
-    assert sub_entry.render_info is not None
-    for p, pinfo in sub_entry.render_info.items():
-        for src_name in pinfo.used_source_names:
-            is_dirty = (src_name in dirty_source_names)
-            if is_dirty:
-                invalidated_render_passes.add(p)
-                dirty_for_this.add(src_name)
-                break
+    for p, pinfo in enumerate(sub_entry.render_info):
+        if pinfo:
+            for src_name in pinfo.used_source_names:
+                is_dirty = (src_name in dirty_source_names)
+                if is_dirty:
+                    invalidated_render_passes.add(p)
+                    dirty_for_this.add(src_name)
+                    break
     return dirty_for_this, invalidated_render_passes