From c634b69443fb19250ac48dc8ca4a3c32ee188736 Mon Sep 17 00:00:00 2001 From: Holger Schurig Date: Thu, 13 Jan 2011 12:35:33 +0100 Subject: [PATCH] plugins/hierarchy: warn about orphan files Once all files are scanned, warn about files which don't have a parent. --- plugins/hierarchy.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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] -- 2.39.2