Add Heroku support.

master
Andrew Williams 2014-11-15 19:38:44 +00:00
parent 32fe3f277a
commit 7e226f2255
6 changed files with 101 additions and 2 deletions

58
.gitignore vendored Normal file
View File

@ -0,0 +1,58 @@
# Created by .gitignore support plugin (hsz.mobi)
### Python template
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
# C extensions
*.so
# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.cache
nosetests.xml
coverage.xml
# Translations
*.mo
*.pot
# Django stuff:
*.log
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# IDEA
.idea/

1
Procfile Normal file
View File

@ -0,0 +1 @@
nextaction: python nextaction.py

View File

@ -25,3 +25,25 @@ Parallel list processing
------
If a list name ends with `=`, the top level of tasks will be treated as parallel `@next_action`s.
The waterfall processing will be applied the same way as sequential lists - every parent task will be treated as sequential. This can be overridden by appending `=` to the name of the parent task.
Executing NextAction
====================
You can run NexAction from any system that supports Python, and also deploy to Heroku as a constant running service
Running NextAction
------------------
NextAction will read your environment to retrieve your Todoist API key, so to run on a Linux/Mac OSX you can use the following commandline
TODOIST_API_KEY="XYZ" python nextaction.py
Heroku Support
--------------
[![Deploy](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy)
This package is ready to be pushed to a Heroku instance with minimal configuration values:
* ```TODOIST_API_KEY``` - Your Todoist API Key
* ```TODOIST_NEXT_ACTION_LABEL``` - The label to use in Todoist for next actions (defaults to next_action)

16
app.json Normal file
View File

@ -0,0 +1,16 @@
{
"name": "NextAction",
"description": "Todoist API application to provide a auto-populated next action label",
"repository": "https://github.com/nikdoof/NextAction",
"keywords": ["python"],
"env": {
"TODOIST_API_KEY": {
"description": "Your Todoist API Key",
"required": true
},
"TODOIST_NEXT_ACTION_LABEL": {
"description": "The Todoist label to use for next actions.",
"value": "next_action",
"required": false
}
}

View File

@ -9,9 +9,10 @@ import logging
import time
import urllib
import urllib2
import os
API_TOKEN = 'API TOKEN HERE'
NEXT_ACTION_LABEL = u'next_action'
API_TOKEN = os.environ.get('TODOIST_API_KEY', None)
NEXT_ACTION_LABEL = os.environ.get('TODOIST_NEXT_ACTION_LABEL', 'next_action')
TODOIST_VERSION = '5.3'
class TraversalState(object):

1
requirements.txt Normal file
View File

@ -0,0 +1 @@
python-dateutil