# HG changeset patch # User casties # Date 1290675830 -3600 # Node ID f7d73ea4b38bb4c9c75947fda47573845b21513e # Parent 4e84c53e49b3cc187c622caa693a10aadb138f23 quick fix for broken texturlpath diff -r 4e84c53e49b3 -r f7d73ea4b38b MpdlXmlTextServer.py --- a/MpdlXmlTextServer.py Wed Nov 24 17:01:26 2010 +0100 +++ b/MpdlXmlTextServer.py Thu Nov 25 10:03:50 2010 +0100 @@ -143,7 +143,10 @@ def getGisPlaces(self, docinfo=None, pageinfo=None): """ Show all Gis Places of whole Page""" xpath='//place' - docpath = docinfo['textURLPath'] + docpath = docinfo.get('textURLPath',None) + if not docpath: + return None + url = docinfo['url'] selfurl = self.absolute_url() pn = pageinfo['current'] @@ -198,7 +201,10 @@ def getOrigPages (self, docinfo=None, pageinfo=None): """Show original page """ - docpath = docinfo['textURLPath'] + docpath = docinfo.get('textURLPath',None) + if not docpath: + return None + logging.debug ("docinfo['textURLPath']=%s"%(docinfo['textURLPath'])) #url = docinfo['url'] selfurl = self.absolute_url() diff -r 4e84c53e49b3 -r f7d73ea4b38b documentViewer.py --- a/documentViewer.py Wed Nov 24 17:01:26 2010 +0100 +++ b/documentViewer.py Thu Nov 25 10:03:50 2010 +0100 @@ -283,7 +283,7 @@ pt = getattr(self.template, 'thumbs_main_rss') if viewMode=="auto": # automodus gewaehlt - if docinfo.has_key("textURL") or docinfo.has_key('textURLPath'): #texturl gesetzt und textViewer konfiguriert + if docinfo.has_key("textURL") or docinfo.get('textURLPath',None): #texturl gesetzt und textViewer konfiguriert viewMode="text" else: viewMode="images" @@ -319,7 +319,7 @@ docinfo = self.getToc(mode=tocMode, docinfo=docinfo) if viewMode=="auto": # automodus gewaehlt - if docinfo.has_key('textURL') or docinfo.has_key('textURLPath'): #texturl gesetzt und textViewer konfiguriert + if docinfo.has_key('textURL') or docinfo.get('textURLPath',None): #texturl gesetzt und textViewer konfiguriert viewMode="text_dict" else: viewMode="images" @@ -796,7 +796,11 @@ else: logging.error("documentViewer (getdocinfo) unknown mode: %s!"%mode) raise ValueError("Unknown mode %s! Has to be one of 'texttool','imagepath','filepath'."%(mode)) - + + # FIXME: fake texturlpath + if not docinfo.has_key('textURLPath'): + docinfo['textURLPath'] = None + logging.debug("documentViewer (getdocinfo) docinfo: %s"%docinfo) #logging.debug("documentViewer (getdocinfo) docinfo: %s"%) self.REQUEST.SESSION['docinfo'] = docinfo