diff options
author | Benjamin Chausse <19275615+ChausseBenjamin@users.noreply.github.com> | 2018-11-04 19:37:34 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-04 19:37:34 -0500 |
commit | d2414ad11d3f246b2364b91988ba97f9ef1fb411 (patch) | |
tree | 2efedf7fe5ab53b9b1a22d34f3b2dae567b45b3d | |
parent | f1386b408a5a7613c4a540fdc68c01f9597f92c4 (diff) | |
parent | 4fc103c314500f5142f29450c61ae77aec8f03f7 (diff) |
Merge pull request #3 from ChausseBenjamin/API-management
Api management
-rw-r--r-- | README.md | 12 | ||||
-rw-r--r-- | inbox_for_todoist.widget/todoist.cache | bin | 6 -> 25656 bytes | |||
-rw-r--r-- | inbox_for_todoist.widget/todoistinbox.py | 7 |
3 files changed, 14 insertions, 5 deletions
@@ -16,12 +16,14 @@ Clone this repository to your Übersicht folder: `~/Library/Application Support/Übersicht/widgets/` ### Setting up your own Todoist Token ### -On the second line of the `todoistinbox.py` file, replace +The `inbox_for_todoist` folder contains a file named `todoist_API.txt`. In that file, replace `___YOUR TODOIST TOKEN HERE:___` (keep the ' ' for it to work) with your very own todoist API token. You todoist token can be found on [Todoist](https://todoist.com) inside of `settings` and then `Integrations`. It will be labelled as `API Token`. +Rest assured that if you submit a pull request, your token will not be shared as `todoist_API.txt` has been set to be ignored by github inside the `.gitignore` file `line: 108`. Also none of your tasks stored inside your offline cache will be shared as `todoist.cache` has been set to be ignored by github inside the `.gitignore` file `line: 105`. + ## Preferences ## ### Refresh Rate ### By default, Inbox for Todoist refreshes every second. To reduce CPU & Memory Usage, you may go to line 5 of `index.coffee` and adjust this: @@ -42,10 +44,14 @@ The following line to edit are: The default color for the widget is `rgba(#F2F2F2, 1.0)`. +## Recent Updates ## +- `2018-11-04` Widget now keeps an offline cache of your tasks + - No more Error messages when you computer's offline (due to cache) +- `2018-11-04` API keys are stored on a .txt file outside the script. (`todoist_API.txt`) +- `2018-10-03` Priority color coding Support + ## Possible Eventual Improvements ## (checked items are under developpement) - [ ] Due Date Sorting - [ ] Todoist Markdown Support -- [x] Keep a record of tasks offline - - [x] Display an `Offline` indicator - [ ] Indent embedded subtasks diff --git a/inbox_for_todoist.widget/todoist.cache b/inbox_for_todoist.widget/todoist.cache Binary files differindex 482c0e3..5fe4d71 100644 --- a/inbox_for_todoist.widget/todoist.cache +++ b/inbox_for_todoist.widget/todoist.cache diff --git a/inbox_for_todoist.widget/todoistinbox.py b/inbox_for_todoist.widget/todoistinbox.py index 52443bc..c49d3f5 100644 --- a/inbox_for_todoist.widget/todoistinbox.py +++ b/inbox_for_todoist.widget/todoistinbox.py @@ -3,7 +3,10 @@ import online import pickle import os -def main(token='___YOUR TODOIST TOKEN HERE:___'): # FIXME: Remove personal token when comitting +def main(): + with open('todoist_API.txt') as f: # Opens the API key file + token = f.readline() # Sets the first line of the txt file as your API Key + if online.main() == False: with open("todoist.cache", "rb") as myFile: loaded_cache = pickle.load(myFile) @@ -18,7 +21,7 @@ def main(token='___YOUR TODOIST TOKEN HERE:___'): # FIXME: Remove personal toke elif i['priority'] == 3: pri = "<p class='priority2'>" elif i['priority'] == 4: - pri = "<p class='priority1'>" # FIXME: Color coding not working... + pri = "<p class='priority1'>" rank += 1 print(pri, "<b>", rank, '- </b>', i['content'], "</p>") # print name and id |