diff options
author | Your Name <you@example.com> | 2013-07-28 18:47:40 (GMT) |
---|---|---|
committer | Your Name <you@example.com> | 2013-07-28 18:47:40 (GMT) |
commit | e8ffc8333c790d2cb9815996f556c6074581df95 (patch) | |
tree | bf48b0e5d01bdd77edf8cf05bdbf91a9c83873d9 /sugar_network_webui/app.py | |
parent | 6a9181f269714eeb0b20ec583ac682b0980c5e9a (diff) |
Patches by alsroot to go with SN polish
Diffstat (limited to 'sugar_network_webui/app.py')
-rw-r--r-- | sugar_network_webui/app.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sugar_network_webui/app.py b/sugar_network_webui/app.py index 93e6d6d..56e87ea 100644 --- a/sugar_network_webui/app.py +++ b/sugar_network_webui/app.py @@ -34,7 +34,6 @@ from werkzeug import secure_filename import simplejson import tempfile -from sugar_network import client from sugar_network.toolkit.http import NotFound from client import Client @@ -98,8 +97,7 @@ def timedelta(mtime): def get_colors(): - from . import client - if client.anonymous: + if Client.anonymous: return ('#000000', '#000000') try: @@ -148,7 +146,7 @@ def inject_vars(): # Here we can inject variables into every template call stroke, fill = get_colors() kwvar = { - 'userid': client.sugar_uid(), + 'userid': Client.sugar_uid, 'sugar_nick' : get_user() } return dict(stroke=stroke, fill=fill, **kwvar) @@ -221,7 +219,7 @@ def stars(context=None): guid = context[5:] # remove "stars-" from id favorite = request.args.get('favorite') - Client.call('PUT', document='context', guid=guid, cmd='favorite', + Client.call('PUT', ['context', guid], 'favorite', content=(favorite == 'true')) # TODO Need to reset query object until supporting notifications @@ -238,7 +236,7 @@ def moon(context=None): clone = request.args.get('clone', None) guid = context[5:] # remove "moon-" from id - Client.call('PUT', document='context', guid=guid, cmd='clone', + Client.call('PUT', ['context', guid], 'clone', content=1 if clone == 'true' else 0) return jsonify(clone=clone) |