--- a/eric6/Tasks/Task.py Wed Jan 27 15:11:03 2021 +0100 +++ b/eric6/Tasks/Task.py Wed Jan 27 18:27:52 2021 +0100 @@ -292,3 +292,24 @@ @return flag indicating a project file task (boolean) """ return self._isProjectTask and self.filename != "" + + def toDict(self): + """ + Public method to convert the task data to a dictionary. + + @return dictionary containing the task data + @rtype dict + """ + return { + "summary": self.summary.strip(), + "description": self.description.strip(), + "priority": self.priority, + "lineno": self.lineno, + "completed": self.completed, + "created": self.created, + "type": self.taskType, + "uid": self.uid, + "parent_uid": self.parentUid, + "expanded": self.isExpanded(), + "filename": self.getFilename(), + }