예제 #1
0
파일: manifest.py 프로젝트: ionyse/ionyweb
def get_theme(slug):
    
    theme = None
    for theme_dir in settings.THEMES_DIRS:
        themes = ThemeStorage(location=theme_dir)
        directories, files = themes.listdir('./')
        for t in directories:
            if t == slug:
                theme = {'slug': t, 'path': themes.path(t)}
                break
    return theme
예제 #2
0
파일: manifest.py 프로젝트: manlan2/ionyweb
def get_theme(slug):

    theme = None
    for theme_dir in settings.THEMES_DIRS:
        themes = ThemeStorage(location=theme_dir)
        directories, files = themes.listdir('./')
        for t in directories:
            if t == slug:
                theme = {'slug': t, 'path': themes.path(t)}
                break
    return theme
예제 #3
0
파일: manifest.py 프로젝트: ionyse/ionyweb
def list_themes():
    ''' Return the list of availables themes
    >>> list_themes()
    [{'path': u'~/hg/ionyweb3/ionyweb/contrib/themes/jungleland', 'slug': u'jungleland'}]

    '''

    unique_slug = []
    themes_list = []
    for theme_dir in settings.THEMES_DIRS:
        themes = ThemeStorage(location=theme_dir)
        directories, files = themes.listdir('./')

        new_list = []
        for t in directories:
            if t not in unique_slug:
                new_list.append({'slug': t, 'path': themes.path(t)})
                unique_slug.append(t)
        themes_list += new_list

    return themes_list
예제 #4
0
파일: manifest.py 프로젝트: manlan2/ionyweb
def list_themes():
    ''' Return the list of availables themes
    >>> list_themes()
    [{'path': u'~/hg/ionyweb3/ionyweb/contrib/themes/jungleland', 'slug': u'jungleland'}]

    '''

    unique_slug = []
    themes_list = []
    for theme_dir in settings.THEMES_DIRS:
        themes = ThemeStorage(location=theme_dir)
        directories, files = themes.listdir('./')

        new_list = []
        for t in directories:
            if t not in unique_slug:
                new_list.append({'slug': t, 'path': themes.path(t)})
                unique_slug.append(t)
        themes_list += new_list

    return themes_list