Mercurial > code > home > repos > light9
comparison bin/curvecalc @ 686:a301a0039c66
buildout and rdflib updates
Ignore-this: 912b5b138f73771434f6cc1b077841c0
author | Drew Perttula <drewp@bigasterisk.com> |
---|---|
date | Tue, 05 Jun 2012 20:40:35 +0000 |
parents | 83c239d3fd33 |
children | 454e381cd24f |
comparison
equal
deleted
inserted
replaced
685:d9e61d97c578 | 686:a301a0039c66 |
---|---|
1 #!/usr/bin/python | 1 #!bin/python |
2 | 2 |
3 """ | 3 """ |
4 now launches like this: | 4 now launches like this: |
5 % bin/curvecalc http://light9.bigasterisk.com/show/dance2007/song1 | 5 % bin/curvecalc http://light9.bigasterisk.com/show/dance2007/song1 |
6 | 6 |
24 from twisted.internet.defer import Deferred | 24 from twisted.internet.defer import Deferred |
25 from zope.interface import implements | 25 from zope.interface import implements |
26 from twisted.internet.defer import succeed | 26 from twisted.internet.defer import succeed |
27 from twisted.web.iweb import IBodyProducer | 27 from twisted.web.iweb import IBodyProducer |
28 from rdflib import Literal, URIRef, RDF, RDFS | 28 from rdflib import Literal, URIRef, RDF, RDFS |
29 from rdflib.Graph import Graph | 29 from rdflib import Graph |
30 import rdflib | 30 import rdflib |
31 import logging | 31 import logging |
32 log = logging.getLogger() | 32 log = logging.getLogger() |
33 | 33 |
34 import run_local | 34 import run_local |
498 anchor='w') | 498 anchor='w') |
499 line.pack(side='top',fill='x') | 499 line.pack(side='top',fill='x') |
500 | 500 |
501 def currentlyPlayingSong(): | 501 def currentlyPlayingSong(): |
502 """ask the music player what song it's on""" | 502 """ask the music player what song it's on""" |
503 t = jsonlib.read(restkit.Resource(networking.musicUrl()).get("time").body) | 503 t = jsonlib.read(restkit.Resource(networking.musicPlayer.url).get("time").body) |
504 if t['song'] is None: | 504 if t['song'] is None: |
505 raise ValueError("music player is not playing any song") | 505 raise ValueError("music player is not playing any song") |
506 return URIRef(t['song']) | 506 return URIRef(t['song']) |
507 | 507 |
508 def main(): | 508 def main(): |