changeset 75:9673218e155b

minorCVS: ----------------------------------------------------------------------
author dwinter
date Tue, 04 Nov 2008 23:03:56 +0100
parents 5c9837484085
children 47d76f050883
files documentViewer.py
diffstat 1 files changed, 11 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/documentViewer.py	Tue Nov 04 21:36:51 2008 +0100
+++ b/documentViewer.py	Tue Nov 04 23:03:56 2008 +0100
@@ -21,7 +21,7 @@
 import math
 
 import urlparse 
-
+from types import *
 def logger(txt,method,txt2):
     """logging"""
     logging.info(txt+ txt2)
@@ -167,12 +167,17 @@
             else:
                 viewMode="images"
                
-        return pt(docinfo=docinfo,pageinfo=pageinfo,viewMode=viewMode,marks=self.generateMarks(mk))
+        return pt(docinfo=docinfo,pageinfo=pageinfo,viewMode=viewMode,mk=self.generateMarks(mk))
   
     def generateMarks(self,mk):
         ret=""
+	if mk is None:
+		return ""
+	
+	if type(mk) is not ListType:
+		mk=[mk]
         for m in mk:
-            ret+="mk=%s"%mk
+            ret+="mk=%s"%m
         return ret
     
     def getLink(self,param=None,val=None):
@@ -293,7 +298,7 @@
             metaUrl=server+url.replace("/mpiwg/online","")
             if not metaUrl.endswith("index.meta"):
                 metaUrl += "/index.meta"
-        print metaUrl
+        logging.debug("METAURL: %s"%metaUrl)
         for cnt in range(num_retries):
             try:
                 # patch dirk encoding fehler treten dann nicht mehr auf
@@ -552,7 +557,7 @@
         elif mode=="imagepath":
             docinfo = self.getDocinfoFromImagePath(url, docinfo=docinfo)
         elif mode=="filepath":
-            docinfo = self.getDocinfoFromImagePath(url, docinfo=docinfo,cut=2)
+            docinfo = self.getDocinfoFromImagePath(url, docinfo=docinfo,cut=1)
         else:
             logger("documentViewer (getdocinfo)", logging.ERROR,"unknown mode!")
             raise ValueError("Unknown mode %s"%(mode))
@@ -583,7 +588,7 @@
             pageinfo['numgroups'] = int(np / grpsize)
             if np % grpsize > 0:
                 pageinfo['numgroups'] += 1
-                
+        logging.debug("getPageInfo: %s"%repr(pageinfo))
         return pageinfo
                 
     def text(self,mode,url,pn):