Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksey Lim <alsroot@sugarlabs.org>2012-08-13 22:28:01 (GMT)
committer Aleksey Lim <alsroot@sugarlabs.org>2012-08-13 22:28:04 (GMT)
commita2220a982e3e2ee17f7afefa07dfd81269b6dba3 (patch)
tree0120d502ffbd68ac5165127bbe7a5b7ae1bcda2c
parentd86887c325f0bedb4beaa1214a828269779db788 (diff)
Fix DBus DS api calls in python2.7 env
-rw-r--r--sugar_network/local/dbus_datastore.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/sugar_network/local/dbus_datastore.py b/sugar_network/local/dbus_datastore.py
index ed220fa..d00ee98 100644
--- a/sugar_network/local/dbus_datastore.py
+++ b/sugar_network/local/dbus_datastore.py
@@ -222,16 +222,19 @@ class Datastore(dbus_thread.Service):
props.pop('guid')
self.call(self._set_blob, error_cb, method=http_method, mountpoint='~',
- document='artifact', content=props,
- args=[kwargs.get('guid'), blobs, reply_cb, error_cb], **kwargs)
+ document='artifact', content=props, args=[http_method,
+ kwargs.get('guid'), blobs, reply_cb, error_cb],
+ **kwargs)
- def _set_blob(self, reply, guid, blobs, reply_cb, error_cb):
+ def _set_blob(self, reply, http_method, guid, blobs, reply_cb, error_cb):
if not guid:
guid = reply
-
if blobs:
self.call(self._set_blob, error_cb, method='PUT',
mountpoint='~', document='artifact', guid=guid,
- args=[guid, blobs, reply_cb, error_cb], **blobs.pop())
- else:
+ args=[http_method, guid, blobs, reply_cb, error_cb],
+ **blobs.pop())
+ elif http_method == 'POST':
reply_cb(guid)
+ else:
+ reply_cb()