Check if a commandline specified configdir exists, error if it doesn't
authorDaniel Bainton <daniel.bainton@movial.fi>
Mon, 16 Mar 2009 12:13:05 +0000 (14:13 +0200)
committerDaniel Bainton <daniel.bainton@movial.fi>
Mon, 16 Mar 2009 12:13:05 +0000 (14:13 +0200)
matrix/config.py

index 954fc38..8339ded 100644 (file)
@@ -1,6 +1,7 @@
-# Copyright (C) 2007-2008 Movial Creative Technologies Inc.
-# Authors: Timo Savola <tsavola@movial.fi>
+# Copyright (C) 2007-2009 Movial Creative Technologies Inc.
+# Authors: Timo Savola
 #          Kalle Vahlman <kalle.vahlman@movial.fi>
+#          Daniel Bainton <daniel.bainton@movial.fi>
 
 import re
 from glob import glob
@@ -115,6 +116,8 @@ def parse(pattern, require=True):
        found = False
 
        for dir in dirs:
+               if (dir != "" and not exists(dir)):
+                       raise Error("ConfigDir '" + dir + "' not found")
                for path in glob(join(dir, pattern)):
                        if exclude.match(basename(path)):
                                continue