E5XML/TasksReader.py

changeset 592
3ad07054e658
parent 590
beb60b9b3d8d
child 791
9ec2ac20e54e
equal deleted inserted replaced
591:c92803caf37f 592:3ad07054e658
72 "linenumber" : 0, 72 "linenumber" : 0,
73 "bugfix" : False, 73 "bugfix" : False,
74 "description" : "", 74 "description" : "",
75 } 75 }
76 task["priority"] = int(self.attribute("priority", "1")) 76 task["priority"] = int(self.attribute("priority", "1"))
77 77 task["completed"] = self.toBool(self.attribute("completed", "False"))
78 val = self.attribute("completed", "False") 78 task["bugfix"] = self.toBool(self.attribute("bugfix", "False"))
79 if val in ["True", "False"]:
80 val = (val == "True")
81 else:
82 val = bool(int(val))
83 task["completed"] = val
84
85 val = self.attribute("bugfix", "False")
86 if val in ["True", "False"]:
87 val = (val == "True")
88 else:
89 val = bool(int(val))
90 task["bugfix"] = val
91 79
92 while not self.atEnd(): 80 while not self.atEnd():
93 self.readNext() 81 self.readNext()
94 if self.isEndElement() and self.name() == "Task": 82 if self.isEndElement() and self.name() == "Task":
95 self.viewer.addTask(task["summary"], priority = task["priority"], 83 self.viewer.addTask(task["summary"], priority = task["priority"],

eric ide

mercurial