#NEWLINE# def download_one( cc , base_url , verbose = False ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# image = get_flag ( base_url , cc ) #NEWLINE# country = get_country ( base_url , cc ) #NEWLINE# #UNINDENT# except requests . exceptions . HTTPError as exc : #NEWLINE# #INDENT# res = exc . response #NEWLINE# if ( res . status_code == 404 ) : #NEWLINE# #INDENT# status = HTTPStatus . not_found #NEWLINE# msg = 'not found' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# country = country . replace ( ' ' , '_' ) #NEWLINE# save_flag ( image , '{}-{}.gif' . format ( country , cc ) ) #NEWLINE# status = HTTPStatus . ok #NEWLINE# msg = 'OK' #NEWLINE# #UNINDENT# if verbose : #NEWLINE# #INDENT# print ( cc , msg ) #NEWLINE# #UNINDENT# return Result ( status , cc )