Skip to content

Commit 63c19b9

Browse files
committed
Init
0 parents  commit 63c19b9

2,951 files changed

Lines changed: 946747 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
61.8 KB
Loading
61.8 KB
Loading
Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
Metadata-Version: 1.1
2+
Name: Alfred-Workflow
3+
Version: 1.33
4+
Summary: Full-featured helper library for writing Alfred 2/3 workflows
5+
Home-page: http://www.deanishe.net/alfred-workflow/
6+
Author: Dean Jackson
7+
Author-email: deanishe@deanishe.net
8+
License: UNKNOWN
9+
Description:
10+
A helper library for writing `Alfred 2 and 3`_ workflows.
11+
12+
Supports macOS 10.6+ and Python 2.6 and 2.7 (Alfred 3 is 10.9+/2.7 only).
13+
14+
Alfred-Workflow is designed to take the grunt work out of writing a workflow.
15+
16+
It gives you the tools to create a fast and featureful Alfred workflow from an API, application or library in minutes.
17+
18+
http://www.deanishe.net/alfred-workflow/
19+
20+
21+
Features
22+
========
23+
24+
* Catches and logs workflow errors for easier development and support
25+
* "Magic" arguments to help development/debugging
26+
* Auto-saves settings
27+
* Super-simple data caching
28+
* Fuzzy, Alfred-like search/filtering with diacritic folding
29+
* Keychain support for secure storage (and syncing) of passwords, API keys etc.
30+
* Simple generation of Alfred feedback (XML output)
31+
* Input/output decoding for handling non-ASCII text
32+
* Lightweight web API with modelled on `requests`_
33+
* Pre-configured logging
34+
* Painlessly add directories to ``sys.path``
35+
* Easily launch background tasks (daemons) to keep your workflow responsive
36+
* Check for new versions and update workflows hosted on GitHub.
37+
* Post notifications via Notification Center.
38+
39+
40+
Alfred 3-only features
41+
----------------------
42+
43+
* Set `workflow variables`_ from code
44+
* Advanced modifiers
45+
* Alfred 3-only updates (won't break Alfred 2 installs)
46+
* Re-running Script Filters
47+
48+
49+
Quick Example
50+
=============
51+
52+
Here's how to show recent `Pinboard.in <https://pinboard.in/>`_ posts
53+
in Alfred.
54+
55+
Create a new workflow in Alfred's preferences. Add a **Script Filter** with
56+
Language ``/usr/bin/python`` and paste the following into the **Script**
57+
field (changing ``API_KEY``):
58+
59+
60+
.. code-block:: python
61+
62+
import sys
63+
from workflow import Workflow, ICON_WEB, web
64+
65+
API_KEY = 'your-pinboard-api-key'
66+
67+
def main(wf):
68+
url = 'https://api.pinboard.in/v1/posts/recent'
69+
params = dict(auth_token=API_KEY, count=20, format='json')
70+
r = web.get(url, params)
71+
r.raise_for_status()
72+
for post in r.json()['posts']:
73+
wf.add_item(post['description'], post['href'], arg=post['href'],
74+
uid=post['hash'], valid=True, icon=ICON_WEB)
75+
wf.send_feedback()
76+
77+
78+
if __name__ == u"__main__":
79+
wf = Workflow()
80+
sys.exit(wf.run(main))
81+
82+
83+
Add an **Open URL** action to your workflow with ``{query}`` as the **URL**,
84+
connect your **Script Filter** to it, and you can now hit **ENTER** on a
85+
Pinboard item in Alfred to open it in your browser.
86+
87+
88+
Installation
89+
============
90+
91+
**Note**: If you intend to distribute your workflow to other users, you
92+
should include Alfred-Workflow (and other Python libraries your workflow
93+
requires) within your workflow's directory as described below. **Do not**
94+
ask users to install anything into their system Python. Python installations
95+
cannot support multiple versions of the same library, so if you rely on
96+
globally-installed libraries, the chances are very good that your workflow
97+
will sooner or later break—or be broken by—some other software doing the
98+
same naughty thing.
99+
100+
101+
With pip
102+
--------
103+
104+
You can install Alfred-Workflow directly into your workflow with::
105+
106+
# from within your workflow directory
107+
pip install --target=. Alfred-Workflow
108+
109+
You can install any other library available on the `Cheese Shop`_ the
110+
same way. See the `pip documentation`_ for more information.
111+
112+
113+
From source
114+
-----------
115+
116+
Download the ``alfred-workflow-X.X.X.zip`` file from the `GitHub releases`_
117+
page and extract the ZIP to the root directory of your workflow (where
118+
``info.plist`` is).
119+
120+
Alternatively, you can download `the source code`_ from the `GitHub repository`_
121+
and copy the ``workflow`` subfolder to the root directory of your workflow.
122+
123+
Your workflow directory should look something like this (where
124+
``yourscript.py`` contains your workflow code and ``info.plist`` is
125+
the workflow information file generated by Alfred)::
126+
127+
Your Workflow/
128+
info.plist
129+
icon.png
130+
workflow/
131+
__init__.py
132+
background.py
133+
notify.py
134+
Notify.tgz
135+
update.py
136+
version
137+
web.py
138+
workflow.py
139+
yourscript.py
140+
etc.
141+
142+
143+
Documentation
144+
=============
145+
146+
Detailed documentation, including a tutorial, is available at
147+
http://www.deanishe.net/alfred-workflow/.
148+
149+
.. _v2 branch: https://github.com/deanishe/alfred-workflow/tree/v2
150+
.. _requests: http://docs.python-requests.org/en/latest/
151+
.. _Alfred 2 and 3: http://www.alfredapp.com/
152+
.. _GitHub releases: https://github.com/deanishe/alfred-workflow/releases
153+
.. _the source code: https://github.com/deanishe/alfred-workflow/archive/master.zip
154+
.. _GitHub repository: https://github.com/deanishe/alfred-workflow
155+
.. _Cheese Shop: https://pypi.python.org/pypi
156+
.. _pip documentation: https://pip.pypa.io/en/latest/
157+
.. _workflow variables: http://www.deanishe.net/alfred-workflow/user-manual/workflow-variables.html
158+
159+
Keywords: alfred workflow
160+
Platform: UNKNOWN
161+
Classifier: Development Status :: 5 - Production/Stable
162+
Classifier: License :: OSI Approved :: MIT License
163+
Classifier: Operating System :: MacOS :: MacOS X
164+
Classifier: Intended Audience :: Developers
165+
Classifier: Natural Language :: English
166+
Classifier: Programming Language :: Python :: 2.7
167+
Classifier: Topic :: Software Development :: Libraries
168+
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
MANIFEST.in
2+
README.md
3+
README_PYPI.rst
4+
setup.cfg
5+
setup.py
6+
Alfred_Workflow.egg-info/PKG-INFO
7+
Alfred_Workflow.egg-info/SOURCES.txt
8+
Alfred_Workflow.egg-info/dependency_links.txt
9+
Alfred_Workflow.egg-info/not-zip-safe
10+
Alfred_Workflow.egg-info/top_level.txt
11+
workflow/Notify.tgz
12+
workflow/__init__.py
13+
workflow/background.py
14+
workflow/notify.py
15+
workflow/update.py
16+
workflow/util.py
17+
workflow/version
18+
workflow/web.py
19+
workflow/workflow.py
20+
workflow/workflow3.py
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
.
2+
../workflow/Notify.tgz
3+
../workflow/__init__.py
4+
../workflow/__init__.pyc
5+
../workflow/background.py
6+
../workflow/background.pyc
7+
../workflow/notify.py
8+
../workflow/notify.pyc
9+
../workflow/update.py
10+
../workflow/update.pyc
11+
../workflow/util.py
12+
../workflow/util.pyc
13+
../workflow/version
14+
../workflow/web.py
15+
../workflow/web.pyc
16+
../workflow/workflow.py
17+
../workflow/workflow.pyc
18+
../workflow/workflow3.py
19+
../workflow/workflow3.pyc
20+
PKG-INFO
21+
SOURCES.txt
22+
dependency_links.txt
23+
not-zip-safe
24+
top_level.txt
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
workflow

README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Alfred Workflow: Upload Screenshot to Cloudflare R2 Storage
2+
3+
This workflow helps you upload a screenshot from your clipboard or local disk to Cloudflare R2 and puts the public URL of the image to your clipboard.
4+
5+
## Overview
6+
7+
This workflow is written in Python. It uses Boto3 as the AWS client to upload images.
8+
9+
## Download
10+
11+
https://github.com/PatelUtkarsh/Alfred-Workflow-Upload-R2/releases
12+
13+
## Usage
14+
15+
Check https://www.cloudflare.com/developer-platform/r2/ on how to get environment variables.
16+
17+
Config Environment Variables:
18+
19+
- cf_access_key: Cloudflare access key
20+
- cf_account_id: Cloudflare access secret
21+
- cf_secret_key: Cloudflare access secret
22+
- cf_bucket_name: Cloudflare bucket name. e.g. `my-bucket-name`
23+
- tinypng_api_key: Get your tinypng API key from https://tinypng.com/developers to compress images before uploading.
24+
- shorturl: If you have proxy to bucket via CloudFlare use that url.
25+
26+
Upload image from clipboard:
27+
28+
```bash
29+
upload
30+
```
31+
32+
Upload image from local:
33+
34+
```bash
35+
upload TYPE-FILENAME-HERE
36+
```
37+
38+
Upload clipboard text file:
39+
```bash
40+
pb
41+
```
42+
43+
## Forked source: 🙌
44+
- https://github.com/tonyxu-io/Alfred-Workflow-Upload-S3

icon.png

61.8 KB
Loading

0 commit comments

Comments
 (0)