def read(self, filename, archived=False): idx = 1 with open(filename, 'r') as f: for line in f: line = line.strip() if line == "": continue task = Task(idx, archived) task.parse(line) self._tasks.append(task) idx += 1 if task.projects is not None: for n in task.projects: if not self._projects.has_key(n): self._projects[n] = Project(n) self._projects[n].addTask(task)