Commits

edgimar committed 1db1391

- print notes along with tasks when printing a task-tree as text.
When printing a TasksTree object as an org-mode text representation,
also include a task's notes (i.e. body) immediately following the
task's headline (title), and prior to any sub-tasks.

  • Participants
  • Parent commits bf1545a

Comments (0)

Files changed (1)

File michel/michel.py

             # add number of asterisks corresponding to depth of task
             indentations = '*' * (level+1) + " "
             res.append(indentations + subtask.title)
+            if subtask.task_notes is not None:
+                notes = subtask.task_notes
+                # add initial space to lines starting w/'*', so that it isn't treated as a task
+                if notes.startswith("*"):
+                    notes = " " + notes
+                notes = notes.replace("\n*", "\n *")
+                res.append(notes)
             subtasks_lines = subtask._lines(level + 1)
             res += subtasks_lines
         return res