# And now sort by priority. Since Python 2.2 and upwards has stable-sort,
# this effectively makes a two-dimensional sort.
_childs[c].sort(key = lambda x: x[0])
- return
+ visited = {}
+ visited[get_file_for("Home")] = True
+ for f in _parent:
+ visited[f] = True
+ for f in files:
+ file = files[f]
+ if not file.has_key("linktitle"):
+ continue
+ if not visited.has_key(file ):
+ warning("orphan file '%s'" % f)
+
+ return
print "_parent:"
for c in _parent:
print " ", c, _parent[c]
def addPage(res, page):
#print "page:", page
res.append( (page, get_link_from(orig_page, page)) )
- if _childs.has_key(page.title):
- for c in _childs[page.title]:
- addPage(res, get_file_for(c[1]))
+ if _childs.has_key(page):
+ for c in _childs[page]:
+ addPage(res, c[1])
addPage(res, orig_page)
res.sort(cmp = lambda x,y: cmp(y[0].mtime, x[0].mtime))
return res[:max_items]