changeset 14:38e4af417f34 modularisierung

fixed oopsie
author casties
date Wed, 16 Jun 2010 21:04:42 +0200
parents 3e570be16eea
children ee3a8be80aa5
files documentViewer.py
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/documentViewer.py	Wed Jun 16 20:48:34 2010 +0200
+++ b/documentViewer.py	Wed Jun 16 21:04:42 2010 +0200
@@ -217,7 +217,7 @@
         pt = getattr(self.template, 'thumbs_main_rss')
         
         if viewMode=="auto": # automodus gewaehlt
-            if docinfo.get("textURL",'') and self.textViewerUrl: #texturl gesetzt und textViewer konfiguriert
+            if docinfo.has_key("textURL") or docinfo.has_key('textURLPath'): #texturl gesetzt und textViewer konfiguriert
                 viewMode="text"
             else:
                 viewMode="images"
@@ -253,7 +253,7 @@
             docinfo = self.getToc(mode=tocMode, docinfo=docinfo)
             
         if viewMode=="auto": # automodus gewaehlt
-            if docinfo.get("textURL",''): #texturl gesetzt und textViewer konfiguriert
+            if docinfo.has_key("textURL") or docinfo.has_key('textURLPath'): #texturl gesetzt und textViewer konfiguriert
                 viewMode="text_dict"
             else:
                 viewMode="images"
@@ -568,7 +568,8 @@
         if viewerUrls and (len(viewerUrls) > 0):
             viewerUrl = getTextFromNode(viewerUrls[0])
             docinfo['viewerURL'] = viewerUrl
-                   
+        
+        # old style text URL
         textUrls = dom.xpath("//texttool/text")
         if textUrls and (len(textUrls) > 0):
             textUrl = getTextFromNode(textUrls[0])
@@ -580,6 +581,7 @@
             
             docinfo['textURL'] = textUrl
     
+        # new style text-url-path
         textUrls = dom.xpath("//texttool/text-url-path")
         if textUrls and (len(textUrls) > 0):
             textUrl = getTextFromNode(textUrls[0])