Name | kaki JSON |
Version |
0.1.9
JSON |
| download |
home_page | https://github.com/tito/kaki |
Summary | Kivy application library on steroids |
upload_time | 2023-06-15 15:25:33 |
maintainer | |
docs_url | None |
author | Mathieu Virbel |
requires_python | |
license | |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Kaki - Advanced application library for Kivy
This library enhance Kivy frameworks with opiniated features such as:
- Auto reloading kv or py (`watchdog` required, limited to some uses cases)
- Idle detection support
- Foreground lock (windows only)
## Example
This is a bootstrap that will:
- automatically declare the module `live.ui` (`live/ui.py`) as a provider for the widget `UI`
- build the application widget, and show it to a window
If the bootstrap is started with the environment variable `DEBUG=1`, it will start a watchdog, and listen for changes, according to `AUTORELOADER_PATHS`.
When something changes, the current application widget will be cleared out, and a new one will be instanciated, after reloading.
```python
from kaki.app import App
from kivy.factory import Factory
class Live(App):
CLASSES = {
"UI": "live.ui"
}
AUTORELOADER_PATHS = [
(".", {"recursive": True}),
]
def build_app(self):
return Factory.UI()
Live().run()
```
## Application class configuration
#: Control either we activate debugging in the app or not
#: Defaults depend if "DEBUG" exists in os.environ
DEBUG = "DEBUG" in os.environ
#: If true, it will require the foreground lock on windows
FOREGROUND_LOCK = False
#: List of KV files under management for auto reloader
KV_FILES = []
#: List of path to watch for autoreloading
AUTORELOADER_PATHS = [
# (".", {"recursive": False}),
]
#: List of extensions to ignore
AUTORELOADER_IGNORE_PATTERNS = [
"*.pyc", "*__pycache__*"]
#: Factory classes managed by kaki
CLASSES = {}
#: Idle detection (if True, event on_idle/on_wakeup will be fired)
#: Rearming idle can also be done with rearm_idle()
IDLE_DETECTION = False
#: Auto install idle detection check when activated
IDLE_DETECTION_AUTO_START = True
#: Default idle timeout
IDLE_TIMEOUT = 60
#: Raise error
#: When the DEBUG is activated, it will raise any error instead
#: of showing it on the screen. If you still want to show the error
#: when not in DEBUG, put this to False
RAISE_ERROR = True
## Idle Management
The idle detection feature is designed to trigger an action if the user has not touched the screen for a certain period of time. This can be used to display an attractor screen, screensaver, or other content.
To enable idle detection, set the `IDLE_DETECTION` configuration to `True`.
Kaki will then listen for touch down/move events. If no such events occur within the `IDLE_TIMEOUT` interval, or if the `rearm_idle` function has not been called, the `on_idle` event will be triggered on the application class. If a touch event occurs or `rearm_idle` is called while the system is in idle mode, the `on_wakeup` event will be triggered on the application class.
If you are playing a video and do not want idle detection to be triggered, you can use the `rearm_idle` function on the application class to reset the idle timer to 0 seconds.
Raw data
{
"_id": null,
"home_page": "https://github.com/tito/kaki",
"name": "kaki",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "",
"author": "Mathieu Virbel",
"author_email": "mat@meltingrocks.com",
"download_url": "https://files.pythonhosted.org/packages/c5/33/97ae6277588ec73f6b9715c136e083368956f206f26bfd443a8401e87548/kaki-0.1.9.tar.gz",
"platform": null,
"description": "# Kaki - Advanced application library for Kivy\n\nThis library enhance Kivy frameworks with opiniated features such as:\n\n- Auto reloading kv or py (`watchdog` required, limited to some uses cases)\n- Idle detection support\n- Foreground lock (windows only)\n\n## Example\n\nThis is a bootstrap that will:\n- automatically declare the module `live.ui` (`live/ui.py`) as a provider for the widget `UI`\n- build the application widget, and show it to a window\n\nIf the bootstrap is started with the environment variable `DEBUG=1`, it will start a watchdog, and listen for changes, according to `AUTORELOADER_PATHS`.\nWhen something changes, the current application widget will be cleared out, and a new one will be instanciated, after reloading.\n\n```python\nfrom kaki.app import App\nfrom kivy.factory import Factory\n\nclass Live(App):\n CLASSES = {\n \"UI\": \"live.ui\"\n }\n AUTORELOADER_PATHS = [\n (\".\", {\"recursive\": True}),\n ]\n def build_app(self):\n return Factory.UI()\n\nLive().run()\n```\n\n## Application class configuration\n\n\n #: Control either we activate debugging in the app or not\n #: Defaults depend if \"DEBUG\" exists in os.environ\n DEBUG = \"DEBUG\" in os.environ\n\n #: If true, it will require the foreground lock on windows\n FOREGROUND_LOCK = False\n\n #: List of KV files under management for auto reloader\n KV_FILES = []\n\n #: List of path to watch for autoreloading\n AUTORELOADER_PATHS = [\n # (\".\", {\"recursive\": False}),\n ]\n\n #: List of extensions to ignore\n AUTORELOADER_IGNORE_PATTERNS = [\n \"*.pyc\", \"*__pycache__*\"]\n\n #: Factory classes managed by kaki\n CLASSES = {}\n\n #: Idle detection (if True, event on_idle/on_wakeup will be fired)\n #: Rearming idle can also be done with rearm_idle()\n IDLE_DETECTION = False\n\n #: Auto install idle detection check when activated\n IDLE_DETECTION_AUTO_START = True\n\n #: Default idle timeout\n IDLE_TIMEOUT = 60\n\n #: Raise error\n #: When the DEBUG is activated, it will raise any error instead\n #: of showing it on the screen. If you still want to show the error\n #: when not in DEBUG, put this to False\n RAISE_ERROR = True\n\n## Idle Management\n\nThe idle detection feature is designed to trigger an action if the user has not touched the screen for a certain period of time. This can be used to display an attractor screen, screensaver, or other content.\n\nTo enable idle detection, set the `IDLE_DETECTION` configuration to `True`.\nKaki will then listen for touch down/move events. If no such events occur within the `IDLE_TIMEOUT` interval, or if the `rearm_idle` function has not been called, the `on_idle` event will be triggered on the application class. If a touch event occurs or `rearm_idle` is called while the system is in idle mode, the `on_wakeup` event will be triggered on the application class.\n\nIf you are playing a video and do not want idle detection to be triggered, you can use the `rearm_idle` function on the application class to reset the idle timer to 0 seconds.\n",
"bugtrack_url": null,
"license": "",
"summary": "Kivy application library on steroids",
"version": "0.1.9",
"project_urls": {
"Bug Reports": "https://github.com/tito/kaki/issues",
"Homepage": "https://github.com/tito/kaki",
"Source": "https://github.com/tito/kaki/"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "157bb267a6fc6adc894ee5b3361a4c7938b415eb996bd6cadf18df346ea50662",
"md5": "d7baede28a83ccd5ed0986942a970c27",
"sha256": "fdc868a0b98a72b751ef87172897df6d89ac1a453f8e577156d0ce953208ae9a"
},
"downloads": -1,
"filename": "kaki-0.1.9-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "d7baede28a83ccd5ed0986942a970c27",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 7270,
"upload_time": "2023-06-15T15:25:31",
"upload_time_iso_8601": "2023-06-15T15:25:31.002063Z",
"url": "https://files.pythonhosted.org/packages/15/7b/b267a6fc6adc894ee5b3361a4c7938b415eb996bd6cadf18df346ea50662/kaki-0.1.9-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c53397ae6277588ec73f6b9715c136e083368956f206f26bfd443a8401e87548",
"md5": "b979049ca56b95bc9cbca76f95aba890",
"sha256": "63093bbc83ed930e29f0fe29ece69061b806911c61f64cb99329e2d9a56dac5f"
},
"downloads": -1,
"filename": "kaki-0.1.9.tar.gz",
"has_sig": false,
"md5_digest": "b979049ca56b95bc9cbca76f95aba890",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 8914,
"upload_time": "2023-06-15T15:25:33",
"upload_time_iso_8601": "2023-06-15T15:25:33.520507Z",
"url": "https://files.pythonhosted.org/packages/c5/33/97ae6277588ec73f6b9715c136e083368956f206f26bfd443a8401e87548/kaki-0.1.9.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-06-15 15:25:33",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "tito",
"github_project": "kaki",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "kaki"
}