Importer for todo.txt files is ready for testing

28 views
Skip to first unread message

Edward K. Ream

unread,
Mar 10, 2020, 12:39:09 PM3/10/20
to leo-editor
This is #1499, which I have just close. Summary:

The 'import-todo-text-files' command prompts for one or more .txt files and shows the tasks in each file. At present, this command just prints the calculated list of ToDoTask objects.

Scripts or plugins can use the list of ToDoTask objects as follows:

import leo.core.leoImport as leoImport
# path should be a full path to a todo.txt file
tasks
= leoImport.ToDoImporter(c).get_tasks_from_file(path)
g
.printObj(tasks, tag=f"tasks from {path}")

"tasks" is a list of ToDoTask objects, which presents the parsed tasks in an easy-to-use form. Plugins could use the ToDoTask class as is, or adapt it to, say, set uA's.

Imo, this is good enough for Leo 6.2. Let me know your experiences.

Edward

Xu Wang

unread,
Mar 11, 2020, 2:07:15 AM3/11/20
to leo-e...@googlegroups.com
great. Thanks Edward. I will test this feature in the coming weekend.

Edward K. Ream <edre...@gmail.com> 于 2020年3月10日周二 下午11:39写道:
--
You received this message because you are subscribed to the Google Groups "leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/12df2f0e-d441-41ea-9efa-14db70397df9%40googlegroups.com.

Edward K. Ream

unread,
Mar 11, 2020, 5:33:42 AM3/11/20
to leo-editor
On Wed, Mar 11, 2020 at 1:07 AM Xu Wang <xu4...@gmail.com> wrote:

great. Thanks Edward. I will test this feature in the coming weekend.

You're welcome.

Edward
Reply all
Reply to author
Forward
0 new messages