def _load(name):
        if not exists(join(dirpath, '%s.py'%name.replace('.', '/'))):
            return
        try:
            mod = _import(name)
        except ImportError:
            logging.warning('ImportError %s'%name)
            import traceback
            logging.warning(traceback.format_exc())
            return

        if mod is None:
            return

        if mod in CONFIG_LOADED:
            CONFIG_LOADED.pop(CONFIG_LOADED.index(mod))
        CONFIG_LOADED.append(mod)

        mod.__file__.rsplit('.', 1)[0]

        prepare = getattr(mod, 'prepare', None)
        if prepare:
            prepare_list.append(prepare)

        finish = getattr(mod, 'finish', None)
        if finish:
            finish_list.append(finish)
Esempio n. 2
0
    def _load(name):
        if not exists(join(dirpath, '%s.py' % name.replace('.', '/'))):
            return
        try:
            mod = _import(name)
        except ImportError:
            logging.warning('ImportError %s' % name)
            import traceback
            logging.warning(traceback.format_exc())
            return

        if mod is None:
            return

        if mod in CONFIG_LOADED:
            CONFIG_LOADED.pop(CONFIG_LOADED.index(mod))
        CONFIG_LOADED.append(mod)

        mod.__file__.rsplit('.', 1)[0]

        prepare = getattr(mod, 'prepare', None)
        if prepare:
            prepare_list.append(prepare)

        finish = getattr(mod, 'finish', None)
        if finish:
            finish_list.append(finish)
Esempio n. 3
0
    def _load(name):
        #print name
        try:
            mod = _import(name)
        except ImportError:
            return

        if mod is None:
            return

        if mod in CONFIG_LOADED:
            CONFIG_LOADED.pop(CONFIG_LOADED.index(mod))
        CONFIG_LOADED.append(mod)

        mod.__file__.rsplit(".",1)[0]
 
        prepare = getattr(mod, 'pre_config', None)
        if prepare:
            prepare_list.append(prepare)

        finish = getattr(mod, 'post_config', None)
        if finish:
            finish_list.append(finish)