def get_context_files(app):
    '''Load static context from ``location``
    '''
    ctx = {}
    location = app.config['CONTENT_PARTIALS']
    if location and os.path.isdir(location):
        for dirpath, dirs, filenames in os.walk(location, topdown=False):
            if skipfile(os.path.basename(dirpath) or dirpath):
                continue
            for filename in filenames:
                if skipfile(filename):
                    continue
                file_bits = filename.split('.')
                bits = [file_bits[0]]

                prefix = get_rel_dir(dirpath, location)
                while prefix:
                    prefix, tail = os.path.split(prefix)
                    bits.append(tail)

                filename = os.path.join(dirpath, filename)
                suffix = get_reader(app, filename).suffix
                name = '_'.join(reversed(bits))
                if suffix:
                    name = '%s_%s' % (suffix, name)
                ctx[name] = filename
    return ctx
dataset/ETHPy150Open quantmind/lux/lux/extensions/content/utils.py/get_context_files/original