diff libervia/server/server.py @ 1268:e628724530ec

pages, tasks (brython): use set for scripts + common template data: - scripts are put in a set using a namedtuple, this way duplicates can be avoided easily - if `template` is set in dyn_data_common, items there are set in template data if they don't already exist - (brython): common template data is used to set body_onload when there is a root brython script and no page script
author Goffi <goffi@goffi.org>
date Tue, 19 May 2020 11:05:40 +0200
parents 6b7f9c3558cc
children eb4f03da0d7d
line wrap: on
line diff
--- a/libervia/server/server.py	Tue May 19 11:02:33 2020 +0200
+++ b/libervia/server/server.py	Tue May 19 11:05:40 2020 +0200
@@ -190,7 +190,7 @@
         self.named_pages = {}
         self.browser_modules = {}
         # template dynamic data used in all pages
-        self.dyn_data_common = {"scripts": []}
+        self.dyn_data_common = {"scripts": set()}
         for theme, data in host.renderer.getThemesData(site_name).items():
             # we check themes for browser metadata, and merge them here if found
             self.site_themes.add(theme)