#NEWLINE# def wait_for_command( logs_generator ) : #NEWLINE# #INDENT# '\n    using given generator, wait for it to raise StopIteration, which\n    indicates that docker has finished with processing\n\n    :return: list of str, logs\n    ' #NEWLINE# logger . info ( 'wait_for_command' ) #NEWLINE# cr = CommandResult ( ) #NEWLINE# while True : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# item = next ( logs_generator ) #NEWLINE# cr . parse_item ( item ) #NEWLINE# #UNINDENT# except StopIteration : #NEWLINE# #INDENT# logger . info ( 'no more logs' ) #NEWLINE# break #NEWLINE# #UNINDENT# #UNINDENT# return cr