Mercurial > libervia-web
annotate src/__init__.py @ 995:f88325b56a6a
server: dynamic pages first draft:
/!\ new dependency: autobahn
This patch introduce server part of dynamic pages.
Dynamic pages use websockets to establish constant connection with a Libervia page, allowing to receive real time data or update it.
The feature is activated by specifying "dynamic = true" in the page.
Once activated, page can implement "on_data" method which will be called when data are sent by the page.
To send data the other way, the page can use request.sendData.
The new "registerSignal" method allows to use an "on_signal" method to be called each time given signal is received, with automatic (and optional) filtering on profile.
New renderPartial and renderAndUpdate method allow to append new HTML elements to the dynamic page.
author | Goffi <goffi@goffi.org> |
---|---|
date | Wed, 03 Jan 2018 01:10:12 +0100 |
parents | 5cefc6ab302f |
children |
rev | line source |
---|---|
861
5cefc6ab302f
server: moved APP_VERSION to common.constants + avoid __init__ import in browser side, which was the source of a crash
Goffi <goffi@goffi.org>
parents:
856
diff
changeset
|
1 try: |
5cefc6ab302f
server: moved APP_VERSION to common.constants + avoid __init__ import in browser side, which was the source of a crash
Goffi <goffi@goffi.org>
parents:
856
diff
changeset
|
2 from common.constants import Const as C |
5cefc6ab302f
server: moved APP_VERSION to common.constants + avoid __init__ import in browser side, which was the source of a crash
Goffi <goffi@goffi.org>
parents:
856
diff
changeset
|
3 except ImportError: |
5cefc6ab302f
server: moved APP_VERSION to common.constants + avoid __init__ import in browser side, which was the source of a crash
Goffi <goffi@goffi.org>
parents:
856
diff
changeset
|
4 pass # import doesn't work at this stage with pyjamas |
5cefc6ab302f
server: moved APP_VERSION to common.constants + avoid __init__ import in browser side, which was the source of a crash
Goffi <goffi@goffi.org>
parents:
856
diff
changeset
|
5 else: |
5cefc6ab302f
server: moved APP_VERSION to common.constants + avoid __init__ import in browser side, which was the source of a crash
Goffi <goffi@goffi.org>
parents:
856
diff
changeset
|
6 __version__ = C.APP_VERSION |