From 584d35478d9917007333b32377a1f9163f011229 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Sun, 28 Oct 2018 12:17:12 +0000 Subject: [PATCH] Install todoist integration --- Pipfile | 1 + Pipfile.lock | 30 +++++++++++++++++++++++++++++- app/config.py | 2 ++ app/server.py | 3 +++ 4 files changed, 35 insertions(+), 1 deletion(-) diff --git a/Pipfile b/Pipfile index 05a874a..28480bb 100644 --- a/Pipfile +++ b/Pipfile @@ -8,6 +8,7 @@ flask = "*" github-webhook = "*" waitress = "*" sentry-sdk = {extras = ["flask"], version = "*"} +todoist-python = "*" [dev-packages] black = "*" diff --git a/Pipfile.lock b/Pipfile.lock index ff36693..0ac272c 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "58c4cc1fbede1ecde2fdcb0ab61f0fc0e69181d19efded93bc76229f761814ac" + "sha256": "e36b7bdaee5f7529008d66a6326263574d1a54fe085aba1442d042b679d6a3ab" }, "pipfile-spec": 6, "requires": { @@ -30,6 +30,13 @@ ], "version": "==2018.10.15" }, + "chardet": { + "hashes": [ + "sha256:84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae", + "sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691" + ], + "version": "==3.0.4" + }, "click": { "hashes": [ "sha256:2335065e6395b9e67ca716de5f7526736bfa6ceead690adf616d925bdc622b13", @@ -53,6 +60,13 @@ "index": "pypi", "version": "==1.0.2" }, + "idna": { + "hashes": [ + "sha256:156a6814fb5ac1fc6850fb002e0852d56c0c8d2531923a51032d1b70760e186e", + "sha256:684a38a6f903c1d71d6d5fac066b58d7768af4de2b832e426ec79c30daa94a16" + ], + "version": "==2.7" + }, "itsdangerous": { "hashes": [ "sha256:321b033d07f2a4136d3ec762eac9f16a10ccd60f53c0c91af90217ace7ba1f19", @@ -73,6 +87,13 @@ ], "version": "==1.0" }, + "requests": { + "hashes": [ + "sha256:99dcfdaaeb17caf6e526f32b6a7b780461512ab3f1d992187801694cba42770c", + "sha256:a84b8c9ab6239b578f22d1c21d51b696dcfe004032bb80ea832398d6909d7279" + ], + "version": "==2.20.0" + }, "sentry-sdk": { "extras": [ "flask" @@ -91,6 +112,13 @@ ], "version": "==1.11.0" }, + "todoist-python": { + "hashes": [ + "sha256:b362ec7296886f6fdb1e4fb367ee33dfb5903f1fbe0f7626543f58294b6df7d0" + ], + "index": "pypi", + "version": "==7.0.18" + }, "urllib3": { "hashes": [ "sha256:41c3db2fc01e5b907288010dec72f9d0a74e37d6994e6eb56849f59fea2265ae", diff --git a/app/config.py b/app/config.py index 60a8656..4c9665a 100644 --- a/app/config.py +++ b/app/config.py @@ -3,3 +3,5 @@ import os GITHUB_WEBHOOK_SECRET = os.environ.get("GITHUB_WEBHOOK_SECRET") SENTRY_DSN = os.environ.get("SENTRY_DSN") + +TODOIST_API_TOKEN = os.environ.get("TODOIST_API_TOKEN") diff --git a/app/server.py b/app/server.py index ad26e14..2641f19 100644 --- a/app/server.py +++ b/app/server.py @@ -5,6 +5,7 @@ import sentry_sdk from flask import Flask, abort, jsonify from github_webhook import Webhook from sentry_sdk.integrations.flask import FlaskIntegration +from todoist import TodoistAPI from . import config @@ -13,6 +14,8 @@ logging.basicConfig(level=logging.INFO) if config.SENTRY_DSN: sentry_sdk.init(dsn=config, integrations=[FlaskIntegration()]) +todoist = TodoistAPI(config.TODOIST_API_TOKEN) + app = Flask(__name__) webhook = Webhook(app, secret=config.GITHUB_WEBHOOK_SECRET)