config: Parse gives an error if file(s) not found
authorTimo Savola <tsavola@movial.fi>
Wed, 4 Jun 2008 08:22:43 +0000 (11:22 +0300)
committerTimo Savola <tsavola@movial.fi>
Wed, 4 Jun 2008 08:23:46 +0000 (11:23 +0300)
Parse(<pattern>, require=False) can be used to parse optional files.

matrix/config.py

index e3d162b..df4f21d 100644 (file)
@@ -65,7 +65,7 @@ def provide_component(name):
        c.cached = True
        return c
 
-def parse(pattern, required=False):
+def parse(pattern, require=True):
        if isabs(pattern):
                dirs = [None]
        else:
@@ -88,7 +88,7 @@ def parse(pattern, required=False):
 
        if not found:
                msg = 'Config file(s) not found: %s' % pattern
-               if required:
+               if require:
                        raise Error(msg)
                elif config.debug:
                        print msg