changeset 530:5c7433c2515c

fix problems with texttool/text
author casties
date Thu, 26 Apr 2012 19:37:15 +0200
parents f0e28d31ebc6
children ac232c293ad9
files MpdlXmlTextServer.py documentViewer.py zpt/viewer_text.zpt
diffstat 3 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/MpdlXmlTextServer.py	Thu Apr 26 14:45:05 2012 +0200
+++ b/MpdlXmlTextServer.py	Thu Apr 26 19:37:15 2012 +0200
@@ -214,7 +214,10 @@
             logging.debug("getTextPage: using cached text")
             return pageinfo['textPage']
         
-        docpath = docinfo['textURLPath']
+        docpath = docinfo.get('textURLPath', None)
+        if not docpath:
+            return None
+        
         # just checking
         if pageinfo['current'] != pn:
             logging.warning("getTextPage: current!=pn!")
--- a/documentViewer.py	Thu Apr 26 14:45:05 2012 +0200
+++ b/documentViewer.py	Thu Apr 26 19:37:15 2012 +0200
@@ -277,7 +277,8 @@
         
         # auto viewMode: text if there is a text else images
         if viewMode=="auto": 
-            if docinfo.get('textURL', None) or docinfo.get('textURLPath', None): 
+            if docinfo.get('textURLPath', None):
+                # docinfo.get('textURL', None) not implemented yet
                 viewMode = "text"
                 if viewLayer is None:
                     viewLayer = "dict"
--- a/zpt/viewer_text.zpt	Thu Apr 26 14:45:05 2012 +0200
+++ b/zpt/viewer_text.zpt	Thu Apr 26 19:37:15 2012 +0200
@@ -34,7 +34,7 @@
 </head>
 <body tal:condition="numPages">
   <tal:block
-    tal:define="docpath docinfo/textURLPath;
+    tal:define="docpath docinfo/textURLPath | nothing;
                 pn pageinfo/pn; 
                 flowLtr python:docinfo.get('pageFlow','ltr')!='rtl';
                 textPage python:here.getTextPage(mode=viewLayer, pn=pn, docinfo=docinfo, pageinfo=pageinfo) or '[no text here]';">