Mercurial > code > home > repos > light9
comparison bin/keyboardcomposer @ 1859:f066d6e874db
2to3 with these fixers: all idioms set_literal
Ignore-this: cbd28518218c2f0ddce8c4f92d3b8b33
author | drewp@bigasterisk.com |
---|---|
date | Wed, 22 May 2019 00:08:22 +0000 |
parents | 7772cc48e016 |
children | 5bcb950024af |
comparison
equal
deleted
inserted
replaced
1858:7772cc48e016 | 1859:f066d6e874db |
---|---|
1 #!bin/python | 1 #!bin/python |
2 | 2 |
3 from __future__ import division, nested_scopes | 3 |
4 from run_local import log | 4 from run_local import log |
5 import cgi, time, logging | 5 import cgi, time, logging |
6 from optparse import OptionParser | 6 from optparse import OptionParser |
7 import webcolors, colorsys | 7 import webcolors, colorsys |
8 from louie import dispatcher | 8 from louie import dispatcher |
9 from twisted.internet import reactor, tksupport | 9 from twisted.internet import reactor, tksupport |
10 from twisted.web import resource | 10 from twisted.web import resource |
11 from rdflib import URIRef, Literal | 11 from rdflib import URIRef, Literal |
12 import Tix as tk | 12 import tkinter.tix as tk |
13 | 13 |
14 from light9.Fadable import Fadable | 14 from light9.Fadable import Fadable |
15 from light9.subclient import SubClient | 15 from light9.subclient import SubClient |
16 from light9 import showconfig, networking, prof | 16 from light9 import showconfig, networking, prof |
17 from light9.uihelpers import toplevelat | 17 from light9.uihelpers import toplevelat |
24 from light9.effect.settings import DeviceSettings | 24 from light9.effect.settings import DeviceSettings |
25 from rdfdb.patch import Patch | 25 from rdfdb.patch import Patch |
26 from light9.effect.simple_outputs import SimpleOutputs | 26 from light9.effect.simple_outputs import SimpleOutputs |
27 | 27 |
28 from bcf2000 import BCF2000 | 28 from bcf2000 import BCF2000 |
29 import imp | |
29 | 30 |
30 nudge_keys = {'up': list('qwertyui'), 'down': list('asdfghjk')} | 31 nudge_keys = {'up': list('qwertyui'), 'down': list('asdfghjk')} |
31 | 32 |
32 | 33 |
33 class DummySliders: | 34 class DummySliders: |
248 | 249 |
249 def draw_sliders(self): | 250 def draw_sliders(self): |
250 for r in self.rows: | 251 for r in self.rows: |
251 r.destroy() | 252 r.destroy() |
252 self.rows = [] | 253 self.rows = [] |
253 for b in self.subbox.values(): | 254 for b in list(self.subbox.values()): |
254 b.cleanup() | 255 b.cleanup() |
255 self.subbox.clear() | 256 self.subbox.clear() |
256 self.slider_table.clear() | 257 self.slider_table.clear() |
257 | 258 |
258 self.tk_focusFollowsMouse() | 259 self.tk_focusFollowsMouse() |
269 withgroups.sort() | 270 withgroups.sort() |
270 | 271 |
271 log.info("withgroups %s", withgroups) | 272 log.info("withgroups %s", withgroups) |
272 | 273 |
273 self.effectEval = {} | 274 self.effectEval = {} |
274 reload(light9.effect.effecteval) | 275 imp.reload(light9.effect.effecteval) |
275 simpleOutputs = SimpleOutputs(self.graph) | 276 simpleOutputs = SimpleOutputs(self.graph) |
276 for group, order, sortLabel, effect in withgroups: | 277 for group, order, sortLabel, effect in withgroups: |
277 if col == 0 or group != last_group: | 278 if col == 0 or group != last_group: |
278 row = self.make_row(group) | 279 row = self.make_row(group) |
279 rowcount += 1 | 280 rowcount += 1 |
336 | 337 |
337 keyhintrow.pack(fill=tk.X, expand=0) | 338 keyhintrow.pack(fill=tk.X, expand=0) |
338 self.keyhints = keyhintrow | 339 self.keyhints = keyhintrow |
339 | 340 |
340 def setup_key_nudgers(self, tkobject): | 341 def setup_key_nudgers(self, tkobject): |
341 for d, keys in nudge_keys.items(): | 342 for d, keys in list(nudge_keys.items()): |
342 for key in keys: | 343 for key in keys: |
343 # lowercase makes full=0 | 344 # lowercase makes full=0 |
344 keysym = "<KeyPress-%s>" % key | 345 keysym = "<KeyPress-%s>" % key |
345 tkobject.bind(keysym, \ | 346 tkobject.bind(keysym, \ |
346 lambda evt, num=keys.index(key), d=d: \ | 347 lambda evt, num=keys.index(key), d=d: \ |
499 row = self.rows[row] | 500 row = self.rows[row] |
500 row['bg'] = 'black' | 501 row['bg'] = 'black' |
501 | 502 |
502 def get_levels(self): | 503 def get_levels(self): |
503 return dict([ | 504 return dict([ |
504 (uri, box.slider_var.get()) for uri, box in self.subbox.items() | 505 (uri, box.slider_var.get()) for uri, box in list(self.subbox.items()) |
505 ]) | 506 ]) |
506 | 507 |
507 def get_output_settings(self, _graph=None): | 508 def get_output_settings(self, _graph=None): |
508 _graph = _graph or self.graph | 509 _graph = _graph or self.graph |
509 outputSettings = [] | 510 outputSettings = [] |
538 self.graph.patch(Patch(addQuads=stmts, delQuads=[])) | 539 self.graph.patch(Patch(addQuads=stmts, delQuads=[])) |
539 | 540 |
540 self.sub_name.delete(0, tk.END) | 541 self.sub_name.delete(0, tk.END) |
541 | 542 |
542 def alltozero(self): | 543 def alltozero(self): |
543 for uri, subbox in self.subbox.items(): | 544 for uri, subbox in list(self.subbox.items()): |
544 if subbox.scale.scale_var.get() != 0: | 545 if subbox.scale.scale_var.get() != 0: |
545 subbox.scale.fade(value=0.0, length=0) | 546 subbox.scale.fade(value=0.0, length=0) |
546 | 547 |
547 | 548 |
548 # move to web lib | 549 # move to web lib |