comparison libervia/server/server.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 334d044f2713
children 1f26d8c2afc1
comparison
equal deleted inserted replaced
1281:25eacbb1d59e 1282:0e4e413eb8db
48 from sat.tools import utils 48 from sat.tools import utils
49 from sat.tools import config 49 from sat.tools import config
50 from sat.tools.common import regex 50 from sat.tools.common import regex
51 from sat.tools.common import template 51 from sat.tools.common import template
52 from sat.tools.common import uri as common_uri 52 from sat.tools.common import uri as common_uri
53 from sat.tools.common.utils import recursive_update 53 from sat.tools.common.utils import recursive_update, OrderedSet
54 from sat.tools.common import data_format 54 from sat.tools.common import data_format
55 from sat.tools.common import tls 55 from sat.tools.common import tls
56 import libervia 56 import libervia
57 from libervia.server import websockets 57 from libervia.server import websockets
58 from libervia.server.pages import LiberviaPage 58 from libervia.server.pages import LiberviaPage
184 self.default_theme = self.getConfig('theme', C.TEMPLATE_THEME_DEFAULT) 184 self.default_theme = self.getConfig('theme', C.TEMPLATE_THEME_DEFAULT)
185 self.site_themes = set() 185 self.site_themes = set()
186 self.named_pages = {} 186 self.named_pages = {}
187 self.browser_modules = {} 187 self.browser_modules = {}
188 # template dynamic data used in all pages 188 # template dynamic data used in all pages
189 self.dyn_data_common = {"scripts": set()} 189 self.dyn_data_common = {"scripts": OrderedSet()}
190 for theme, data in host.renderer.getThemesData(site_name).items(): 190 for theme, data in host.renderer.getThemesData(site_name).items():
191 # we check themes for browser metadata, and merge them here if found 191 # we check themes for browser metadata, and merge them here if found
192 self.site_themes.add(theme) 192 self.site_themes.add(theme)
193 browser_meta = data.get('browser_meta') 193 browser_meta = data.get('browser_meta')
194 if browser_meta is not None: 194 if browser_meta is not None: