From: Holger Schurig Date: Thu, 13 Jan 2011 11:35:33 +0000 (+0100) Subject: plugins/hierarchy: warn about orphan files X-Git-Url: https://oss.titaniummirror.com/gitweb?p=webber.git;a=commitdiff_plain;h=c634b69443fb19250ac48dc8ca4a3c32ee188736 plugins/hierarchy: warn about orphan files Once all files are scanned, warn about files which don't have a parent. --- diff --git a/plugins/hierarchy.py b/plugins/hierarchy.py index 5217e24..01994ac 100644 --- a/plugins/hierarchy.py +++ b/plugins/hierarchy.py @@ -72,8 +72,19 @@ def scan_done(params): # 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]