diff piecrust/environment.py @ 12:30a42341cfa8

Define page slugs properly, avoid recursions with debug data.
author Ludovic Chabant <ludovic@chabant.com>
date Mon, 18 Aug 2014 16:49:54 -0700
parents f485ba500df3
children 43091c9837bf
line wrap: on
line diff
--- a/piecrust/environment.py	Mon Aug 18 16:47:44 2014 -0700
+++ b/piecrust/environment.py	Mon Aug 18 16:49:54 2014 -0700
@@ -53,6 +53,12 @@
     def is_main_page(self):
         return len(self._page_stack) == 1
 
+    def hasPage(self, page):
+        for ei in self._page_stack:
+            if ei.page == page:
+                return True
+        return False
+
     def pushPage(self, page, phase, render_ctx):
         self._page_stack.append(ExecutionInfo(page, phase, render_ctx))