From b30a273d6d2926fb404a1e87d9e31e6ef62d0d5f Mon Sep 17 00:00:00 2001 From: Ben Tremblay Date: Fri, 06 Nov 2009 19:01:23 +0000 Subject: Merge branch 'master' of gitorious@git.sugarlabs.org:tutorius/BenTremblay-Dev into bentremblay-dev --- (limited to 'tutorius/store.py') diff --git a/tutorius/store.py b/tutorius/store.py index 81925ed..cf20dd0 100644 --- a/tutorius/store.py +++ b/tutorius/store.py @@ -323,27 +323,31 @@ class StoreProxy(object): headers = { 'X-API-Auth' : self.api_auth_key } response = self.conn.request_post(request_url, None, None, None, headers) - if self.helper.iserror(response): - return False + return -1 - return True + return tutorial_store_id # Otherwise, we want to publish a new tutorial if tutorial_info == None: - return False + return -1 request_url = "/%s/publish/" % (self.tutorius_api) headers = { 'X-API-Auth' : self.api_auth_key } response = self.conn.request_post(request_url, tutorial_info, tutorial, tutorial_info['filename'], headers) - + if self.helper.iserror(response): - return False + return -1 + + xml_response = minidom.parseString(response['body']) + + id_node = xml_response.getElementsByTagName("id")[0] + + id = id_node.getAttribute('value') - return True - + return id def unpublish(self, tutorial_store_id): """ -- cgit v0.9.1