From eededcf5d51c4e945757b0936512115cf50d09f4 Mon Sep 17 00:00:00 2001 From: Ben Darnell Date: Mon, 29 Nov 2010 13:34:15 -0800 Subject: [PATCH] Preserve the order of css_files from UIModules, like we already do for JS --- tornado/web.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tornado/web.py b/tornado/web.py index dd08dddb..3eddc40b 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)