diff libervia/server/pages.py @ 1282:0e4e413eb8db

server: user new OrderedSet to handle scripts: OrderedSet is needed because scripts must not be duplicated and must be generated in right order.
author Goffi <goffi@goffi.org>
date Fri, 19 Jun 2020 16:47:51 +0200
parents 2e4fcd31f2a9
children 436ef2ad92af
line wrap: on
line diff
--- a/libervia/server/pages.py	Fri Jun 19 16:47:50 2020 +0200
+++ b/libervia/server/pages.py	Fri Jun 19 16:47:51 2020 +0200
@@ -129,7 +129,7 @@
         @param host(Libervia): the running instance of Libervia
         @param vhost_root(web_resource.Resource): root resource of the virtual host which
             handle this page.
-        @param root_dir(Path): aboslute file path of the page
+        @param root_dir(Path): absolute file path of the page
         @param url(unicode): relative URL to the page
             this URL may not be valid, as pages may require path arguments
         @param name(unicode, None): if not None, a unique name to identify the page
@@ -1342,12 +1342,12 @@
                 except KeyError:
                     pass
                 else:
-                    template_data.setdefault('scripts', set()).update(scripts)
+                    template_data.setdefault('scripts', utils.OrderedSet()).update(scripts)
                 template_data.update(data.get('template', {}))
         data_common = self.vhost_root.dyn_data_common
         common_scripts = data_common['scripts']
         if common_scripts:
-            template_data.setdefault('scripts', set()).update(common_scripts)
+            template_data.setdefault('scripts', utils.OrderedSet()).update(common_scripts)
             if "template" in data_common:
                 for key, value in data_common["template"].items():
                     if key not in template_data: