updated the python parser to also understand _main.cfg and _final.cfg handling

This commit is contained in:
Elias Pschernig 2007-05-15 16:57:52 +00:00
parent d5581d1fdf
commit 889a614d21

View file

@ -288,6 +288,17 @@ class Parser:
# If it is a directory, parse all cfg files within.
if os.path.isdir(dirpath):
files = glob.glob(dirpath + "/*.cfg")
files.sort()
mc = dirpath + "/_main.cfg"
fc = dirpath + "/_final.cfg"
if mc in files:
# If there's a file called _main.cfg, only parse that.
files = [mc]
elif fc in files:
# If there's a file called _final.cfg, parse it only after
# all others.
files.remove(fc)
files.append(fc)
else:
files = [dirpath]
for path in files: