Mercurial > libervia-web
annotate libervia/__init__.py @ 1245:079e8eb6e327
server (tasks): refactoring:
- moved `TasksManager` to `server.tasks.manager`
- tasks modules now must have a `Task` class which will be instanciated by TasksManager
- `server.tasks.task` has a basis for `Task` class
- `Task.prepare` can now be asynchronous
- `importlib` is now used to import tasks, instead of exec
- tasks are now parsed/run after pages are imported
- `server.BackendReady` is now a coroutine
- type hinting for Task attributes
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 25 Apr 2020 16:08:55 +0200 |
parents | 3b844004c0b4 |
children | ac2374c92294 |
rev | line source |
---|---|
1124
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
861
diff
changeset
|
1 import os.path |
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
861
diff
changeset
|
2 |
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
861
diff
changeset
|
3 version_file = os.path.join(os.path.dirname(__file__), "VERSION") |
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
|
4 try: |
1124
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
861
diff
changeset
|
5 with open(version_file) as f: |
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
861
diff
changeset
|
6 __version__ = f.read().strip() |
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
861
diff
changeset
|
7 except NotImplementedError: |
28e3eb3bb217
files reorganisation and installation rework:
Goffi <goffi@goffi.org>
parents:
861
diff
changeset
|
8 # pyjamas workaround |
1183 | 9 __version__ = "0.7.0D" |