#NEWLINE# def when_built( self ) : #NEWLINE# #INDENT# "\n        Returns a Deferred that is callback()'d (with this Circuit\n        instance) when this circuit hits BUILT.\n\n        If it's already BUILT when this is called, you get an\n        already-successful Deferred; otherwise, the state must change\n        to BUILT.\n        " #NEWLINE# d = defer . Deferred ( ) #NEWLINE# if ( self . state == 'BUILT' ) : #NEWLINE# #INDENT# d . callback ( self ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . _when_built . append ( d ) #NEWLINE# #UNINDENT# return d