Browse Source

resource compare implementation

main
Jordi Llonch 9 years ago
parent
commit
d53cf4d996
1 changed files with 8 additions and 2 deletions
  1. +8
    -2
      hyde/site.py

+ 8
- 2
hyde/site.py View File

@@ -45,6 +45,12 @@ class Processable(object):
def __repr__(self):
return self.path

def __lt__(self, other):
return self.source.path < other.source.path

def __gt__(self, other):
return self.source.path > other.source.path

@property
def path(self):
"""
@@ -188,7 +194,7 @@ class Node(Processable):
yielding the child nodes depth-first.
"""
yield self
for child in self.child_nodes:
for child in sorted([node for node in self.child_nodes]):
for node in child.walk():
yield node

@@ -207,7 +213,7 @@ class Node(Processable):
Walks the resources in this hierarchy.
"""
for node in self.walk():
for resource in node.resources:
for resource in sorted([resource for resource in node.resources]):
yield resource

@property


Loading…
Cancel
Save