Python library to help build Flow Launcher plugins.
Project description
Installation
Install via pip:
python -m pip install pyflowlauncher
Usage
Basic plugin
A basic plugin using a function as the query method.
from pyflowlauncher import Plugin, Result, send_results
from pyflowlauncher.result import, ResultResponse
plugin = Plugin()
@plugin.on_method
def query(query: str) -> ResultResponse:
r = Result(
Title="This is a title!",
SubTitle="This is the subtitle!",
IcoPath="icon.png"
)
return send_results([r])
plugin.run()
Advanced plugin
A more advanced usage using a Method
class as the query method.
from pyflowlauncher import Plugin, Result, Method
from pyflowlauncher.result import, ResultResponse
plugin = Plugin()
class Query(Method):
def __call__(self, query: str) -> ResultResponse:
r = Result(
Title="This is a title!",
SubTitle="This is the subtitle!"
)
self.add_result(r)
return self.return_results()
plugin.add_method(Query())
plugin.run()
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
Built Distribution
Close
Hashes for pyflowlauncher-0.2.0.dev1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d4516dc2c770c8ec0108939ab2d6da81b2c6c158955602417d3b53b375ebfb7 |
|
MD5 | c18fbce7f2c2e88cd3a7fea9da5ad17e |
|
BLAKE2b-256 | db7636228a3b010de6036d15e2198c2fa8a17d1dec743021d3fa40cac140c96d |
Close
Hashes for pyflowlauncher-0.2.0.dev1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c140154e9cd70fb9e22f75898ae6bb05e12d6cfd3e90c84fe794d228031f6c81 |
|
MD5 | 5cf930810d2443f5c340cdb7fdf4986b |
|
BLAKE2b-256 | 569e44b0312c2abe91c79ff33b5d105d726536b5a18af680c9d96d7d011da462 |