### krunnerdbusutils
Utilities for writing a KRunner plugin using python.
Usage example:
```py
from krunnerdbusutils import krunner_actions, krunner_match, krunner_run, \
AbstractRunner, Action, Match, run_event_loop
class Runner(AbstractRunner):
def __init__(self):
super().__init__("net.fancyplugin2", "/fancyplugin")
@krunner_match
def Match(self, query: str):
matches = []
if query == "hello":
match = Match() # Or utilize keyword constructor
match.id = "hello_match"
match.text = "Hello There!"
match.subtext = "Example"
match.icon = "planetkde"
matches.append(match)
return matches
@krunner_actions
def Actions(self):
return [Action(id="id", text="Action Tooltip", icon="planetkde")]
@krunner_run
def Run(self, data: str, action_id: str):
print(data, action_id)
if __name__ == "__main__":
run_event_loop(Runner)
```
Raw data
{
"_id": null,
"home_page": "https://github.com/alex1701c/krunnerdbusutils",
"name": "krunnerdbusutils",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": null,
"author": "Alexander Lohnau",
"author_email": "alex1701c.dev@gmx.net",
"download_url": "https://files.pythonhosted.org/packages/b9/99/6740ec280fe09404a5007c96b64607abbc2a2d1593f9ad3d9842958e8834/krunnerdbusutils-0.1.2.tar.gz",
"platform": null,
"description": "### krunnerdbusutils\n\nUtilities for writing a KRunner plugin using python.\n\nUsage example:\n\n```py\nfrom krunnerdbusutils import krunner_actions, krunner_match, krunner_run, \\\n AbstractRunner, Action, Match, run_event_loop\n\n\nclass Runner(AbstractRunner):\n def __init__(self):\n super().__init__(\"net.fancyplugin2\", \"/fancyplugin\")\n\n @krunner_match\n def Match(self, query: str):\n matches = []\n if query == \"hello\":\n match = Match() # Or utilize keyword constructor\n match.id = \"hello_match\"\n match.text = \"Hello There!\"\n match.subtext = \"Example\"\n match.icon = \"planetkde\"\n matches.append(match)\n return matches\n\n @krunner_actions\n def Actions(self):\n return [Action(id=\"id\", text=\"Action Tooltip\", icon=\"planetkde\")]\n\n @krunner_run\n def Run(self, data: str, action_id: str):\n print(data, action_id)\n\n\nif __name__ == \"__main__\":\n run_event_loop(Runner)\n```\n",
"bugtrack_url": null,
"license": null,
"summary": "A utility library for interacting with the KRunner API via D-Bus",
"version": "0.1.2",
"project_urls": {
"Homepage": "https://github.com/alex1701c/krunnerdbusutils"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "2c295792ef67a49ec4dd21dd19269eaa7f881ee40cb3d426eefcaad115d21b4b",
"md5": "30363037a0c44748591618d0b60c28b8",
"sha256": "8028d82c1e1c3f74ad0ef4820eeeaf7f873c1f3f0fcb5a8b625152fb3f5ef293"
},
"downloads": -1,
"filename": "krunnerdbusutils-0.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "30363037a0c44748591618d0b60c28b8",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 4093,
"upload_time": "2024-09-08T10:12:40",
"upload_time_iso_8601": "2024-09-08T10:12:40.354210Z",
"url": "https://files.pythonhosted.org/packages/2c/29/5792ef67a49ec4dd21dd19269eaa7f881ee40cb3d426eefcaad115d21b4b/krunnerdbusutils-0.1.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b9996740ec280fe09404a5007c96b64607abbc2a2d1593f9ad3d9842958e8834",
"md5": "61795b806d7f530f47446fbc556fce33",
"sha256": "1425a8684ee62bb4222946c1eb5b732be06b1b049db116d033f644afb411c8fc"
},
"downloads": -1,
"filename": "krunnerdbusutils-0.1.2.tar.gz",
"has_sig": false,
"md5_digest": "61795b806d7f530f47446fbc556fce33",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 3042,
"upload_time": "2024-09-08T10:12:41",
"upload_time_iso_8601": "2024-09-08T10:12:41.629943Z",
"url": "https://files.pythonhosted.org/packages/b9/99/6740ec280fe09404a5007c96b64607abbc2a2d1593f9ad3d9842958e8834/krunnerdbusutils-0.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-08 10:12:41",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "alex1701c",
"github_project": "krunnerdbusutils",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "krunnerdbusutils"
}