diff options
author | Johannes Löthberg <johannes@kyriasis.com> | 2014-12-17 00:07:36 +0100 |
---|---|---|
committer | Johannes Löthberg <johannes@kyriasis.com> | 2014-12-17 00:07:36 +0100 |
commit | ae89107640d13aba99bb5085bc52a49d59ef0a24 (patch) | |
tree | aed3ac571527ce4c7b8cb045c0dafb2c33341902 | |
parent | ffa63f6f0b9542771f13af87ba8147d79ed29667 (diff) | |
download | todo-ae89107640d13aba99bb5085bc52a49d59ef0a24.tar.xz |
todo: switch from pytoml to toml
seemd toml can serialize too now.
-rw-r--r-- | todo | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -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) |