From 5c625fb41f4cbbec25b2fa5c851de75235f21af2 Mon Sep 17 00:00:00 2001 From: Benjamin Chausse Date: Sun, 4 Nov 2018 19:08:28 -0500 Subject: Widget now uses the API key provided in the todoist_API.txt file --- inbox_for_todoist.widget/todoist.cache | Bin 6 -> 25656 bytes inbox_for_todoist.widget/todoistinbox.py | 5 ++++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/inbox_for_todoist.widget/todoist.cache b/inbox_for_todoist.widget/todoist.cache index 482c0e3..1342982 100644 Binary files a/inbox_for_todoist.widget/todoist.cache and b/inbox_for_todoist.widget/todoist.cache differ diff --git a/inbox_for_todoist.widget/todoistinbox.py b/inbox_for_todoist.widget/todoistinbox.py index 52443bc..6207da4 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) -- cgit v1.2.3 From e2cdd12a227a8fad949d4b3c4b9f98d7ff67d6d6 Mon Sep 17 00:00:00 2001 From: Benjamin Chausse Date: Sun, 4 Nov 2018 19:10:46 -0500 Subject: Widget now uses the API key provided in the todoist_API.txt file --- inbox_for_todoist.widget/todoist.cache | Bin 25656 -> 25656 bytes inbox_for_todoist.widget/todoistinbox.py | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/inbox_for_todoist.widget/todoist.cache b/inbox_for_todoist.widget/todoist.cache index 1342982..5fe4d71 100644 Binary files a/inbox_for_todoist.widget/todoist.cache and b/inbox_for_todoist.widget/todoist.cache differ diff --git a/inbox_for_todoist.widget/todoistinbox.py b/inbox_for_todoist.widget/todoistinbox.py index 6207da4..c49d3f5 100644 --- a/inbox_for_todoist.widget/todoistinbox.py +++ b/inbox_for_todoist.widget/todoistinbox.py @@ -5,7 +5,7 @@ import os 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 + 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: @@ -21,7 +21,7 @@ def main(): elif i['priority'] == 3: pri = "

" elif i['priority'] == 4: - pri = "

" # FIXME: Color coding not working... + pri = "

" rank += 1 print(pri, "", rank, '- ', i['content'], "

") # print name and id -- cgit v1.2.3 From f601d27a7d2525735eb833bee2cdb4cd67884b5d Mon Sep 17 00:00:00 2001 From: Benjamin Chausse Date: Sun, 4 Nov 2018 19:13:43 -0500 Subject: removed useless api txt file --- todoist_API.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 todoist_API.txt diff --git a/todoist_API.txt b/todoist_API.txt deleted file mode 100644 index 85e72fa..0000000 --- a/todoist_API.txt +++ /dev/null @@ -1 +0,0 @@ -___YOUR TODOIST TOKEN HERE:___ -- cgit v1.2.3 From bc935b67ed0c97aa6a39a0c441579f8f820f81d0 Mon Sep 17 00:00:00 2001 From: Benjamin Chausse <19275615+ChausseBenjamin@users.noreply.github.com> Date: Sun, 4 Nov 2018 19:15:31 -0500 Subject: Create todoist_API.txt --- inbox_for_todoist.widget/todoist_API.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 inbox_for_todoist.widget/todoist_API.txt diff --git a/inbox_for_todoist.widget/todoist_API.txt b/inbox_for_todoist.widget/todoist_API.txt new file mode 100644 index 0000000..85e72fa --- /dev/null +++ b/inbox_for_todoist.widget/todoist_API.txt @@ -0,0 +1 @@ +___YOUR TODOIST TOKEN HERE:___ -- cgit v1.2.3 From cfb8305d1ac36b3c47946de91e84c7a6d677dbe0 Mon Sep 17 00:00:00 2001 From: Benjamin Chausse Date: Sun, 4 Nov 2018 19:35:23 -0500 Subject: Updated README.md to recent changes brought to the widget --- README.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 4335cd6..1cf69be 100644 --- a/README.md +++ b/README.md @@ -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 merge 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 -- cgit v1.2.3 From 4fc103c314500f5142f29450c61ae77aec8f03f7 Mon Sep 17 00:00:00 2001 From: Benjamin Chausse Date: Sun, 4 Nov 2018 19:36:59 -0500 Subject: Dumb grammar mistake in README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1cf69be..9a668e2 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ The `inbox_for_todoist` folder contains a file named `todoist_API.txt`. In that 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 merge 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`. +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 ### -- cgit v1.2.3