Commit 2659eb45 authored by Kostas Papadimitriou's avatar Kostas Papadimitriou
Browse files

branding: Convert tabs to spaces

parent aa14a69f
from synnefo_branding import settings
from django.template.loader import render_to_string as django_render_to_string
def get_branding_dict(prepend=None):
dct = {}
for key in dir(settings):
if key == key.upper():
newkey = key.lower()
if prepend:
newkey = '%s_%s' % (prepend, newkey)
dct[newkey.upper()] = getattr(settings, key)
return dct
dct = {}
for key in dir(settings):
if key == key.upper():
newkey = key.lower()
if prepend:
newkey = '%s_%s' % (prepend, newkey)
dct[newkey.upper()] = getattr(settings, key)
return dct
def brand_message(msg, **extra_args):
params = get_branding_dict()
params.update(extra_args)
return msg % params
params = get_branding_dict()
params.update(extra_args)
return msg % params
def render_to_string(template_name, dictionary=None, context_instance=None):
if not dictionary:
dictionary = {}
newdict = get_branding_dict("BRANDING")
newdict.update(dictionary)
return django_render_to_string(template_name, newdict, context_instance)
\ No newline at end of file
if not dictionary:
dictionary = {}
newdict = get_branding_dict("BRANDING")
newdict.update(dictionary)
return django_render_to_string(template_name, newdict, context_instance)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment