# HG changeset patch # User casties # Date 1182528175 -7200 # Node ID 4a17b755bfc7772f1dca07cdce6fc3d011e0a3a7 # Parent 8a16ea8db8586c06d53e0172851b25b57f082bbc added more try/excepts to bib-meta reading code diff -r 8a16ea8db858 -r 4a17b755bfc7 documentViewer.py --- a/documentViewer.py Fri Jun 15 16:16:27 2007 +0200 +++ b/documentViewer.py Fri Jun 22 18:02:55 2007 +0200 @@ -339,9 +339,15 @@ bibmap=metaData.generateMappingForType(bibtype) # if there is no mapping bibmap is empty (mapping sometimes has empty fields) if len(bibmap) > 0 and len(bibmap['author'][0]) > 0: - docinfo['author']=getTextFromNode(dom.xpath("//bib/%s"%bibmap['author'][0])[0]) - docinfo['title']=getTextFromNode(dom.xpath("//bib/%s"%bibmap['title'][0])[0]) - docinfo['year']=getTextFromNode(dom.xpath("//bib/%s"%bibmap['year'][0])[0]) + try: + docinfo['author']=getTextFromNode(dom.xpath("//bib/%s"%bibmap['author'][0])[0]) + except: pass + try: + docinfo['title']=getTextFromNode(dom.xpath("//bib/%s"%bibmap['title'][0])[0]) + except: pass + try: + docinfo['year']=getTextFromNode(dom.xpath("//bib/%s"%bibmap['year'][0])[0]) + except: pass logging.debug("documentViewer (getbibinfofromindexmeta) using mapping for %s"%bibtype) try: docinfo['lang']=getTextFromNode(dom.xpath("//bib/lang")[0]) @@ -426,7 +432,7 @@ docinfo = self.getBibinfoFromIndexMeta(url,docinfo=docinfo,dom=dom) # get info von bib tag if presentationUrls and (len(presentationUrls)>0): # ueberschreibe diese durch presentation informationen - # presentation url ergiebt sich ersetzen von index.meta in der url der fŸr die Metadaten + # presentation url ergiebt sich ersetzen von index.meta in der url der fuer die Metadaten # durch den relativen Pfad auf die presentation infos presentationUrl=url.replace('index.meta',getTextFromNode(presentationUrls[0])) docinfo = self.getBibinfoFromTextToolPresentation(presentationUrl,docinfo=docinfo,dom=dom)