eric6/Tasks/Task.py

branch
jsonfiles
changeset 8011
630a173cb137
parent 7923
91e843545d9a
child 8143
2c730d5fd177
--- 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(),
+        }

eric ide

mercurial