mirror of
				https://github.com/kovidgoyal/calibre.git
				synced 2025-11-03 19:17:02 -05:00 
			
		
		
		
	Add support for DOI and arXiv identifiers
This commit is contained in:
		
							parent
							
								
									262d1a9e93
								
							
						
					
					
						commit
						e1c950b7bb
					
				@ -435,6 +435,7 @@ def identify(log, abort, # {{{
 | 
				
			|||||||
# }}}
 | 
					# }}}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def urls_from_identifiers(identifiers): # {{{
 | 
					def urls_from_identifiers(identifiers): # {{{
 | 
				
			||||||
 | 
					    identifiers = dict([(k.lower(), v) for k, v in identifiers.iteritems()])
 | 
				
			||||||
    ans = []
 | 
					    ans = []
 | 
				
			||||||
    for plugin in all_metadata_plugins():
 | 
					    for plugin in all_metadata_plugins():
 | 
				
			||||||
        try:
 | 
					        try:
 | 
				
			||||||
@ -446,6 +447,14 @@ def urls_from_identifiers(identifiers): # {{{
 | 
				
			|||||||
    if isbn:
 | 
					    if isbn:
 | 
				
			||||||
        ans.append((isbn, 'isbn', isbn,
 | 
					        ans.append((isbn, 'isbn', isbn,
 | 
				
			||||||
            'http://www.worldcat.org/search?q=bn%%3A%s&qt=advanced'%isbn))
 | 
					            'http://www.worldcat.org/search?q=bn%%3A%s&qt=advanced'%isbn))
 | 
				
			||||||
 | 
					    doi = identifiers.get('doi', None)
 | 
				
			||||||
 | 
					    if doi:
 | 
				
			||||||
 | 
					        ans.append(('DOI', 'doi', doi,
 | 
				
			||||||
 | 
					            'http://dx.doi.org/'+doi))
 | 
				
			||||||
 | 
					    arxiv = identifiers.get('arxiv', None)
 | 
				
			||||||
 | 
					    if arxiv:
 | 
				
			||||||
 | 
					        ans.append(('arXiv', 'arxiv', arxiv,
 | 
				
			||||||
 | 
					            'http://arxiv.org/abs/'+arxiv))
 | 
				
			||||||
    return ans
 | 
					    return ans
 | 
				
			||||||
# }}}
 | 
					# }}}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user