예제 #1
0
def sass_variables(asset):
    res = {}
    path = staticfiles_find(asset)
    with open(path) as f:
        for line in f:
            match = sass_variable_re.match(line)
            if match:
                name = match.group(1).strip()
                value = match.group(2).strip()
                if value in res:
                    res[name] = res[value]
                else:
                    res[name] = value
    # Strip leading '$' and replace '-' with '_'
    for name, value in res.items():
        res[name.lstrip(u'$').replace(u'-', u'_')] = value
    return res
예제 #2
0
def sass_variables(asset):
    res = {}
    path = staticfiles_find(asset)
    with open(path) as f:
        for line in f:
            match = sass_variable_re.match(line)
            if match:
                name = match.group(1).strip()
                value = match.group(2).strip()
                if value in res:
                    res[name] = res[value]
                else:
                    res[name] = value
    # Strip leading '$' and replace '-' with '_'
    for name, value in res.items():
        res[name.lstrip(u"$").replace(u"-", u"_")] = value
    return res
예제 #3
0
파일: models.py 프로젝트: thepythonic/bbeez
def find_themes():
    themedirs = staticfiles_find("nivo/themes/", all=True)
    for dir in themedirs:
        for theme in os.listdir(dir):
            yield theme
예제 #4
0
def find_themes():
    themedirs = staticfiles_find("nivo/themes/", all=True)
    for dir in themedirs:
        for theme in os.listdir(dir):
            yield theme