changeset 62:8a16ea8db858

fixed bug in getInt
author casties
date Fri, 15 Jun 2007 16:16:27 +0200
parents f3d2f240692c
children 4a17b755bfc7
files documentViewer.py
diffstat 1 files changed, 13 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/documentViewer.py	Thu Jun 14 18:07:21 2007 +0200
+++ b/documentViewer.py	Fri Jun 15 16:16:27 2007 +0200
@@ -32,7 +32,7 @@
     try:
         return int(number)
     except:
-        return default
+        return int(default)
 
 def getTextFromNode(nodename):
     """get the cdata content of a node"""
@@ -439,9 +439,18 @@
         """gets the bibliographical information from the preseantion entry in texttools
         """
         dom=self.getPresentationInfoXML(url)
-        docinfo['author']=getTextFromNode(dom.xpath("//author")[0])
-        docinfo['title']=getTextFromNode(dom.xpath("//title")[0])
-        #docinfo['year']=getTextFromNode(dom.xpath("//date")[0])
+        try:
+            docinfo['author']=getTextFromNode(dom.xpath("//author")[0])
+        except:
+            pass
+        try:
+            docinfo['title']=getTextFromNode(dom.xpath("//title")[0])
+        except:
+            pass
+        try:
+            docinfo['year']=getTextFromNode(dom.xpath("//date")[0])
+        except:
+            pass
         return docinfo
     
     def getDocinfoFromImagePath(self,path,docinfo=None):