<s> __author__ = '<STR_LIT>' <EOL> from . MFade import MFade <EOL> from . MScale import MScale <EOL> from . MCircularReveal import MCircularReveal <EOL> class MAnimate : <EOL> def animate ( self ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> if self . __animations is None : <EOL> pass <EOL> except AttributeError : <EOL> self . __animations = { '<STR_LIT>' : None , '<STR_LIT>' : None , '<STR_LIT>' : None } <EOL> self . __animators = { '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT>' } <EOL> self . __duration = <NUM_LIT:1000> <EOL> self . __end_listener = None <EOL> return self <EOL> def fade ( self , target , duration = <NUM_LIT:0> ) : <EOL> animator_name = '<STR_LIT>' <EOL> if self . __animations [ animator_name ] is not None : <EOL> self . __animations [ animator_name ] [ '<STR_LIT>' ] . paused = True <EOL> self . __animations [ animator_name ] [ '<STR_LIT>' ] . canceled = True <EOL> self . __animations [ animator_name ] = None <EOL> self . __animations [ animator_name ] = { <EOL> '<STR_LIT:target>' : target , <EOL> '<STR_LIT>' : duration , <EOL> '<STR_LIT>' : MFade ( ) <EOL> } <EOL> return self <EOL> def scale ( self , target , duration = <NUM_LIT:0> ) : <EOL> animator_name = '<STR_LIT>' <EOL> if self . __animations [ animator_name ] is not None : <EOL> self . __animations [ animator_name ] [ '<STR_LIT>' ] . paused = True <EOL> self . __animations [ animator_name ] [ '<STR_LIT>' ] . canceled = True <EOL> self . __animations [ animator_name ] = None <EOL> self . __animations [ animator_name ] = { <EOL> '<STR_LIT:target>' : target , <EOL> '<STR_LIT>' : duration , <EOL> '<STR_LIT>' : MScale ( ) <EOL> } <EOL> return self <EOL> def reveal ( self , target , duration = <NUM_LIT:0> ) : <EOL> animator_name = '<STR_LIT>' <EOL> if self . __animations [ animator_name ] is not None : <EOL> self . __animations [ animator_name ] [ '<STR_LIT>' ] . pause ( ) <EOL> self . __animations [ animator_name ] [ '<STR_LIT>' ] . cancel ( ) <EOL> self . __animations [ animator_name ] = None <EOL> self . __animations [ animator_name ] = { <EOL> '<STR_LIT:target>' : target , <EOL> '<STR_LIT>' : duration , <EOL> '<STR_LIT>' : MCircularReveal ( ) <EOL> } <EOL> return self <EOL> def duration ( self , duration ) : <EOL> self . __duration = duration <EOL> return self <EOL> def when_ends ( self , end_listener ) : <EOL> """<STR_LIT>""" <EOL> self . __end_listener = end_listener <EOL> return self <EOL> def start ( self ) : <EOL> for key , value in self . __animations . items ( ) : <EOL> if value is not None : <EOL> value [ '<STR_LIT>' ] . add_target ( self ) <EOL> value [ '<STR_LIT>' ] . target = value [ '<STR_LIT:target>' ] <EOL> value [ '<STR_LIT>' ] . duration = value [ '<STR_LIT>' ] <EOL> if value [ '<STR_LIT>' ] == <NUM_LIT:0> : <EOL> value [ '<STR_LIT>' ] . duration = self . __duration <EOL> if self . __end_listener is not None : <EOL> value [ '<STR_LIT>' ] . end_signal . connect ( self . __end_listener ) <EOL> value [ '<STR_LIT>' ] . start ( ) </s>
