Mercurial > code > home > repos > light9
diff bin/webcontrol @ 623:46d319974176
move networking settings to config.n3
Ignore-this: 42a6390f9354a171c4d43e1c65a551ca
author | drewp@bigasterisk.com |
---|---|
date | Wed, 15 Jun 2011 05:30:19 +0000 |
parents | 8d6f6d8a4719 |
children | 84c0a3bf07ed |
line wrap: on
line diff
--- a/bin/webcontrol Wed Jun 15 05:30:00 2011 +0000 +++ b/bin/webcontrol Wed Jun 15 05:30:19 2011 +0000 @@ -22,8 +22,8 @@ from urllib import urlencode # move to web lib -def post(root, path, **args): - return getPage(root.rstrip('/') + '/' + path.lstrip('/'), +def post(url, **args): + return getPage(url, method='POST', postdata=urlencode(args)) @@ -31,7 +31,7 @@ class Commands(object): @staticmethod def playSong(graph, songUri): - s = xmlrpclib.ServerProxy(networking.musicUrl()) + s = xmlrpclib.ServerProxy(networking.musicPlayer.url) songPath = graph.value(URIRef(songUri), L9.showPath) if songPath is None: raise ValueError("unknown song %s" % songUri) @@ -39,17 +39,17 @@ @staticmethod def stopMusic(graph): - s = xmlrpclib.ServerProxy(networking.musicUrl()) + s = xmlrpclib.ServerProxy(networking.musicPlayer.url) return s.stop() @staticmethod def worklightsOn(graph): - return post(networking.keyboardComposerUrl(), 'fadesub', + return post(networking.keyboardComposer.path('fadesub'), subname='scoop', level=.5, secs=.5) @staticmethod def worklightsOff(graph): - return post(networking.keyboardComposerUrl(), 'fadesub', + return post(networking.keyboardComposer.path('fadesub'), subname='scoop', level=0, secs=.5) @staticmethod