Changeset - 0db89c347000
[Not reviewed]
default
0 1 0
David McClosky - 18 years ago 2007-06-15 17:41:32
dmcc@bigasterisk.com
Submaster: use leveldict kw where we used to just pass leveldicts
1 file changed with 3 insertions and 3 deletions:
0 comments (0 inline, 0 general)
light9/Submaster.py
Show inline comments
 
@@ -243,13 +243,13 @@ class Submasters:
 
        return Submaster(name)
 
    __getitem__ = get_sub_by_name
 

	
 
def fullsub(*chans):
 
    """Make a submaster with chans at full."""
 
    return Submaster('%r' % chans,
 
        dict([(c, 1.0) for c in chans]), temporary=True)
 
        leveldict=dict([(c, 1.0) for c in chans]), temporary=True)
 

	
 
# a global instance of Submasters, created on demand
 
_submasters = None
 

	
 
def get_global_submasters():
 
    """Get (and make on demand) the global instance of Submasters"""
 
@@ -267,20 +267,20 @@ def get_sub_by_name(name, submasters=Non
 

	
 
    if name in submasters.get_all_sub_names():
 
        return submasters.get_sub_by_name(name)
 

	
 
    try:
 
        val = int(name)
 
        s = Submaster("#%d" % val, {val : 1.0}, temporary=True)
 
        s = Submaster("#%d" % val, leveldict={val : 1.0}, temporary=True)
 
        return s
 
    except ValueError:
 
        pass
 

	
 
    try:
 
        subnum = Patch.get_dmx_channel(name)
 
        s = Submaster("'%s'" % name, {subnum : 1.0}, temporary=True)
 
        s = Submaster("'%s'" % name, leveldict={subnum : 1.0}, temporary=True)
 
        return s
 
    except ValueError:
 
        pass
 

	
 
    # make an error sub
 
    return Submaster('%s' % name)
0 comments (0 inline, 0 general)