-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
6,033 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,150 @@ | ||
A helper library for writing `Alfred 2 and 3`_ workflows. | ||
|
||
Supports OS X 10.6+ and Python 2.6 and 2.7 (Alfred 3 is 10.9+/2.7 only). | ||
|
||
Alfred-Workflow is designed to take the grunt work out of writing a workflow. | ||
|
||
It gives you the tools to create a fast and featureful Alfred workflow from an API, application or library in minutes. | ||
|
||
http://www.deanishe.net/alfred-workflow/ | ||
|
||
|
||
Features | ||
======== | ||
|
||
* Catches and logs workflow errors for easier development and support | ||
* "Magic" arguments to help development/debugging | ||
* Auto-saves settings | ||
* Super-simple data caching | ||
* Fuzzy, Alfred-like search/filtering with diacritic folding | ||
* Keychain support for secure storage (and syncing) of passwords, API keys etc. | ||
* Simple generation of Alfred feedback (XML output) | ||
* Input/output decoding for handling non-ASCII text | ||
* Lightweight web API with modelled on `requests`_ | ||
* Pre-configured logging | ||
* Painlessly add directories to ``sys.path`` | ||
* Easily launch background tasks (daemons) to keep your workflow responsive | ||
* Check for new versions and update workflows hosted on GitHub. | ||
* Post notifications via Notification Center. | ||
|
||
|
||
Alfred 3-only features | ||
---------------------- | ||
|
||
* Set `workflow variables`_ from code | ||
* Advanced modifiers | ||
* Alfred 3-only updates (won't break Alfred 2 installs) | ||
* Re-running Script Filters | ||
|
||
|
||
Quick Example | ||
============= | ||
|
||
Here's how to show recent `Pinboard.in <https://pinboard.in/>`_ posts | ||
in Alfred. | ||
|
||
Create a new workflow in Alfred's preferences. Add a **Script Filter** with | ||
Language ``/usr/bin/python`` and paste the following into the **Script** | ||
field (changing ``API_KEY``): | ||
|
||
|
||
.. code-block:: python | ||
import sys | ||
from workflow import Workflow, ICON_WEB, web | ||
API_KEY = 'your-pinboard-api-key' | ||
def main(wf): | ||
url = 'https://api.pinboard.in/v1/posts/recent' | ||
params = dict(auth_token=API_KEY, count=20, format='json') | ||
r = web.get(url, params) | ||
r.raise_for_status() | ||
for post in r.json()['posts']: | ||
wf.add_item(post['description'], post['href'], arg=post['href'], | ||
uid=post['hash'], valid=True, icon=ICON_WEB) | ||
wf.send_feedback() | ||
if __name__ == u"__main__": | ||
wf = Workflow() | ||
sys.exit(wf.run(main)) | ||
Add an **Open URL** action to your workflow with ``{query}`` as the **URL**, | ||
connect your **Script Filter** to it, and you can now hit **ENTER** on a | ||
Pinboard item in Alfred to open it in your browser. | ||
|
||
|
||
Installation | ||
============ | ||
|
||
**Note**: If you intend to distribute your workflow to other users, you | ||
should include Alfred-Workflow (and other Python libraries your workflow | ||
requires) within your workflow's directory as described below. **Do not** | ||
ask users to install anything into their system Python. Python installations | ||
cannot support multiple versions of the same library, so if you rely on | ||
globally-installed libraries, the chances are very good that your workflow | ||
will sooner or later break—or be broken by—some other software doing the | ||
same naughty thing. | ||
|
||
|
||
With pip | ||
-------- | ||
|
||
You can install Alfred-Workflow directly into your workflow with:: | ||
|
||
# from within your workflow directory | ||
pip install --target=. Alfred-Workflow | ||
|
||
You can install any other library available on the `Cheese Shop`_ the | ||
same way. See the `pip documentation`_ for more information. | ||
|
||
|
||
>From source | ||
----------- | ||
|
||
Download the ``alfred-workflow-X.X.X.zip`` file from the `GitHub releases`_ page | ||
and extract the ZIP to the root directory of your workflow (where | ||
``info.plist`` is). | ||
|
||
Alternatively, you can download `the source code`_ from the `GitHub repository`_ | ||
and copy the ``workflow`` subfolder to the root directory of your workflow. | ||
|
||
Your workflow directory should look something like this (where | ||
``yourscript.py`` contains your workflow code and ``info.plist`` is | ||
the workflow information file generated by Alfred):: | ||
|
||
Your Workflow/ | ||
info.plist | ||
icon.png | ||
workflow/ | ||
__init__.py | ||
background.py | ||
notify.py | ||
Notify.tgz | ||
update.py | ||
version | ||
web.py | ||
workflow.py | ||
yourscript.py | ||
etc. | ||
|
||
|
||
Documentation | ||
============= | ||
|
||
Detailed documentation, including a tutorial, is available at | ||
http://www.deanishe.net/alfred-workflow/. | ||
|
||
.. _v2 branch: https://github.com/deanishe/alfred-workflow/tree/v2 | ||
.. _requests: http://docs.python-requests.org/en/latest/ | ||
.. _Alfred 2 and 3: http://www.alfredapp.com/ | ||
.. _GitHub releases: https://github.com/deanishe/alfred-workflow/releases | ||
.. _the source code: https://github.com/deanishe/alfred-workflow/archive/master.zip | ||
.. _GitHub repository: https://github.com/deanishe/alfred-workflow | ||
.. _Cheese Shop: https://pypi.python.org/pypi | ||
.. _pip documentation: https://pip.pypa.io/en/latest/ | ||
.. _workflow variables: http://www.deanishe.net/alfred-workflow/user-manual/workflow-variables.html | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,170 @@ | ||
Metadata-Version: 2.0 | ||
Name: Alfred-Workflow | ||
Version: 1.26 | ||
Summary: Full-featured helper library for writing Alfred 2/3 workflows | ||
Home-page: http://www.deanishe.net/alfred-workflow/ | ||
Author: Dean Jackson | ||
Author-email: [email protected] | ||
License: UNKNOWN | ||
Keywords: alfred workflow | ||
Platform: UNKNOWN | ||
Classifier: Development Status :: 5 - Production/Stable | ||
Classifier: License :: OSI Approved :: MIT License | ||
Classifier: Operating System :: MacOS :: MacOS X | ||
Classifier: Intended Audience :: Developers | ||
Classifier: Natural Language :: English | ||
Classifier: Programming Language :: Python :: 2.6 | ||
Classifier: Programming Language :: Python :: 2.7 | ||
Classifier: Topic :: Software Development :: Libraries | ||
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks | ||
|
||
A helper library for writing `Alfred 2 and 3`_ workflows. | ||
|
||
Supports OS X 10.6+ and Python 2.6 and 2.7 (Alfred 3 is 10.9+/2.7 only). | ||
|
||
Alfred-Workflow is designed to take the grunt work out of writing a workflow. | ||
|
||
It gives you the tools to create a fast and featureful Alfred workflow from an API, application or library in minutes. | ||
|
||
http://www.deanishe.net/alfred-workflow/ | ||
|
||
|
||
Features | ||
======== | ||
|
||
* Catches and logs workflow errors for easier development and support | ||
* "Magic" arguments to help development/debugging | ||
* Auto-saves settings | ||
* Super-simple data caching | ||
* Fuzzy, Alfred-like search/filtering with diacritic folding | ||
* Keychain support for secure storage (and syncing) of passwords, API keys etc. | ||
* Simple generation of Alfred feedback (XML output) | ||
* Input/output decoding for handling non-ASCII text | ||
* Lightweight web API with modelled on `requests`_ | ||
* Pre-configured logging | ||
* Painlessly add directories to ``sys.path`` | ||
* Easily launch background tasks (daemons) to keep your workflow responsive | ||
* Check for new versions and update workflows hosted on GitHub. | ||
* Post notifications via Notification Center. | ||
|
||
|
||
Alfred 3-only features | ||
---------------------- | ||
|
||
* Set `workflow variables`_ from code | ||
* Advanced modifiers | ||
* Alfred 3-only updates (won't break Alfred 2 installs) | ||
* Re-running Script Filters | ||
|
||
|
||
Quick Example | ||
============= | ||
|
||
Here's how to show recent `Pinboard.in <https://pinboard.in/>`_ posts | ||
in Alfred. | ||
|
||
Create a new workflow in Alfred's preferences. Add a **Script Filter** with | ||
Language ``/usr/bin/python`` and paste the following into the **Script** | ||
field (changing ``API_KEY``): | ||
|
||
|
||
.. code-block:: python | ||
|
||
import sys | ||
from workflow import Workflow, ICON_WEB, web | ||
|
||
API_KEY = 'your-pinboard-api-key' | ||
|
||
def main(wf): | ||
url = 'https://api.pinboard.in/v1/posts/recent' | ||
params = dict(auth_token=API_KEY, count=20, format='json') | ||
r = web.get(url, params) | ||
r.raise_for_status() | ||
for post in r.json()['posts']: | ||
wf.add_item(post['description'], post['href'], arg=post['href'], | ||
uid=post['hash'], valid=True, icon=ICON_WEB) | ||
wf.send_feedback() | ||
|
||
|
||
if __name__ == u"__main__": | ||
wf = Workflow() | ||
sys.exit(wf.run(main)) | ||
|
||
|
||
Add an **Open URL** action to your workflow with ``{query}`` as the **URL**, | ||
connect your **Script Filter** to it, and you can now hit **ENTER** on a | ||
Pinboard item in Alfred to open it in your browser. | ||
|
||
|
||
Installation | ||
============ | ||
|
||
**Note**: If you intend to distribute your workflow to other users, you | ||
should include Alfred-Workflow (and other Python libraries your workflow | ||
requires) within your workflow's directory as described below. **Do not** | ||
ask users to install anything into their system Python. Python installations | ||
cannot support multiple versions of the same library, so if you rely on | ||
globally-installed libraries, the chances are very good that your workflow | ||
will sooner or later break—or be broken by—some other software doing the | ||
same naughty thing. | ||
|
||
|
||
With pip | ||
-------- | ||
|
||
You can install Alfred-Workflow directly into your workflow with:: | ||
|
||
# from within your workflow directory | ||
pip install --target=. Alfred-Workflow | ||
|
||
You can install any other library available on the `Cheese Shop`_ the | ||
same way. See the `pip documentation`_ for more information. | ||
|
||
|
||
>From source | ||
----------- | ||
|
||
Download the ``alfred-workflow-X.X.X.zip`` file from the `GitHub releases`_ page | ||
and extract the ZIP to the root directory of your workflow (where | ||
``info.plist`` is). | ||
|
||
Alternatively, you can download `the source code`_ from the `GitHub repository`_ | ||
and copy the ``workflow`` subfolder to the root directory of your workflow. | ||
|
||
Your workflow directory should look something like this (where | ||
``yourscript.py`` contains your workflow code and ``info.plist`` is | ||
the workflow information file generated by Alfred):: | ||
|
||
Your Workflow/ | ||
info.plist | ||
icon.png | ||
workflow/ | ||
__init__.py | ||
background.py | ||
notify.py | ||
Notify.tgz | ||
update.py | ||
version | ||
web.py | ||
workflow.py | ||
yourscript.py | ||
etc. | ||
|
||
|
||
Documentation | ||
============= | ||
|
||
Detailed documentation, including a tutorial, is available at | ||
http://www.deanishe.net/alfred-workflow/. | ||
|
||
.. _v2 branch: https://github.com/deanishe/alfred-workflow/tree/v2 | ||
.. _requests: http://docs.python-requests.org/en/latest/ | ||
.. _Alfred 2 and 3: http://www.alfredapp.com/ | ||
.. _GitHub releases: https://github.com/deanishe/alfred-workflow/releases | ||
.. _the source code: https://github.com/deanishe/alfred-workflow/archive/master.zip | ||
.. _GitHub repository: https://github.com/deanishe/alfred-workflow | ||
.. _Cheese Shop: https://pypi.python.org/pypi | ||
.. _pip documentation: https://pip.pypa.io/en/latest/ | ||
.. _workflow variables: http://www.deanishe.net/alfred-workflow/user-manual/workflow-variables.html | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
Alfred_Workflow-1.26.dist-info/DESCRIPTION.rst,sha256=bMU7zRG-Bk-ae5vSLr60iZ5JjCJeMIJmsRC34CNhtLA,4873 | ||
Alfred_Workflow-1.26.dist-info/METADATA,sha256=RyVD-Zbp7C9xcqLAr8-xLxFkhzwm4csJz7K_7nwv_Ss,5649 | ||
Alfred_Workflow-1.26.dist-info/RECORD,, | ||
Alfred_Workflow-1.26.dist-info/WHEEL,sha256=BtVfdXUcEYLcFjOkbIrCFRyXU4qszVPt-E9o3RWkSNw,93 | ||
Alfred_Workflow-1.26.dist-info/metadata.json,sha256=M2M6RvBD9jY1zJ8IaOswU0RnS613coAZIX5RPjN74Ek,997 | ||
Alfred_Workflow-1.26.dist-info/top_level.txt,sha256=jT-znOUjxvwdr-w5ECrvROWZ9y_Doiz0yVYSI0VxpXA,9 | ||
workflow/Notify.tgz,sha256=dfcN09jNo0maLZLIZDSsBDouynsjgtDMSnSL3UfFcRE,35556 | ||
workflow/__init__.py,sha256=TYV5msCqhyzalnx-qFQ0ct74Lvtopx40A_4IMkj95oE,2063 | ||
workflow/background.py,sha256=kAGACf7Q6mPRF62nOH9wzEqcjXetj-AuUcohF3PvMs8,6340 | ||
workflow/notify.py,sha256=7DxDKAxISvs7eLwk27bRhV60PX6Uq_fTkx4dzfbEFAw,10565 | ||
workflow/update.py,sha256=PQF5ON8IFoIkPHKvjLKpW8wNCbqlBRjPR2NkYUa6CyE,12130 | ||
workflow/version,sha256=5pSN8Atz5QAhrYMlaGIxg78LQ6c51pPxRMpNBYjyxbc,4 | ||
workflow/web.py,sha256=zkSL4n8uYYuhp5H3ynqMMdNb_gUv2qODBLP-rxY0LiU,20447 | ||
workflow/workflow.py,sha256=zimluURA4FoT5C6UNUFNo0P49sLdSHDO0lfa2BhsMLk,98098 | ||
workflow/workflow3.py,sha256=H-HKuXZu9lR98pBMiyXzCcisZ7t9IKRqrkt4wGD4SUA,16568 | ||
Alfred_Workflow-1.26.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4 | ||
workflow/notify.pyc,, | ||
workflow/workflow3.pyc,, | ||
workflow/__init__.pyc,, | ||
workflow/workflow.pyc,, | ||
workflow/update.pyc,, | ||
workflow/web.pyc,, | ||
workflow/background.pyc,, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Wheel-Version: 1.0 | ||
Generator: bdist_wheel (0.29.0) | ||
Root-Is-Purelib: true | ||
Tag: cp27-none-any | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"classifiers": ["Development Status :: 5 - Production/Stable", "License :: OSI Approved :: MIT License", "Operating System :: MacOS :: MacOS X", "Intended Audience :: Developers", "Natural Language :: English", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Application Frameworks"], "extensions": {"python.details": {"contacts": [{"email": "[email protected]", "name": "Dean Jackson", "role": "author"}], "document_names": {"description": "DESCRIPTION.rst"}, "project_urls": {"Home": "http://www.deanishe.net/alfred-workflow/"}}}, "generator": "bdist_wheel (0.29.0)", "keywords": ["alfred", "workflow"], "metadata_version": "2.0", "name": "Alfred-Workflow", "summary": "Full-featured helper library for writing Alfred 2/3 workflows", "test_requires": [{"requires": ["coverage", "pytest", "pytest-cov", "pytest-httpbin", "pytest-localserver"]}], "version": "1.26"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
workflow |
Oops, something went wrong.