Changeset 218:66f334ec3256 in documentViewer for documentViewer.py


Ignore:
Timestamp:
Oct 8, 2010, 1:09:29 PM (14 years ago)
Author:
abukhman
Branch:
default
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • documentViewer.py

    r205 r218  
    533533        return docinfo
    534534   
     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
    535557   
    536558    def getDocinfoFromTextTool(self, url, dom=None, docinfo=None):
Note: See TracChangeset for help on using the changeset viewer.