From 83e0f62d430406c621ac1140c9f10827ba17f31c Mon Sep 17 00:00:00 2001 From: "maxwell.lock@hibu.com" Date: Tue, 6 May 2014 19:58:42 +0100 Subject: [PATCH 1/3] fix no attribute errors --- client.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/client.py b/client.py index 26fac2a..9a983b3 100644 --- a/client.py +++ b/client.py @@ -177,29 +177,30 @@ def addContext(self, data): def buildXml(self, todo): + xml = '' - if todo.getDescription() != None: - xml += '' + todo.getDescription() + '' + if todo['description'] != None: + xml += '' + todo['description'] + '' - if todo.getProject() != None: - if todo.getProject() == 'default': + if todo['project'] != None: + if todo['project'] == 'default': xml += '1' else: for project in self.projects: - if project['name'] == todo.getProject(): + if project['name'] == todo['project']: xml += '' + project['id'] + '' break - if todo.getContext() != None: - if todo.getContext() == 'default': + if todo['context'] != None: + if todo['context'] == 'default': xml += '1' else: for context in self.contexts: - if context['name'] == todo.getContext(): + if context['name'] == todo['context']: xml += '' + context['id'] + '' break - if todo.isDone() == True: + if todo['done'] == True: xml += 'completed' xml += ""+ todo.getCompletedDate() + 'T00:00:00Z'+"" From 721e907ed337c0d140e000efd214b66a0c508bee Mon Sep 17 00:00:00 2001 From: "maxwell.lock@hibu.com" Date: Tue, 6 May 2014 19:59:43 +0100 Subject: [PATCH 2/3] add notes to todos --- client.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client.py b/client.py index 9a983b3..22be083 100644 --- a/client.py +++ b/client.py @@ -182,6 +182,9 @@ def buildXml(self, todo): if todo['description'] != None: xml += '' + todo['description'] + '' + if todo['notes'] != None: + xml += '' + todo['notes'] + '' + if todo['project'] != None: if todo['project'] == 'default': xml += '1' From 46c81539c767d047794785e9723f090776d9f8e7 Mon Sep 17 00:00:00 2001 From: "maxwell.lock@hibu.com" Date: Tue, 6 May 2014 20:08:38 +0100 Subject: [PATCH 3/3] preserve newlines in xml --- client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client.py b/client.py index 22be083..fdbb2f4 100644 --- a/client.py +++ b/client.py @@ -208,7 +208,7 @@ def buildXml(self, todo): xml += ""+ todo.getCompletedDate() + 'T00:00:00Z'+"" xml += '' - xml = unicode(xml).encode('unicode_escape') + xml = unicode(xml).encode('raw-unicode-escape') return xml def updateTodo(self, todo):