#NEWLINE# def _extract_members( self , page , query_string = None ) : #NEWLINE# #INDENT# if ( 'orcid-profile' not in page ) : #NEWLINE# #INDENT# raise ProviderContentMalformedError ( 'Content does not contain expected text' ) #NEWLINE# #UNINDENT# data = provider . _load_json ( page ) #NEWLINE# members = [ ] #NEWLINE# try : #NEWLINE# #INDENT# orcid_works = data [ 'orcid-profile' ] [ 'orcid-activities' ] [ 'orcid-works' ] [ 'orcid-work' ] #NEWLINE# #UNINDENT# except KeyError : #NEWLINE# #INDENT# return [ ] #NEWLINE# #UNINDENT# for work in doi : #NEWLINE# #INDENT# new_member = None #NEWLINE# try : #NEWLINE# #INDENT# ids = work [ 'work-external-identifiers' ] [ 'work-external-identifier' ] #NEWLINE# for myid in ids : #NEWLINE# #INDENT# if ( myid [ 'work-external-identifier-type' ] == 'DOI' ) : #NEWLINE# #INDENT# doi = myid [ 'work-external-identifier-id' ] [ 'value' ] #NEWLINE# doi = crossref . clean_doi ( doi ) #NEWLINE# if doi : #NEWLINE# #INDENT# new_member = ( 'doi' , doi ) #NEWLINE# #UNINDENT# #UNINDENT# if ( myid [ 'work-external-identifier-type' ] == 'PMID' ) : #NEWLINE# #INDENT# new_member = ( 'pmid' , myid [ 'work-external-identifier-id' ] [ 'value' ] ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# except KeyError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# if ( not new_member ) : #NEWLINE# #INDENT# biblio = self . _parse_orcid_work ( work ) #NEWLINE# new_member = ( 'biblio' , biblio ) #NEWLINE# #UNINDENT# if new_member : #NEWLINE# #INDENT# members += [ new_member ] #NEWLINE# #UNINDENT# #UNINDENT# if ( not members ) : #NEWLINE# #INDENT# raise ProviderItemNotFoundError #NEWLINE# #UNINDENT# logger . info ( 'returning {n} members for {orcid}' . format ( n = len ( members ) , orcid = query_string ) ) #NEWLINE# return members