#NEWLINE# def _download_container( self , container , options ) : #NEWLINE# #INDENT# _page_generator = self . list ( container = container , options = options ) #NEWLINE# try : #NEWLINE# #INDENT# next_page_downs = self . _submit_page_downloads ( container , _page_generator , options ) #NEWLINE# #UNINDENT# except ClientException as err : #NEWLINE# #INDENT# if ( err . http_status != 404 ) : #NEWLINE# #INDENT# raise #NEWLINE# #UNINDENT# raise SwiftError ( ( 'Container %r not found' % container ) , container = container , exc = err ) #NEWLINE# #UNINDENT# error = None #NEWLINE# while next_page_downs : #NEWLINE# #INDENT# page_downs = next_page_downs #NEWLINE# next_page_downs = None #NEWLINE# next_page_triggered = False #NEWLINE# next_page_trigger_point = ( 0.8 * len ( page_downs ) ) #NEWLINE# page_results_yielded = 0 #NEWLINE# for o_down in interruptable_as_completed ( page_downs ) : #NEWLINE# #INDENT# ( yield o_down . result ( ) ) #NEWLINE# if ( not next_page_triggered ) : #NEWLINE# #INDENT# page_results_yielded += 1 #NEWLINE# if ( page_results_yielded >= next_page_trigger_point ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# next_page_downs = self . _submit_page_downloads ( container , _page_generator , options ) #NEWLINE# #UNINDENT# except ClientException as err : #NEWLINE# #INDENT# logger . exception ( err ) #NEWLINE# error = err #NEWLINE# #UNINDENT# except Exception : #NEWLINE# #INDENT# for _d in page_downs : #NEWLINE# #INDENT# _d . cancel ( ) #NEWLINE# #UNINDENT# raise #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# next_page_triggered = True #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# if error : #NEWLINE# #INDENT# raise error