Mercurial > code > home > repos > light9
changeset 710:1fb8f18a8847
fix jsonlib dep in ascoltami
Ignore-this: c34d510ddb5dd04d4f31d0c7caa249c5
author | drewp@bigasterisk.com |
---|---|
date | Sun, 10 Jun 2012 18:26:21 +0000 |
parents | 7a41504ed8fc |
children | e94989da079c |
files | light9/ascoltami/webapp.py |
diffstat | 1 files changed, 5 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/light9/ascoltami/webapp.py Sun Jun 10 17:56:56 2012 +0000 +++ b/light9/ascoltami/webapp.py Sun Jun 10 18:26:21 2012 +0000 @@ -1,4 +1,4 @@ -import web, jsonlib, socket +import web, json, socket from twisted.python.util import sibpath from light9.namespaces import L9 from light9.showconfig import getSongsFromShow, songOnDisk @@ -35,7 +35,7 @@ else: song = None web.header("content-type", "application/json") - return jsonlib.write({ + return json.dumps({ "song" : song, "started" : player.playStartTime, "duration" : player.duration(), @@ -50,7 +50,7 @@ want those actions. Use {t: <seconds>} to seek, optionally with a pause/resume command too. """ - params = jsonlib.read(web.data(), use_float=True) + params = json.loads(web.data()) player = app.player if params.get('pause', False): player.pause() @@ -68,7 +68,7 @@ songs = getSongsFromShow(graph, app.show) web.header("Content-type", "application/json") - return jsonlib.write({"songs" : [ + return json.dumps({"songs" : [ {"uri" : s, "path" : graph.value(s, L9['showPath']), "label" : graph.label(s)} for s in songs]}) @@ -86,7 +86,7 @@ def POST(self): player = app.player - data = jsonlib.read(web.data(), use_float=True) + data = json.loads(web.data()) if player.isPlaying(): player.pause() else: