Commit 1f218765 by Timothée Peignier

simplify concat

parent 22368357
...@@ -86,7 +86,7 @@ def compress_url(url, prefix=None): ...@@ -86,7 +86,7 @@ def compress_url(url, prefix=None):
def concat(filenames, separator=''): def concat(filenames, separator=''):
""" """
Concatenate the files from the list of the ``filenames``, ouput separated with ``separator``. Concatenate the files from the list of the ``filenames``, output separated with ``separator``.
""" """
# find relative paths in css: # find relative paths in css:
# url definition, any spacing, single or double quotes, no starting slash # url definition, any spacing, single or double quotes, no starting slash
...@@ -106,10 +106,8 @@ def concat(filenames, separator=''): ...@@ -106,10 +106,8 @@ def concat(filenames, separator=''):
abspath = os.path.normpath(os.path.join('/', abspath = os.path.normpath(os.path.join('/',
os.path.dirname(filename))) os.path.dirname(filename)))
abspath = django_settings.COMPRESS_URL + abspath + '/' abspath = django_settings.COMPRESS_URL + abspath + '/'
fixed = rel_exp.sub('\\1' + abspath + '\\2\\3', contents) contents = rel_exp.sub('\\1' + abspath + '\\2\\3', contents)
r += fixed r += contents
else:
r += contents
r += separator r += separator
return r return r
......
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