#NEWLINE# def makeRunner( self ) : #NEWLINE# #INDENT# 'generator factory function to create generator to run this framer\n\n           yield self if no trans(ition)\n           yields next frame on a trans(ition)\n        ' #NEWLINE# console . profuse ( "   Making Framer '{0}' runner\n" . format ( self . name ) ) #NEWLINE# self . status = STOPPED #NEWLINE# self . desire = STOP #NEWLINE# self . done = True #NEWLINE# try : #NEWLINE# #INDENT# while True : #NEWLINE# #INDENT# control = ( yield self . status ) #NEWLINE# status = self . status #NEWLINE# console . profuse ( "\n   Iterate Framer '{0}' with control = {1} status = {2}\n" . format ( self . name , ControlNames . get ( control , 'Unknown' ) , StatusNames . get ( status , 'Unknown' ) ) ) #NEWLINE# if ( control == RUN ) : #NEWLINE# #INDENT# if ( ( status == RUNNING ) or ( status == STARTED ) ) : #NEWLINE# #INDENT# self . segue ( ) #NEWLINE# self . recur ( ) #NEWLINE# console . profuse ( "     Ran Framer '{0}'\n" . format ( self . name ) ) #NEWLINE# self . status = RUNNING #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( status == STOPPED ) or ( status == READIED ) ) : #NEWLINE# #INDENT# console . profuse ( "   Need to Start Framer '{0}'\n" . format ( self . name ) ) #NEWLINE# self . desire = START #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# console . profuse ( "   Aborting Framer '{0}', bad status = {1} control = {2}\n" . format ( self . name , StatusNames . get ( status , 'Unknown' ) , ControlNames . get ( msg , 'Unknown' ) ) ) #NEWLINE# self . desire = ABORT #NEWLINE# self . status = ABORTED #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( control == READY ) : #NEWLINE# #INDENT# if ( ( status == STOPPED ) or ( status == READIED ) ) : #NEWLINE# #INDENT# console . profuse ( "   Attempting Ready Framer '{0}'\n" . format ( self . name ) ) #NEWLINE# if self . checkStart ( ) : #NEWLINE# #INDENT# console . profuse ( "   Readied Framer '{0}' ...\n" . format ( self . name ) ) #NEWLINE# self . status = READIED #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# console . profuse ( "   Failed Ready Framer '{0}'\n" . format ( self . name ) ) #NEWLINE# self . desire = STOP #NEWLINE# self . status = STOPPED #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( status == RUNNING ) or ( status == STARTED ) ) : #NEWLINE# #INDENT# console . profuse ( "   Framer '{0}', aleady Started\n" . format ( self . name ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# console . profuse ( "   Aborting Framer '{0}', bad status = {1} control = {2}\n" . format ( self . name , StatusNames . get ( status , 'Unknown' ) , ControlNames . get ( control , 'Unknown' ) ) ) #NEWLINE# self . desire = ABORT #NEWLINE# self . status = ABORTED #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( control == START ) : #NEWLINE# #INDENT# if ( ( status == STOPPED ) or ( status == READIED ) ) : #NEWLINE# #INDENT# console . profuse ( "   Attempting Start Framer '{0}'\n" . format ( self . name ) ) #NEWLINE# if self . checkStart ( ) : #NEWLINE# #INDENT# console . terse ( "   Starting Framer '{0}' ...\n" . format ( self . name ) ) #NEWLINE# msg = ( 'To: %s<%s at %s\n' % ( self . name , self . first . human , self . store . stamp ) ) #NEWLINE# console . terse ( msg ) #NEWLINE# self . desire = RUN #NEWLINE# self . enterAll ( ) #NEWLINE# self . recur ( ) #NEWLINE# self . status = STARTED #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# console . profuse ( '   Failed Start Framer {0}\n' . format ( self . name ) ) #NEWLINE# self . desire = STOP #NEWLINE# self . status = STOPPED #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( status == RUNNING ) or ( status == STARTED ) ) : #NEWLINE# #INDENT# console . profuse ( "   Framer '{0}', aleady Started\n" . format ( self . name ) ) #NEWLINE# self . desire = RUN #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# console . profuse ( "   Aborting Framer '{0}', bad status = {1} control = {2}\n" . format ( self . name , StatusNames . get ( status , 'Unknown' ) , ControlNames . get ( control , 'Unknown' ) ) ) #NEWLINE# self . desire = ABORT #NEWLINE# self . status = ABORTED #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( control == STOP ) : #NEWLINE# #INDENT# if ( ( status == RUNNING ) or ( status == STARTED ) ) : #NEWLINE# #INDENT# msg = "   Stopping Framer '{0}' in {1} at {2:0.3f}\n" . format ( self . name , self . active . name , self . store . stamp ) #NEWLINE# self . desire = STOP #NEWLINE# console . terse ( msg ) #NEWLINE# self . exitAll ( abort = True ) #NEWLINE# console . profuse ( "   Stopped Framer '{0}'\n" . format ( self . name ) ) #NEWLINE# self . status = STOPPED #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( status == STOPPED ) or ( status == READIED ) ) : #NEWLINE# #INDENT# console . profuse ( "   Framer '{0}', aleady Stopped\n" . format ( self . name ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# console . profuse ( "   Aborting Framer '{0}', bad status = {1} control = {2}\n" . format ( self . name , StatusNames . get ( status , 'Unknown' ) , ControlNames . get ( control , 'Unknown' ) ) ) #NEWLINE# self . desire = ABORT #NEWLINE# self . status = ABORTED #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# console . profuse ( "   Framer '{0}' aborting with control = {1}\n" . format ( self . name , ControlNames . get ( control , 'Unknown' ) ) ) #NEWLINE# if ( ( status == RUNNING ) or ( status == STARTED ) ) : #NEWLINE# #INDENT# msg = ( '   Aborting %s in %s at %0.3f\n' % ( self . name , self . active . name , self . store . stamp ) ) #NEWLINE# console . terse ( msg ) #NEWLINE# self . exitAll ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( status == STOPPED ) or ( status == READIED ) ) : #NEWLINE# #INDENT# msg = ( '   Aborting %s at %0.3f\n' % ( self . name , self . store . stamp ) ) #NEWLINE# console . terse ( msg ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( status == ABORTED ) : #NEWLINE# #INDENT# console . profuse ( "   Framer '{0}', aleady Aborted\n" . format ( self . name ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# self . desire = ABORT #NEWLINE# self . status = ABORTED #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# finally : #NEWLINE# #INDENT# console . profuse ( "   Exception causing Abort Framer '{0}' ...\n" . format ( self . name ) ) #NEWLINE# self . desire = ABORT #NEWLINE# self . status = ABORTED