changeset 914:092c00f6ba25

fixes for Submaster init method Ignore-this: 338d19cb4522babe56a77d46e863fe5d
author drewp@bigasterisk.com
date Mon, 10 Jun 2013 19:56:42 +0000
parents 05db77383cc1
children 5054d49ed44e
files bin/subcomposer light9/Effects.py light9/Submaster.py
diffstat 3 files changed, 6 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/bin/subcomposer	Mon Jun 10 18:35:01 2013 +0000
+++ b/bin/subcomposer	Mon Jun 10 19:56:42 2013 +0000
@@ -158,7 +158,7 @@
             if lev!=0:
                 leveldict[get_channel_name(i+1)]=lev
 
-        s=Submaster.Submaster(subname,leveldict=leveldict)
+        s=Submaster.Submaster(subname, levels=leveldict)
         s.save()
 
     def sendupdate(self):
--- a/light9/Effects.py	Mon Jun 10 18:35:01 2013 +0000
+++ b/light9/Effects.py	Mon Jun 10 19:56:42 2013 +0000
@@ -29,7 +29,7 @@
             continue
         lev[dmx] = value
 
-    return Submaster.Submaster(leveldict=lev, temporary=True)
+    return Submaster.Submaster(name="chase" ,levels=lev)
 
 def stack(t, names=None, fade=0):
     """names is list of URIs. returns a submaster that stacks the the inputs
@@ -52,7 +52,7 @@
         else:
             break
     
-    return Submaster.Submaster(leveldict=lev, temporary=True)
+    return Submaster.Submaster(name="stack", levels=lev)
 
 def configExprGlobals():
     graph = showconfig.getGraph()
--- a/light9/Submaster.py	Mon Jun 10 18:35:01 2013 +0000
+++ b/light9/Submaster.py	Mon Jun 10 19:56:42 2013 +0000
@@ -311,11 +311,6 @@
     def get_sub_by_uri(self, uri):
         return self.submasters[uri]
 
-def fullsub(*chans):
-    """Make a submaster with chans at full."""
-    return Submaster('%r' % chans,
-        leveldict=dict([(c, 1.0) for c in chans]), temporary=True)
-
 # a global instance of Submasters, created on demand
 _submasters = None
 
@@ -338,20 +333,20 @@
 
     try:
         val = int(name)
-        s = Submaster("#%d" % val, leveldict={val : 1.0}, temporary=True)
+        s = Submaster("#%d" % val, levels={val : 1.0})
         return s
     except ValueError:
         pass
 
     try:
         subnum = get_dmx_channel(name)
-        s = Submaster("'%s'" % name, leveldict={subnum : 1.0}, temporary=True)
+        s = Submaster("'%s'" % name, levels={subnum : 1.0})
         return s
     except ValueError:
         pass
 
     # make an error sub
-    return Submaster('%s' % name)
+    return Submaster('%s' % name, levels=ValueError)
 
 if __name__ == "__main__":
     reload_data()