1- from __future__ import absolute_import
2- from __future__ import division
3- from __future__ import print_function
4- from __future__ import unicode_literals
5-
61from django import template
7- from django .utils .encoding import smart_text
2+ from django .utils .encoding import smart_str
83
94from django_inlinecss import conf
105
11-
126register = template .Library ()
137
148
@@ -19,28 +13,26 @@ def __init__(self, nodelist, filter_expressions):
1913
2014 def render (self , context ):
2115 rendered_contents = self .nodelist .render (context )
22- css = ''
16+ css = ""
2317 for expression in self .filter_expressions :
2418 path = expression .resolve (context , True )
2519 if path is not None :
26- path = smart_text (path )
20+ path = smart_str (path )
2721
2822 css_loader = conf .get_css_loader ()()
29- css = '' .join ((css , css_loader .load (path )))
23+ css = "" .join ((css , css_loader .load (path )))
3024
3125 engine = conf .get_engine ()(html = rendered_contents , css = css )
3226 return engine .render ()
3327
3428
3529@register .tag
3630def inlinecss (parser , token ):
37- nodelist = parser .parse ((' endinlinecss' ,))
31+ nodelist = parser .parse ((" endinlinecss" ,))
3832
3933 # prevent second parsing of endinlinecss
4034 parser .delete_first_token ()
4135
4236 args = token .split_contents ()[1 :]
4337
44- return InlineCssNode (
45- nodelist ,
46- [parser .compile_filter (arg ) for arg in args ])
38+ return InlineCssNode (nodelist , [parser .compile_filter (arg ) for arg in args ])
0 commit comments