Commit 4dbcc84d authored by Bram Schoenmakers's avatar Bram Schoenmakers

Add function to return a list of raw todo strings.

parent 317c71fc
...@@ -5,8 +5,16 @@ def load_file(p_filename): ...@@ -5,8 +5,16 @@ def load_file(p_filename):
""" """
Loads a todo file from the given filename and returns a list of todos. Loads a todo file from the given filename and returns a list of todos.
""" """
todolist = load_file_to_raw_list(p_filename)
return [Todo.Todo(src, number + 1) for number, src in enumerate(todolist)]
def load_file_to_raw_list(p_filename):
"""
Loads a todo file from the given filename and returns a list of todo
strings (unparsed).
"""
todofile = TodoFile.TodoFile(p_filename) todofile = TodoFile.TodoFile(p_filename)
return [Todo.Todo(src) for src in todofile.read()] return todofile.read()
def todolist_to_string(p_list): def todolist_to_string(p_list):
""" Converts a todo list to a single string. """ """ Converts a todo list to a single string. """
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment