changeset 218:66f334ec3256

*** empty log message ***
author abukhman
date Fri, 08 Oct 2010 15:09:29 +0200
parents 5d28552fd967
children 17b205ca60a5
files documentViewer.py
diffstat 1 files changed, 22 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/documentViewer.py	Fri Oct 08 14:56:13 2010 +0200
+++ b/documentViewer.py	Fri Oct 08 15:09:29 2010 +0200
@@ -532,6 +532,28 @@
 
         return docinfo
     
+     
+    def getNameFromIndexMeta(self,path,docinfo=None,dom=None,cut=0):
+        """gets name info from the index.meta file at path or given by dom"""
+        if docinfo is None:
+            docinfo = {}
+        
+        if dom is None:
+            for x in range(cut):
+                path=getParentDir(path)
+            dom = self.getDomFromIndexMeta(path)
+        
+        docinfo['indexMetaPath']=self.getIndexMetaPath(path);
+        
+        result= dom.xpath("//result/resultPage")
+        docinfo['numPages']=int(getTextFromNode(result[0]))
+        
+        if len(bibmap) > 0 and len(bibmap['author'][0]) > 0:
+            try:
+                docinfo['name']=getTextFromNode(dom.xpath("//name"))
+            except: pass  
+                #logging.debug("documentViewer (getbibinfofromindexmeta) using mapping for %s"%bibtype)
+        return docinfo
     
     def getDocinfoFromTextTool(self, url, dom=None, docinfo=None):
         """parse texttool tag in index meta"""