changeset 270:54774cba50c9

revive kcclient and fix subcomposer so kcclient works through refreshes
author Drew Perttula <drewp@bigasterisk.com>
date Fri, 17 Jun 2005 17:52:56 +0000
parents 34db49e1bc20
children 97c08a1c4351
files bin/kcclient bin/keyboardcomposer flax/kcclient light9/networking.py
diffstat 4 files changed, 32 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bin/kcclient	Fri Jun 17 17:52:56 2005 +0000
@@ -0,0 +1,21 @@
+#!/usr/bin/env python
+
+"""send KeyboardComposer a fade request, for use from the shell"""
+
+import sys,xmlrpclib
+import run_local
+from light9 import networking
+
+subname = sys.argv[1]
+level = float(sys.argv[2])
+fadesecs = 0
+if len(sys.argv)>3:
+    fadesecs = float(sys.argv[3])
+
+levelserver = xmlrpclib.ServerProxy("http://%s:%s" %
+                                    (networking.kcServer(),
+                                     networking.kcPort()))
+
+levelserver.fadesub(subname,level,fadesecs)
+
+
--- a/bin/keyboardcomposer	Fri Jun 17 17:52:02 2005 +0000
+++ b/bin/keyboardcomposer	Fri Jun 17 17:52:56 2005 +0000
@@ -12,9 +12,10 @@
 from light9.Fadable import Fadable
 from light9.Submaster import Submasters, sub_maxes
 from light9.subclient import SubClient
-from light9 import dmxclient, showconfig
+from light9 import dmxclient, showconfig, networking
 from light9.uihelpers import toplevelat
 
+
 nudge_keys = {
     'up' : list('qwertyuiop'),
     'down' : list('asdfghjkl')
@@ -59,7 +60,7 @@
         Frame.__init__(self, root, bg='black')
         SubClient.__init__(self)
         self.submasters = submasters
-
+        self.name_to_subtk = {}
         self.current_sub_levels = {}
         if current_sub_levels:
             self.current_sub_levels = current_sub_levels
@@ -76,7 +77,7 @@
         self.rows = [] # this holds Tk Frames for each row
         self.slider_vars = {} # this holds subname:sub Tk vars
         self.slider_table = {} # this holds coords:sub Tk vars
-        self.name_to_subtk = {} # subname : SubmasterTk instance
+        self.name_to_subtk.clear() # subname : SubmasterTk instance
         self.current_row = 0
         
         self.make_key_hints()
@@ -261,7 +262,7 @@
     kc.pack(fill=BOTH, expand=1)
 
     ls = LevelServer(kc.name_to_subtk)
-    reactor.listenTCP(8050, server.Site(ls))
+    reactor.listenTCP(networking.kcPort(), server.Site(ls))
 
     root.protocol('WM_DELETE_WINDOW', reactor.stop)
     reactor.addSystemEventTrigger('after', 'shutdown', kc.save)
--- a/flax/kcclient	Fri Jun 17 17:52:02 2005 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-#!/usr/bin/env python
-
-"""send KeyboardComposer a fade request, for use from the shell"""
-
-import sys,xmlrpclib
-
-subname = sys.argv[1]
-level = float(sys.argv[2])
-fadesecs = 0
-if len(sys.argv)>3:
-    fadesecs = float(sys.argv[3])
-
-levelserver = xmlrpclib.ServerProxy("http://localhost:8050")
-
-levelserver.fadesub(subname,level,fadesecs)
-
-
--- a/light9/networking.py	Fri Jun 17 17:52:02 2005 +0000
+++ b/light9/networking.py	Fri Jun 17 17:52:56 2005 +0000
@@ -18,3 +18,9 @@
 def mpdServer():
     """servername, port"""
     return 'dash',6600
+
+def kcPort():
+    return 8050
+
+def kcServer():
+    return 'dash'