def layouts_info():
    ''' Return list of informations about each available layout.

    Informations (title, slug, and preview) about each layout 
    are laoded from the `MANIFEST.json` file in layout dir (if it exists),
    else default informations are returned.
    '''

    layouts_list = []

    # Get all available layouts
    for layout in list_layouts():

        # Default infos
        current_layout = {'slug': layout['slug'],
                          'title': layout['slug'].capitalize(),
                          'preview': os.path.join(settings.STATIC_URL,
                                                  settings.LAYOUTS_DEFAULT_PATH,
                                                  'icon-layouts.png')}

        # Reading manifest file
        # and pickup infos (for updating default values)
        try:
            manifest_file = os.path.join(layout['path'], 'MANIFEST.json')
            with open(manifest_file, 'r') as f:
                try:
                    manifest = simplejson.loads(f.read())
                    if 'preview' in manifest.keys():
                        manifest['preview'] = '%slayouts/%s/%s' % (settings.STATIC_URL, 
                                                                   layout['slug'],
                                                                   manifest['preview'])
                except __HOLE__ as e:
                    sys.stderr.write('JSON syntax error in %s\n%s\n\n' % (manifest_file, str(e)))
                    continue
                
                current_layout.update(**manifest)
        except IOError:
            pass
        layouts_list.append(current_layout)

    layouts_list = sorted(layouts_list, key=lambda layout: layout['title'].lower())
    return layouts_list
dataset/ETHPy150Open ionyse/ionyweb/ionyweb/loaders/manifest.py/layouts_info