]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Preserve the order of css_files from UIModules, like we already do for JS
authorBen Darnell <ben@bendarnell.com>
Mon, 29 Nov 2010 21:34:15 +0000 (13:34 -0800)
committerBen Darnell <ben@bendarnell.com>
Mon, 29 Nov 2010 21:34:15 +0000 (13:34 -0800)
tornado/web.py

index dd08dddb6542675d2ab9c929adf39ad91f46101d..3eddc40b7ce00fa9d771a48937126f4bafe10c02 100644 (file)
@@ -455,12 +455,14 @@ class RequestHandler(object):
             sloc = html.rindex('</body>')
             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('<link href="' + escape.xhtml_escape(p) + '" '
                           'type="text/css" rel="stylesheet"/>'
                           for p in paths)