---
+++
@@ -27,13 +27,12 @@
from fnmatch import fnmatch
from optparse import OptionParser
import re
-from inspect import isclass
from Cheetah import NameMapper
from Cheetah.Compiler import DEFAULT_COMPILER_SETTINGS
from Cheetah.Template import Template
-from genconfig.config import GenConfig
+from genconfig.get_conf import getConf
USAGE = """
genconfig generate [options] <configuration_file> <output_directory> [<output_file1> ...]
@@ -202,40 +201,10 @@
import sys
sys.path.append(getcwd())
-try:
- mod = __import__(opt_conf_file)
-except Exception, e:
- print "Could not read configuration:"
- raise
-
-# Looking for a GenConfig instance
-for attr_name in dir(mod):
- if attr_name == 'GenConfig':
- continue
- attr = getattr(mod, attr_name)
- if not isclass(attr):
- continue
-
- top_class = True
- for _attr_name in dir(mod):
- if _attr_name == attr_name:
- continue
- if not isclass(getattr(mod, _attr_name)):
- continue
- if not issubclass(attr, getattr(mod, _attr_name)):
- top_class = False
- break
-
- if not top_class:
- continue
-
- if issubclass(attr, GenConfig):
- conf = attr()
- break
-else:
+conf = getConf(opt_conf_file)
+if conf is None:
print "Could not find a GenConfig heriting class"
exit(1)
-
templates = {}
for p in conf.config_paths:
Generated with KisssPM