# HG changeset patch # User casties # Date 1181916987 -7200 # Node ID 8a16ea8db8586c06d53e0172851b25b57f082bbc # Parent f3d2f240692ca0238213c9ec82941404ea6d20d6 fixed bug in getInt diff -r f3d2f240692c -r 8a16ea8db858 documentViewer.py --- 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):