MCPcopy Index your code
hub / github.com/alecthomas/devtodo2 / parseXMLNote

Function parseXMLNote

legacyio.go:47–65  ·  view source on GitHub ↗
(parent TaskNode, from []xmlNote)

Source from the content-addressed store, hash-verified

45}
46
47func parseXMLNote(parent TaskNode, from []xmlNote) {
48 if from == nil {
49 return
50 }
51 for _, note := range from {
52 text := strings.TrimSpace(note.Text)
53 priority := PriorityFromString(note.Priority)
54
55 task := parent.Create(text, priority)
56
57 created, _ := strconv.ParseInt(note.Time, 10, 64)
58 completed, _ := strconv.ParseInt(note.Done, 10, 64)
59 task.SetCreationTime(time.Unix(created, 0).UTC())
60 if completed != 0 {
61 task.SetCompletionTime(time.Unix(completed, 0).UTC())
62 }
63 parseXMLNote(task, note.Note)
64 }
65}
66
67func NewLegacyIO() TaskListIO {
68 return &legacyIO{}

Callers 1

DeserializeMethod · 0.85

Calls 4

PriorityFromStringFunction · 0.85
CreateMethod · 0.65
SetCreationTimeMethod · 0.65
SetCompletionTimeMethod · 0.65

Tested by

no test coverage detected