comparison documentViewer.py @ 218:66f334ec3256

*** empty log message ***
author abukhman
date Fri, 08 Oct 2010 15:09:29 +0200
parents 1fc7d73ce7ce
children 17b205ca60a5
comparison
equal deleted inserted replaced
217:5d28552fd967 218:66f334ec3256
530 except: 530 except:
531 docinfo['lang']='' 531 docinfo['lang']=''
532 532
533 return docinfo 533 return docinfo
534 534
535
536 def getNameFromIndexMeta(self,path,docinfo=None,dom=None,cut=0):
537 """gets name info from the index.meta file at path or given by dom"""
538 if docinfo is None:
539 docinfo = {}
540
541 if dom is None:
542 for x in range(cut):
543 path=getParentDir(path)
544 dom = self.getDomFromIndexMeta(path)
545
546 docinfo['indexMetaPath']=self.getIndexMetaPath(path);
547
548 result= dom.xpath("//result/resultPage")
549 docinfo['numPages']=int(getTextFromNode(result[0]))
550
551 if len(bibmap) > 0 and len(bibmap['author'][0]) > 0:
552 try:
553 docinfo['name']=getTextFromNode(dom.xpath("//name"))
554 except: pass
555 #logging.debug("documentViewer (getbibinfofromindexmeta) using mapping for %s"%bibtype)
556 return docinfo
535 557
536 def getDocinfoFromTextTool(self, url, dom=None, docinfo=None): 558 def getDocinfoFromTextTool(self, url, dom=None, docinfo=None):
537 """parse texttool tag in index meta""" 559 """parse texttool tag in index meta"""
538 logging.debug("documentViewer (getdocinfofromtexttool) url: %s" % (url)) 560 logging.debug("documentViewer (getdocinfofromtexttool) url: %s" % (url))
539 if docinfo is None: 561 if docinfo is None: