Changeset - 9bc5e908c361
[Not reviewed]
default
0 1 0
David McClosky - 20 years ago 2005-06-16 22:26:17
dmcc@bigasterisk.com
Submasters have consistent repr(), new cmp and hash functions
1 file changed with 7 insertions and 1 deletions:
0 comments (0 inline, 0 general)
light9/Submaster.py
Show inline comments
 
@@ -63,7 +63,9 @@ class Submaster:
 
    def max(self, *othersubs):
 
        return sub_maxes(self, *othersubs)
 
    def __repr__(self):
 
        levels = ' '.join(["%s:%.2f" % item for item in self.levels.items()])
 
        items = self.levels.items()
 
        items.sort()
 
        levels = ' '.join(["%s:%.2f" % item for item in items])
 
        return "<'%s': [%s]>" % (self.name, levels)
 
    def get_dmx_list(self):
 
        leveldict = self.get_levels() # gets levels of sub contents
 
@@ -109,6 +111,10 @@ class Submaster:
 
                                             amount))
 

	
 
        return xfaded_sub
 
    def __cmp__(self, other):
 
        return cmp(repr(self), repr(other))
 
    def __hash__(self):
 
        return hash(repr(self))
 
                                            
 
def linear_fade(start, end, amount):
 
    """Fades between two floats by an amount.  amount is a float between
0 comments (0 inline, 0 general)