Changeset - d5858e9fa689
[Not reviewed]
default
0 1 0
David McClosky - 20 years ago 2005-06-17 02:21:19
dmcc@bigasterisk.com
keyboardcomposer destroy fix and cleanups
- We were destroying KeyboardComposer a little too much. Fortunately,
we weren't passing the right number of arguments, so this was merely
an error.
- About the TODO comment removed: we don't need to use combine_dict
since Submaster logic will be changed entirely when we/if we move
to a SubServer world and keyboard composer will not be the wiser.
1 file changed with 3 insertions and 6 deletions:
0 comments (0 inline, 0 general)
bin/keyboardcomposer
Show inline comments
 
#!/usr/bin/python
 

	
 
from __future__ import division,nested_scopes
 
from __future__ import division, nested_scopes
 
import sys, time
 

	
 
from twisted.internet import reactor,tksupport
 
from twisted.internet import reactor, tksupport
 
from twisted.web import xmlrpc, server
 
from Tix import *
 
import pickle
 

	
 
import run_local
 
from light9.Fadable import Fadable
 
@@ -202,13 +202,12 @@ class KeyboardComposer(Frame, SubClient)
 
        row = self.rows[row]
 
        row['bg'] = 'black'
 
    def get_levels(self):
 
        return dict([(name, slidervar.get()) 
 
            for name, slidervar in self.slider_vars.items()])
 
    def get_levels_as_sub(self):
 
        # TODO this should be adapted to use Submaster.combine_subdict
 
        scaledsubs = [self.submasters.get_sub_by_name(sub) * level \
 
            for sub, level in self.get_levels().items()]
 

	
 
        maxes = sub_maxes(*scaledsubs)
 
        return maxes
 
    def save_current_stage(self, subname):
 
@@ -261,13 +260,11 @@ if __name__ == "__main__":
 
    kc = KeyboardComposer(tl, s)
 
    kc.pack(fill=BOTH, expand=1)
 

	
 
    ls = LevelServer(kc.name_to_subtk)
 
    reactor.listenTCP(8050, server.Site(ls))
 

	
 
    root.bind("<Destroy>",reactor.stop)
 
    root.protocol('WM_DELETE_WINDOW', reactor.stop)
 
    reactor.addSystemEventTrigger('after','shutdown',kc.save)
 

	
 
    reactor.addSystemEventTrigger('after', 'shutdown', kc.save)
 
    
 
    tksupport.install(root,ms=10)
 
    reactor.run()
0 comments (0 inline, 0 general)