Simple extension system for extending Takumi framework
Project description
Simple extension system for extending Takumi framework.
Install
$ pip install takumi-ext
Example
Here is an extension for running codes before app starts and after app exists.
app = AppRunner()
app_runner_ext = ext['app-runner']
if app_runner_ext:
runner_ext = app_runner_ext(app)
app.cfg.set('when_ready', lambda x: runner_ext.on_start())
app.cfg.set('on_exit', lambda x: runner_ext.on_exit())
app.run()
To implement this extension:
# package name runner_ext
class RunnerExt(ExtBase):
name = 'app-runner'
def __init__(self, app):
self.app = app
def on_start(self):
print('app starting...')
def on_exit(self):
print('app existing...')
Add the following config to app.yml to use the extension:
extensions:
- runner_ext
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
takumi_ext-0.1.2.tar.gz
(2.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file takumi_ext-0.1.2.tar.gz.
File metadata
- Download URL: takumi_ext-0.1.2.tar.gz
- Upload date:
- Size: 2.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2975603fd3a87cf9a70d593ef9a94fe05bf93b6822720c5adcf88f4da9c0c1f9
|
|
| MD5 |
0cccc0d25ecfe450a91bfa7cf249a0d1
|
|
| BLAKE2b-256 |
3b3e94fdb21d4e238e7de024173398bc21e077777cbb17ccc4a7c76132f51bd3
|
File details
Details for the file takumi_ext-0.1.2-py2.py3-none-any.whl.
File metadata
- Download URL: takumi_ext-0.1.2-py2.py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8e758eb1b179571bbf5d8d9633447960c659fd0dfe938ea47398ae2f9f588064
|
|
| MD5 |
06e5b46c5946ad4330622f54bb160552
|
|
| BLAKE2b-256 |
c8072dc44f86ad4f64fe8e5abec6142e70cd52d37ad8f9b8afb102272d596c0c
|