comparison libervia/server/server.py @ 1460:0ea54090e414

server: renamed `sat-app` to `libervia-app` following global renaming
author Goffi <goffi@goffi.org>
date Wed, 29 Sep 2021 17:39:37 +0200
parents 47db314e60ca
children 87e48b6a1bbd
comparison
equal deleted inserted replaced
1459:47db314e60ca 1460:0ea54090e414
177 def getChildWithDefault(self, path, request): 177 def getChildWithDefault(self, path, request):
178 return super().getChildWithDefault(path, request) 178 return super().getChildWithDefault(path, request)
179 179
180 def getChildForRequest(self, request): 180 def getChildForRequest(self, request):
181 return super().getChildForRequest(request) 181 return super().getChildForRequest(request)
182
182 183
183 class LiberviaRootResource(ProtectedFile): 184 class LiberviaRootResource(ProtectedFile):
184 """Specialized resource for Libervia root 185 """Specialized resource for Libervia root
185 186
186 handle redirections declared in sat.conf 187 handle redirections declared in sat.conf
233 234
234 self.uri_callbacks = {} 235 self.uri_callbacks = {}
235 self.pages_redirects = {} 236 self.pages_redirects = {}
236 self.cached_urls = {} 237 self.cached_urls = {}
237 self.main_menu = None 238 self.main_menu = None
238 # map SàT application names => data 239 # map Libervia application names => data
239 self.sat_apps = {} 240 self.libervia_apps = {}
240 self.build_path = host.getBuildPath(site_name) 241 self.build_path = host.getBuildPath(site_name)
241 self.build_path.mkdir(parents=True, exist_ok=True) 242 self.build_path.mkdir(parents=True, exist_ok=True)
242 self.dev_build_path = host.getBuildPath(site_name, dev=True) 243 self.dev_build_path = host.getBuildPath(site_name, dev=True)
243 self.dev_build_path.mkdir(parents=True, exist_ok=True) 244 self.dev_build_path.mkdir(parents=True, exist_ok=True)
244 self.putChild( 245 self.putChild(
294 log.info(_( 295 log.info(_(
295 "starting application {app_name}").format(app_name=app_name)) 296 "starting application {app_name}").format(app_name=app_name))
296 await self.host.bridgeCall( 297 await self.host.bridgeCall(
297 "applicationStart", app_name, data_format.serialise(extra) 298 "applicationStart", app_name, data_format.serialise(extra)
298 ) 299 )
299 app_data = self.sat_apps[app_name] = data_format.deserialise( 300 app_data = self.libervia_apps[app_name] = data_format.deserialise(
300 await self.host.bridgeCall( 301 await self.host.bridgeCall(
301 "applicationExposedGet", app_name, "", "")) 302 "applicationExposedGet", app_name, "", ""))
302 303
303 try: 304 try:
304 web_port = int(app_data['ports']['web'].split(':')[1]) 305 web_port = int(app_data['ports']['web'].split(':')[1])
547 "menu item as list must be in the form [page_name, absolue URL]" 548 "menu item as list must be in the form [page_name, absolue URL]"
548 ) 549 )
549 log.error(msg) 550 log.error(msg)
550 raise ValueError(msg) 551 raise ValueError(msg)
551 page_name, url = menu 552 page_name, url = menu
552 elif menu.startswith("sat-app:"): 553 elif menu.startswith("libervia-app:"):
553 app_name = menu[8:].strip().lower() 554 app_name = menu[8:].strip().lower()
554 app_data = await self._startApp(app_name) 555 app_data = await self._startApp(app_name)
555 front_url = app_data['front_url'] 556 front_url = app_data['front_url']
556 options = self.host.options 557 options = self.host.options
557 url_redirections = options["url_redirections_dict"].setdefault( 558 url_redirections = options["url_redirections_dict"].setdefault(