Commit 167f91b4 authored by Bram Schoenmakers's avatar Bram Schoenmakers

Fix class attributes, instantiate in __init__.

parent 56104e70
......@@ -19,10 +19,10 @@ class TodoBase(object):
in a todo item.
"""
src = None
fields = {}
def __init__(self, p_src):
self.src = ""
self.fields = {}
self.set_text(p_src)
def tag_value(self, p_key):
......
......@@ -8,7 +8,6 @@ class TodoFile(object):
to.
"""
path = ""
def __init__(self, p_path):
self.path = p_path
......
......@@ -12,13 +12,13 @@ class TodoList(object):
The list is usually a complete list found in the program's input (e.g. a
todo.txt file), not an arbitrary set of todo items.
"""
_todos = []
def __init__(self, p_todostrings):
"""
Should be given a list of strings, each element a single todo string.
The string will be parsed.
"""
self._todos = []
for string in p_todostrings:
self._todos.append(Todo.Todo(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