#NEWLINE# def _download( quidditch , retries = 5 ) : #NEWLINE# #INDENT# '\n    another wrapper method.\n    ' #NEWLINE# passed = False #NEWLINE# clean = True #NEWLINE# comment = '' #NEWLINE# while ( not passed ) : #NEWLINE# #INDENT# log . debug ( 'Downloading. tries left: {0}' . format ( str ( retries ) ) ) #NEWLINE# passed = quidditch . Download ( ) #NEWLINE# log . debug ( 'Done downloading: {0}' . format ( str ( passed ) ) ) #NEWLINE# if isinstance ( passed , Exception ) : #NEWLINE# #INDENT# clean = False #NEWLINE# comment += 'Failed while trying to download updates:\n\t\t{0}\n' . format ( str ( passed ) ) #NEWLINE# retries -= 1 #NEWLINE# if retries : #NEWLINE# #INDENT# comment += '{0} tries to go. retrying\n' . format ( str ( retries ) ) #NEWLINE# passed = False #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# comment += 'out of retries. this update round failed.\n' #NEWLINE# return ( comment , False , retries ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if clean : #NEWLINE# #INDENT# comment += 'Download was done without error.\n' #NEWLINE# #UNINDENT# return ( retries , True , retries )