changeset 580:0806cb9061c1

fixed another bug when url starts with /mpiwg/online/
author casties
date Mon, 29 Oct 2012 11:57:30 +0100
parents fc861a6cef17
children 514902fb6b8a
files documentViewer.py version.txt
diffstat 2 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/documentViewer.py	Fri Oct 26 12:53:43 2012 +0200
+++ b/documentViewer.py	Mon Oct 29 11:57:30 2012 +0100
@@ -554,9 +554,12 @@
         if mode=="texttool": 
             # url points to document dir or index.meta
             metaDom = self.metadataService.getDomFromPathOrUrl(url)
-            docUrl = url.replace('/index.meta', '')
             if metaDom is None:
                 raise IOError("Unable to find index.meta for mode=texttool!")
+            
+            docUrl = url.replace('/index.meta', '')
+            if url.startswith('/mpiwg/online/'):
+                docUrl = url.replace('/mpiwg/online/', '', 1)
 
         elif mode=="imagepath":
             # url points to folder with images, index.meta optional
@@ -648,6 +651,7 @@
             # number of images from digilib
             if docinfo.get('imagePath', None):
                 imgpath = docinfo['imagePath'].replace('/mpiwg/online/', '', 1)
+                logging.debug("imgpath=%s"%imgpath)
                 docinfo['imageURL'] = "%s?fn=%s"%(self.digilibScalerUrl, imgpath)
                 docinfo = self.getDocinfoFromDigilib(docinfo, imgpath)
             else:
--- a/version.txt	Fri Oct 26 12:53:43 2012 +0200
+++ b/version.txt	Mon Oct 29 11:57:30 2012 +0100
@@ -1,1 +1,1 @@
-DocumentViewer 2.2.6
\ No newline at end of file
+DocumentViewer 2.2.7
\ No newline at end of file