diff documentViewer.py @ 409:f7d73ea4b38b

quick fix for broken texturlpath
author casties
date Thu, 25 Nov 2010 10:03:50 +0100
parents b8fb4c750d74
children 13dd83f46f6f
line wrap: on
line diff
--- 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