mflbackend/src/helpers.py
def extra_src(lexicon, funcname, default):
    " Return a lexicon specific function if there is any "
    import importlib
    # If importing fails, try with a different path.
    logging.debug('look for %s', funcname)
    lexconf = lexconfig.get_lexiconconf(lexicon)
    try:
        logging.debug('file: %s', lexconf['src'])
        classmodule = importlib.import_module(lexconf['src'])
        logging.debug('\n\ngo look in %s\n\n', classmodule)
        func = getattr(classmodule, funcname)
        return func
    except:
        return default
 Return a lexicon specific function if there is any 
Return a lexicon specific function if there is any
Return a lexicon specific function if there is any
def extra_src(lexicon, funcname, default):
    import importlib
    logging.debug('look for %s', funcname)
    lexconf = lexconfig.get_lexiconconf(lexicon)
    try:
        logging.debug('file: %s', lexconf['src'])
        classmodule = importlib.import_module(lexconf['src'])
        logging.debug('\n\ngo look in %s\n\n', classmodule)
        func = getattr(classmodule, funcname)
        return func
    except:
        return default
def extra_src ( lexicon , funcname , default ) : import importlib logging . debug ( 'look for %s' , funcname ) lexconf = lexconfig . get_lexiconconf ( lexicon ) try : logging . debug ( 'file: %s' , lexconf [ 'src' ] ) classmodule = importlib . import_module ( lexconf [ 'src' ] ) logging . debug ( '\n\ngo look in %s\n\n' , classmodule ) func = getattr ( classmodule , funcname ) return func except : return default
Return a lexicon specific function if there is any
Return a lexicon specific function if there is any
" Return a lexicon specific function if there is any " # If importing fails, try with a different path.
lexicon
funcname
default