aboutsummaryrefslogtreecommitdiffstats
path: root/todo
diff options
context:
space:
mode:
authorJohannes Löthberg <johannes@kyriasis.com>2014-12-17 00:07:36 +0100
committerJohannes Löthberg <johannes@kyriasis.com>2014-12-17 00:07:36 +0100
commit2fc60f6ae61e233405b059545ef1b7c45f210151 (patch)
tree1eb0f720184d80c0788c6e9751ec1ebb3f3f85d7 /todo
parent37ce8d89a293000579caefe3e01e4d2073c42d63 (diff)
downloadbin-2fc60f6ae61e233405b059545ef1b7c45f210151.tar.xz
todo: switch from pytoml to toml
seemd toml can serialize too now.
Diffstat (limited to 'todo')
-rw-r--r--todo7
1 files changed, 3 insertions, 4 deletions
diff --git a/todo b/todo
index 56c6657..fbe51eb 100644
--- a/todo
+++ b/todo
@@ -16,7 +16,7 @@ from sys import exit
from collections import OrderedDict
from os import getenv, path
from docopt import docopt
-import pytoml
+import toml
def sort_toml(toml_dict, sort_key, rev=False):
@@ -60,10 +60,9 @@ def main():
config = parse_args(arguments)
print(arguments)
- with open("/home/kyrias/documents/notes/TODO.toml", "rt") as in_file:
- tasks = in_file.read()
+ todo_dict = toml.load(config.todo_file)
- unsorted = OrderedDict(sorted(pytoml.loads(tasks).items()))
+ unsorted = OrderedDict(sorted(todo_dict.items()))
sorted_toml = OrderedDict(sort_toml(unsorted, config.sort_key, config.reverse))
print(sorted_toml)