Skip to content

Commit edfbc7a

Browse files
committed
update
1 parent 7e97f97 commit edfbc7a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1912
-2
lines changed

.github/workflows/Publish Release.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,24 @@ jobs:
3232
run: |
3333
python -m pip install --upgrade pip
3434
pip install -r requirements.txt -t ./lib
35-
zip -r WebsiteOpener.zip . -x '*.git*' -x '*.github/*'
35+
zip -r WebsiteOpener.zip . \
36+
-x '*.git*' \
37+
-x '*.github/*' \
38+
-x '*.idea/*' \
39+
-x '__pycache__/*' \
40+
-x '*.DS_Store'
41+
42+
- name: Delete existing tag if exists
43+
run: |
44+
git tag -d v${{ steps.version.outputs.prop }} || true
45+
git push origin :refs/tags/v${{ steps.version.outputs.prop }} || true
3646
3747
- name: Publish Release
38-
if: success()
3948
uses: softprops/action-gh-release@v1
4049
with:
4150
files: 'WebsiteOpener.zip'
4251
tag_name: "v${{ steps.version.outputs.prop }}"
52+
name: "WebsiteOpener v${{ steps.version.outputs.prop }}"
53+
body: "Auto release by GitHub Actions"
4354
env:
4455
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.idea/.gitignore

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/WebsiteOpener.iml

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/profiles_settings.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pip
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 William McAllister
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
Metadata-Version: 2.1
2+
Name: pyflowlauncher
3+
Version: 0.9.2
4+
Summary: Python library to help build Flow Launcher plugins.
5+
Author-email: William McAllister <[email protected]>
6+
License: MIT
7+
Classifier: License :: OSI Approved :: MIT License
8+
Classifier: Programming Language :: Python :: 3.8
9+
Classifier: Programming Language :: Python :: 3.9
10+
Classifier: Programming Language :: Python :: 3.10
11+
Classifier: Programming Language :: Python :: 3.11
12+
Classifier: Programming Language :: Python :: 3.12
13+
Classifier: Typing :: Typed
14+
Requires-Python: >=3.8
15+
Description-Content-Type: text/markdown
16+
License-File: LICENSE
17+
Requires-Dist: typing-extensions >=4.8.0 ; python_version < "3.11"
18+
Provides-Extra: all
19+
Requires-Dist: typing-extensions >=4.8.0 ; extra == 'all'
20+
21+
[![Tests Workflow Status](https://img.shields.io/github/actions/workflow/status/garulf/pyflowlauncher/tests.yaml?style=flat-square&label=tests)](https://github.com/Garulf/pyFlowLauncher/actions/workflows/tests.yaml)
22+
[![Docs Workflow Status](https://img.shields.io/github/actions/workflow/status/garulf/pyflowlauncher/tests.yaml?style=flat-square&label=docs)](https://github.com/Garulf/pyFlowLauncher/actions/workflows/docs.yaml)
23+
[![Release Workflow Status](https://img.shields.io/github/actions/workflow/status/garulf/pyflowlauncher/create_release.yaml?style=flat-square&label=release)](https://github.com/Garulf/pyFlowLauncher/actions/workflows/create_release.yaml)
24+
[![pypi](https://img.shields.io/pypi/v/pyflowlauncher?style=flat-square)](https://pypi.org/project/pyflowlauncher/)
25+
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pyflowlauncher)](https://pypi.org/project/pyflowlauncher/)
26+
[![GitHub License](https://img.shields.io/github/license/garulf/pyflowlauncher?style=flat-square)](./LICENSE)
27+
[![buymeacoffee](https://img.shields.io/badge/buy%20me%20a%20coffee-yellow.svg?style=flat-square&logo=buymeacoffee&logoColor=000)](https://www.buymeacoffee.com/garulf)
28+
29+
# pyFlowLauncher
30+
31+
pyFlowLauncher is an API that allows you to quickly create plugins for Flow Launcher!
32+
33+
## Installation
34+
35+
Install via pip:
36+
37+
```py
38+
python -m pip install pyflowlauncher[all]
39+
```
40+
41+
> [!IMPORTANT]
42+
> Please use the `[all]` flag in order to support Python versions older then `3.11`.
43+
44+
## Usage
45+
46+
### Basic plugin
47+
48+
A basic plugin using a function as the query method.
49+
50+
```py
51+
from pyflowlauncher import Plugin, Result, send_results
52+
from pyflowlauncher.result import ResultResponse
53+
54+
plugin = Plugin()
55+
56+
57+
@plugin.on_method
58+
def query(query: str) -> ResultResponse:
59+
r = Result(
60+
Title="This is a title!",
61+
SubTitle="This is the subtitle!",
62+
IcoPath="icon.png"
63+
)
64+
return send_results([r])
65+
66+
67+
plugin.run()
68+
```
69+
70+
### Advanced plugin
71+
72+
A more advanced usage using a `Method` class as the query method.
73+
74+
```py
75+
from pyflowlauncher import Plugin, Result, Method
76+
from pyflowlauncher.result import ResultResponse
77+
78+
plugin = Plugin()
79+
80+
81+
class Query(Method):
82+
83+
def __call__(self, query: str) -> ResultResponse:
84+
r = Result(
85+
Title="This is a title!",
86+
SubTitle="This is the subtitle!"
87+
)
88+
self.add_result(r)
89+
return self.return_results()
90+
91+
plugin.add_method(Query())
92+
plugin.run()
93+
```

0 commit comments

Comments
 (0)