annotate libervia/server/classes.py @ 1360:389a83eefe62

server: SàT applications integration: - a SàT Application can be added to the menu (if necessary values are exposed), by using the `sat-app:[application_name]` in `menu_json` or `menu_extra_json`. The application will then be started with Libervia, and embedded, i.e. Libervia menu will appear and application will be integrated under it. - the same `sat-app:[application_name]` thing can be used in redirection, in this case the redirection will reverse proxy directly the application, without embedding it (no Libervia menu will appear) - the ReverseProxy will replace headers if necessary to allow embedding in a iframe from the same domain - new `embed_app` page to embed a SàT Application
author Goffi <goffi@goffi.org>
date Mon, 28 Sep 2020 21:12:21 +0200
parents 25eacbb1d59e
children 822bd0139769
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1239
f511f8fbbf8a fixed shebangs
Goffi <goffi@goffi.org>
parents: 1237
diff changeset
1 #!/usr/bin/env python3
f511f8fbbf8a fixed shebangs
Goffi <goffi@goffi.org>
parents: 1237
diff changeset
2
1185
7d6c0e5d5f34 server: moved generic classes definitions (only WebsocketMeta for now) to new "classes" module
Goffi <goffi@goffi.org>
parents:
diff changeset
3
7d6c0e5d5f34 server: moved generic classes definitions (only WebsocketMeta for now) to new "classes" module
Goffi <goffi@goffi.org>
parents:
diff changeset
4 # Libervia: a Salut à Toi frontend
1237
987595a254b0 dates update
Goffi <goffi@goffi.org>
parents: 1186
diff changeset
5 # Copyright (C) 2011-2020 Jérôme Poisson <goffi@goffi.org>
1185
7d6c0e5d5f34 server: moved generic classes definitions (only WebsocketMeta for now) to new "classes" module
Goffi <goffi@goffi.org>
parents:
diff changeset
6
7d6c0e5d5f34 server: moved generic classes definitions (only WebsocketMeta for now) to new "classes" module
Goffi <goffi@goffi.org>
parents:
diff changeset
7 # This program is free software: you can redistribute it and/or modify
7d6c0e5d5f34 server: moved generic classes definitions (only WebsocketMeta for now) to new "classes" module
Goffi <goffi@goffi.org>
parents:
diff changeset
8 # it under the terms of the GNU Affero General Public License as published by
7d6c0e5d5f34 server: moved generic classes definitions (only WebsocketMeta for now) to new "classes" module
Goffi <goffi@goffi.org>
parents:
diff changeset
9 # the Free Software Foundation, either version 3 of the License, or
7d6c0e5d5f34 server: moved generic classes definitions (only WebsocketMeta for now) to new "classes" module
Goffi <goffi@goffi.org>
parents:
diff changeset
10 # (at your option) any later version.
7d6c0e5d5f34 server: moved generic classes definitions (only WebsocketMeta for now) to new "classes" module
Goffi <goffi@goffi.org>
parents:
diff changeset
11
7d6c0e5d5f34 server: moved generic classes definitions (only WebsocketMeta for now) to new "classes" module
Goffi <goffi@goffi.org>
parents:
diff changeset
12 # This program is distributed in the hope that it will be useful,
7d6c0e5d5f34 server: moved generic classes definitions (only WebsocketMeta for now) to new "classes" module
Goffi <goffi@goffi.org>
parents:
diff changeset
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
7d6c0e5d5f34 server: moved generic classes definitions (only WebsocketMeta for now) to new "classes" module
Goffi <goffi@goffi.org>
parents:
diff changeset
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7d6c0e5d5f34 server: moved generic classes definitions (only WebsocketMeta for now) to new "classes" module
Goffi <goffi@goffi.org>
parents:
diff changeset
15 # GNU Affero General Public License for more details.
7d6c0e5d5f34 server: moved generic classes definitions (only WebsocketMeta for now) to new "classes" module
Goffi <goffi@goffi.org>
parents:
diff changeset
16
7d6c0e5d5f34 server: moved generic classes definitions (only WebsocketMeta for now) to new "classes" module
Goffi <goffi@goffi.org>
parents:
diff changeset
17 # You should have received a copy of the GNU Affero General Public License
7d6c0e5d5f34 server: moved generic classes definitions (only WebsocketMeta for now) to new "classes" module
Goffi <goffi@goffi.org>
parents:
diff changeset
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
7d6c0e5d5f34 server: moved generic classes definitions (only WebsocketMeta for now) to new "classes" module
Goffi <goffi@goffi.org>
parents:
diff changeset
19
7d6c0e5d5f34 server: moved generic classes definitions (only WebsocketMeta for now) to new "classes" module
Goffi <goffi@goffi.org>
parents:
diff changeset
20 """Useful genertic classes used in Libervia"""
7d6c0e5d5f34 server: moved generic classes definitions (only WebsocketMeta for now) to new "classes" module
Goffi <goffi@goffi.org>
parents:
diff changeset
21
7d6c0e5d5f34 server: moved generic classes definitions (only WebsocketMeta for now) to new "classes" module
Goffi <goffi@goffi.org>
parents:
diff changeset
22
7d6c0e5d5f34 server: moved generic classes definitions (only WebsocketMeta for now) to new "classes" module
Goffi <goffi@goffi.org>
parents:
diff changeset
23 from collections import namedtuple
7d6c0e5d5f34 server: moved generic classes definitions (only WebsocketMeta for now) to new "classes" module
Goffi <goffi@goffi.org>
parents:
diff changeset
24
7d6c0e5d5f34 server: moved generic classes definitions (only WebsocketMeta for now) to new "classes" module
Goffi <goffi@goffi.org>
parents:
diff changeset
25 WebsocketMeta = namedtuple("WebsocketMeta", ("url", "token", "debug"))
1186
352865f4a268 server: added a generic way to have notification messages in pages
Goffi <goffi@goffi.org>
parents: 1185
diff changeset
26 Notification = namedtuple("Notification", ("message", "level"))
1281
25eacbb1d59e server (classes): use default for all values for Script:
Goffi <goffi@goffi.org>
parents: 1268
diff changeset
27 Script = namedtuple("Script", ("src", "type", "content"), defaults=(None, None, ""))