Skip to content

Commit

Permalink
Merge branch 'release/v1.9'
Browse files Browse the repository at this point in the history
  • Loading branch information
deanishe committed Sep 25, 2014
2 parents 4ae1e6c + 91ac8fd commit 8b8e9a1
Show file tree
Hide file tree
Showing 116 changed files with 2,552 additions and 553 deletions.
6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ language: objective-c
python:
- 2.6
- 2.7
before_install:
- brew update
- brew install duti
- sudo duti -s com.apple.TextEdit alfredworkflow all
install:
- sudo pip install nose coverage coveralls yanc
script: bash run-tests.sh
after_success:
- cd tests
- coveralls
- coveralls
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ A helper library in Python for authors of workflows for [Alfred 2](http://www.al
- 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.

## Installation ##

Expand Down Expand Up @@ -200,6 +201,7 @@ Currently, there is Travis-CI integration, but also a `run-tests.sh` script in t

- [Dean Jackson](https://github.com/deanishe)
- [Stephen Margheim](https://github.com/smargh)
- [Fabio Niephaus](https://github.com/fniephaus)

## Tests ##

Expand Down
66 changes: 36 additions & 30 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,31 +1,34 @@
A Python helper library for `Alfred 2 <http://www.alfredapp.com/>`_ Workflow
authors.

Alfred Workflows typically take user input, fetch data from the Web or
A Python helper library for writing `Alfred 2`_ workflows.

Alfred workflows typically take user input, fetch data from the Web or
elsewhere, filter them and display results to the user. **Alfred-Workflow**
helps you do these things.

There are convenience methods for:

* Parsing script arguments.
* Text decoding/normalisation.
* Storing data and settings.
* Caching data from, e.g., web services with a simple API for updating expired
data.
* Securely storing (and syncing) passwords using OS X Keychain.
* Generating XML output for Alfred.
* Including external libraries (adding directories to ``sys.path``).
* Filtering results using an Alfred-like, fuzzy search algorithm.
* Generating log output for debugging.
* Running background processes to keep your workflow responsive.
* Capturing errors, so the workflow doesn't fail silently.
takes care of a lot of the details for you, allowing you to concentrate your
efforts on your workflow's functionality.

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.

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
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``):

Expand Down Expand Up @@ -53,7 +56,7 @@ Language ``/usr/bin/python`` and paste the following into the **Script** field
sys.exit(wf.run(main))
Add an **Open URL** action to your Workflow with ``{query}`` as the **URL**,
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.

Expand All @@ -76,21 +79,18 @@ their system Python.
From source
-----------

Download the ``alfred-workflow-X.X.zip`` file from the
`GitHub releases page <https://github.com/deanishe/alfred-workflow/releases>`_
Download the ``alfred-workflow-X.X.zip`` file from the `GitHub releases`_ page
and either extract the ZIP to the root directory of your workflow (where
``info.plist`` is) or place the ZIP in the root directory and add
``sys.path.insert(0, 'alfred-workflow-X.X.zip')`` to the top of your
Python scripts.

Alternatively, you can download
`the source code <https://github.com/deanishe/alfred-workflow/archive/master.zip>`_
from the `GitHub repository <https://github.com/deanishe/alfred-workflow>`_ and
copy the ``workflow`` subfolder to the root directory of your Workflow.
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 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
Expand Down Expand Up @@ -118,3 +118,9 @@ Documentation

Detailed documentation, including a tutorial and API docs, is
available at `Read the Docs <http://alfredworkflow.readthedocs.org/en/latest/>`_.

.. _requests: http://docs.python-requests.org/en/latest/
.. _Alfred 2: 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
15 changes: 9 additions & 6 deletions TODO
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,25 @@ Features to Add:


background.py:
- Add `stop_process()` function.
- Add `kill_process()` function.
Allow `killing` of running processes. Can be used for stopping servers.
- Add file-locking to prevent `Workflow` from reading half-written files @priority(3) @v2


update.py:
- Integrate Fabio's update feature
- Generalise update functionality
- Integrate Fabio's update feature @done(14-09-14 19:50)
- Generalise update functionality @v2
Use subclass-based plugin feature to automatically register updaters?
- Allow omission of `v` in version specified in `update_settings` @done(14-09-14 22:14)
- Perform download & installation in the background, so Workflow can inform user that an update is being performed @priority(1)


web.py:


workflow.py:
- `filter()` should warn when comparing Unicode and `str` objects @priority(2)
- move "magic" args to class-level dictionary, so authors can add their own. @priority(1)
- `filter()` should warn when comparing Unicode and `str` objects @priority(3)
- move "magic" args to class-level dictionary, so authors can add their own. @priority(2) @v2


Docs:
Expand Down Expand Up @@ -47,7 +50,7 @@ Features to Consider:


handlers.py:
Module to provide system-default apps for protocols like `http`, `mailto` etc.
Module to provide system-default apps for protocols like `http`, `mailto` etc.


ui.py:
Expand Down
Binary file modified alfred-workflow.zip
Binary file not shown.
5 changes: 4 additions & 1 deletion build-docs.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

basedir=$(cd $(dirname $0); pwd)
docdir="${basedir}/doc"
docdir="${basedir}/docs"
testdir="${basedir}/tests"
curdir=$(pwd)

Expand All @@ -14,6 +14,9 @@ curdir=$(pwd)
# fi

cd "${docdir}"
if [[ -d _build/html ]]; then
rm -rf _build/html
fi
make html
cd "${curdir}"

Expand Down
200 changes: 0 additions & 200 deletions doc/index.rst

This file was deleted.

Loading

0 comments on commit 8b8e9a1

Please sign in to comment.