Browse Source

Add Node.rwalk support

Signed-off-by: Julien Danjou <julien@danjou.info>
main
Julien Danjou 12 years ago
parent
commit
d47707af6c
1 changed files with 10 additions and 0 deletions
  1. +10
    -0
      hyde/site.py

+ 10
- 0
hyde/site.py View File

@@ -192,6 +192,16 @@ class Node(Processable):
for node in child.walk():
yield node

def rwalk(self):
"""
Walk the node upward, first yielding itself then
yielding its parents.
"""
x = self
while x:
yield x
x = x.parent

def walk_resources(self):
"""
Walks the resources in this hierarchy.


Loading…
Cancel
Save