13 from E5Gui.E5Application import e5App |
13 from E5Gui.E5Application import e5App |
14 |
14 |
15 from .Config import tasksFileFormatVersion |
15 from .Config import tasksFileFormatVersion |
16 from .XMLStreamReaderBase import XMLStreamReaderBase |
16 from .XMLStreamReaderBase import XMLStreamReaderBase |
17 |
17 |
18 from Tasks.Task import Task |
18 from Tasks.Task import TaskType |
19 |
19 |
20 import Utilities |
20 import Utilities |
21 |
21 |
22 |
22 |
23 class TasksReader(XMLStreamReaderBase): |
23 class TasksReader(XMLStreamReaderBase): |
83 "priority": 1, |
83 "priority": 1, |
84 "completed": False, |
84 "completed": False, |
85 "created": 0, |
85 "created": 0, |
86 "filename": "", |
86 "filename": "", |
87 "linenumber": 0, |
87 "linenumber": 0, |
88 "type": Task.TypeTodo, |
88 "type": TaskType.TODO, |
89 "description": "", |
89 "description": "", |
90 "uid": "", |
90 "uid": "", |
91 } |
91 } |
92 task["priority"] = int(self.attribute("priority", "1")) |
92 task["priority"] = int(self.attribute("priority", "1")) |
93 task["completed"] = self.toBool(self.attribute("completed", "False")) |
93 task["completed"] = self.toBool(self.attribute("completed", "False")) |
94 if self.version in ["4.2", "5.0"]: |
94 if self.version in ["4.2", "5.0"]: |
95 isBugfix = self.toBool(self.attribute("bugfix", "False")) |
95 isBugfix = self.toBool(self.attribute("bugfix", "False")) |
96 if isBugfix: |
96 if isBugfix: |
97 task["type"] = Task.TypeFixme |
97 task["type"] = TaskType.FIXME |
98 else: |
98 else: |
99 # TODO: task type enum change |
99 task["type"] = TaskType( |
100 # TaskType(int(self.attribute("type", str(Task.TypeTodo.value)))) |
100 int(self.attribute("type", str(TaskType.TODO.value))) |
101 task["type"] = int(self.attribute("type", str(Task.TypeTodo))) |
101 ) |
102 uid = self.attribute("uid", "") |
102 uid = self.attribute("uid", "") |
103 if uid: |
103 if uid: |
104 task["uid"] = uid |
104 task["uid"] = uid |
105 else: |
105 else: |
106 # upgrade from pre 6.0 format |
106 # upgrade from pre 6.0 format |