<s> from mead import app <EOL> from flask import g <EOL> from flaskext . themes import get_theme <EOL> import re <EOL> @ app . before_request <EOL> def get_my_theme ( ) : <EOL> g . theme = get_theme ( app . config [ '<STR_LIT>' ] ) <EOL> _punct_re = re . compile ( r'<STR_LIT>' ) <EOL> def slugify ( text , delim = u'<STR_LIT:->' ) : <EOL> """<STR_LIT>""" <EOL> result = [ ] <EOL> for word in _punct_re . split ( text . lower ( ) ) : <EOL> word = word . encode ( '<STR_LIT>' ) <EOL> if word : <EOL> result . append ( word ) <EOL> return unicode ( delim . join ( result ) ) </s>
