From: Ben Darnell Date: Mon, 29 Nov 2010 21:34:15 +0000 (-0800) Subject: Preserve the order of css_files from UIModules, like we already do for JS X-Git-Tag: v1.2.0~65 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eededcf5d51c4e945757b0936512115cf50d09f4;p=thirdparty%2Ftornado.git Preserve the order of css_files from UIModules, like we already do for JS --- diff --git a/tornado/web.py b/tornado/web.py index dd08dddb6..3eddc40b7 100644 --- a/tornado/web.py +++ b/tornado/web.py @@ -455,12 +455,14 @@ class RequestHandler(object): sloc = html.rindex('') html = html[:sloc] + js + '\n' + html[sloc:] if css_files: - paths = set() + paths = [] + unique_paths = set() for path in css_files: if not path.startswith("/") and not path.startswith("http:"): - paths.add(self.static_url(path)) - else: - paths.add(path) + path = self.static_url(path) + if path not in unique_paths: + paths.append(path) + unique_paths.add(path) css = ''.join('' for p in paths)