#NEWLINE# def _lookup_biblio_from_doi( self , id , url , cache_enabled ) : #NEWLINE# #INDENT# response = self . http_get ( url , cache_enabled = cache_enabled , allow_redirects = True , headers = { #NEWLINE# #INDENT# 'Accept' : 'application/vnd.citationstyles.csl+json' , #NEWLINE# 'User-Agent' : 'impactstory.org' , #NEWLINE# #UNINDENT# } ) #NEWLINE# if ( response . status_code != 200 ) : #NEWLINE# #INDENT# self . logger . info ( ( '%s status_code=%i' % ( self . provider_name , response . status_code ) ) ) #NEWLINE# if ( response . status_code == 404 ) : #NEWLINE# #INDENT# return { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( response . status_code == 403 ) : #NEWLINE# #INDENT# return { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( response . status_code >= 300 ) and ( response . status_code < 400 ) ) : #NEWLINE# #INDENT# return { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . _get_error ( response . status_code , response ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# try : #NEWLINE# #INDENT# biblio_dict = self . _extract_biblio ( response . text , response ) #NEWLINE# #UNINDENT# except ( AttributeError , TypeError ) : #NEWLINE# #INDENT# biblio_dict = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# return biblio_dict