Implement file attachments.

This commit is contained in:
hiro98 2020-05-02 15:46:34 +02:00
parent 4c43a50763
commit 0ad5336528
2 changed files with 13 additions and 3 deletions

View file

@ -254,6 +254,14 @@ def convert_wunderlist_task(writer, task):
writer.emit() writer.emit()
if task["files"]:
with writer.new_level():
writer.emit_node_title("Files")
for w_file in task["files"]:
convert_wunderlist_file(writer, w_file)
writer.emit()
def convert_wunderlist_comment(writer, comment): def convert_wunderlist_comment(writer, comment):
comment_text = convert_wunderlist_person(comment["author"]) comment_text = convert_wunderlist_person(comment["author"])
@ -261,6 +269,10 @@ def convert_wunderlist_comment(writer, comment):
writer.emit_list_item(comment_text) writer.emit_list_item(comment_text)
def convert_wunderlist_file(writer, w_file):
writer.emit_list_item(f"[[file:{w_file['filePath']}][{w_file['fileName']}]]")
if __name__ == "__main__": if __name__ == "__main__":
if len(sys.argv) < 2: if len(sys.argv) < 2:
print(f"Usage: {sys.argv[0]} [input-file]") print(f"Usage: {sys.argv[0]} [input-file]")

View file

@ -8,6 +8,7 @@ It currently supports:
- Metadata - Metadata
- Reminders - Reminders
- Comments - Comments
- File Attachments
** Usage ** Usage
Extract the wunderlist export and then just point the script to the ~Tasks.json~ file. Extract the wunderlist export and then just point the script to the ~Tasks.json~ file.
@ -20,9 +21,6 @@ This will print out the resulting org-mode file to the terminal.
The script is not configurable at the moments, but I can hack The script is not configurable at the moments, but I can hack
something in if you open an issue. something in if you open an issue.
** TODO File attachments
** Internals ** Internals
The script parses most things and skips things that it can't. So check The script parses most things and skips things that it can't. So check
your resulting org file :). your resulting org file :).