Files
@ e06c2c105035
Branch filter:
Location: light9/bin/inputdemo - annotation
e06c2c105035
2.0 KiB
text/plain
workaround for coffee issue with static getters. polymer wasn't seeing my attributes at all
Ignore-this: 192b2826e728db8b7ca6cfb67609241e
Ignore-this: 192b2826e728db8b7ca6cfb67609241e
0f51a1a5785e 0f51a1a5785e 0f51a1a5785e 0f51a1a5785e 0f51a1a5785e 0f51a1a5785e 0f51a1a5785e c33158b367a5 0f51a1a5785e 0f51a1a5785e 0f51a1a5785e f140153c087c 6fa4288da8a6 0f51a1a5785e c756638275d6 0f51a1a5785e 0f51a1a5785e 0f51a1a5785e 0f51a1a5785e c33158b367a5 0f51a1a5785e 0f51a1a5785e 0f51a1a5785e 0f51a1a5785e 0f51a1a5785e 0f51a1a5785e 0f51a1a5785e 0f51a1a5785e a38955ba6f40 0f51a1a5785e 0f51a1a5785e 0f51a1a5785e c33158b367a5 0f51a1a5785e 0f51a1a5785e 0f51a1a5785e 0f51a1a5785e 0f51a1a5785e 0f51a1a5785e 0f51a1a5785e 0f51a1a5785e 0f51a1a5785e 0f51a1a5785e 0f51a1a5785e 0f51a1a5785e 0f51a1a5785e 0f51a1a5785e 0f51a1a5785e 0f51a1a5785e 0f51a1a5785e 0f51a1a5785e 0f51a1a5785e c756638275d6 c756638275d6 c756638275d6 c756638275d6 c33158b367a5 0f51a1a5785e 0f51a1a5785e | #!bin/python
import sys
sys.path.append('/usr/lib/python2.7/dist-packages') # For gtk
from twisted.internet import gtk3reactor
gtk3reactor.install()
from twisted.internet import reactor
from rdflib import URIRef
import optparse, logging, urllib, time
from gi.repository import Gtk
from run_local import log
from light9 import showconfig, networking
from light9 import clientsession
from rdfdb.syncedgraph import SyncedGraph
import cyclone.httpclient
from light9.curvecalc.client import sendLiveInputPoint
class App(object):
def __init__(self):
parser = optparse.OptionParser()
parser.set_usage("%prog [opts] [curve uri]")
parser.add_option("--debug", action="store_true",
help="log at DEBUG")
clientsession.add_option(parser)
opts, args = parser.parse_args()
log.setLevel(logging.DEBUG if opts.debug else logging.INFO)
self.session = clientsession.getUri('inputdemo', opts)
self.graph = SyncedGraph(networking.rdfdb.url, "inputdemo")
self.graph.initiallySynced.addCallback(lambda _: self.launch())
self.curve = args[0] if args else URIRef('http://light9.bigasterisk.com/show/dance2014/song1/curve/c-1401259747.675542')
print "sending points on curve %s" % self.curve
reactor.run()
def launch(self):
win = Gtk.Window()
slider = Gtk.Scale.new_with_range(orientation=Gtk.Orientation.VERTICAL,
min=0, max=1, step=.001)
slider.props.inverted = True
slider.connect('value-changed', self.onChanged)
win.add(slider)
win.parse_geometry('50x250')
win.connect("delete-event", lambda *a: reactor.crash())
win.connect("destroy", lambda *a: reactor.crash())
win.show_all()
def onChanged(self, scale):
t1 = time.time()
d = sendLiveInputPoint(self.curve, scale.get_value())
@d.addCallback
def done(result):
print "posted in %.1f ms" % (1000 * (time.time() - t1))
App()
|