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 TaskType |
18 from Tasks.Task import TaskType, TaskPriority |
19 |
19 |
20 import Utilities |
20 import Utilities |
21 |
21 |
22 |
22 |
23 class TasksReader(XMLStreamReaderBase): |
23 class TasksReader(XMLStreamReaderBase): |
78 def __readTask(self): |
78 def __readTask(self): |
79 """ |
79 """ |
80 Private method to read the task info. |
80 Private method to read the task info. |
81 """ |
81 """ |
82 task = {"summary": "", |
82 task = {"summary": "", |
83 "priority": 1, |
83 "priority": TaskPriority.NORMAL, |
84 "completed": False, |
84 "completed": False, |
85 "created": 0, |
85 "created": 0, |
86 "filename": "", |
86 "filename": "", |
87 "linenumber": 0, |
87 "linenumber": 0, |
88 "type": TaskType.TODO, |
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"] = TaskPriority( |
|
93 int(self.attribute("priority", str(TaskPriority.NORMAL.value))) |
|
94 ) |
93 task["completed"] = self.toBool(self.attribute("completed", "False")) |
95 task["completed"] = self.toBool(self.attribute("completed", "False")) |
94 if self.version in ["4.2", "5.0"]: |
96 if self.version in ["4.2", "5.0"]: |
95 isBugfix = self.toBool(self.attribute("bugfix", "False")) |
97 isBugfix = self.toBool(self.attribute("bugfix", "False")) |
96 if isBugfix: |
98 if isBugfix: |
97 task["type"] = TaskType.FIXME |
99 task["type"] = TaskType.FIXME |