Diff for /documentViewer/documentViewer.py between versions 1.12 and 1.13

version 1.12, 2006/06/13 15:21:47 version 1.13, 2006/06/14 16:24:10
Line 163  class documentViewer(Folder): Line 163  class documentViewer(Folder):
                                   
     def getDirinfoFromDigilib(self,path,docinfo=None):      def getDirinfoFromDigilib(self,path,docinfo=None):
         """gibt param von dlInfo aus"""          """gibt param von dlInfo aus"""
           num_retries = 3
         if docinfo is None:          if docinfo is None:
             docinfo = {}              docinfo = {}
                           
         imageUrl=self.digilibBaseUrl+"/dirInfo-xml.jsp?mo=dir&fn="+path          infoUrl=self.digilibBaseUrl+"/dirInfo-xml.jsp?mo=dir&fn="+path
           
         zLOG.LOG("documentViewer (getparamfromdigilib)", zLOG.INFO, "dirInfo from %s"%(imageUrl))          zLOG.LOG("documentViewer (getparamfromdigilib)", zLOG.INFO, "dirInfo from %s"%(infoUrl))
                   
         for cnt in (1,2,3):          for cnt in range(num_retries):
             try:              try:
                 dom = NonvalidatingReader.parseUri(imageUrl)                  # dom = NonvalidatingReader.parseUri(imageUrl)
                   txt=urllib.urlopen(infoUrl).read()
                   dom = Parse(txt)
                 break                  break
             except:              except:
                 zLOG.LOG("documentViewer (getdirinfofromdigilib)", zLOG.ERROR, "error reading %s (try %d)"%(imageUrl,cnt))                  zLOG.LOG("documentViewer (getdirinfofromdigilib)", zLOG.ERROR, "error reading %s (try %d)"%(infoUrl,cnt))
         else:          else:
             raise IOError("Unable to get dir-info from %s"%(imageUrl))              raise IOError("Unable to get dir-info from %s"%(infoUrl))
                   
         sizes=dom.xpath("//dir/size")          sizes=dom.xpath("//dir/size")
         zLOG.LOG("documentViewer (getparamfromdigilib)", zLOG.INFO, "dirInfo:size"%sizes)          zLOG.LOG("documentViewer (getparamfromdigilib)", zLOG.INFO, "dirInfo:size"%sizes)
Line 201  class documentViewer(Folder): Line 204  class documentViewer(Folder):
         else:          else:
             # online path              # online path
             server=self.digilibBaseUrl+"/servlet/Texter?fn="              server=self.digilibBaseUrl+"/servlet/Texter?fn="
             metaUrl=server+url              metaUrl=server+url.replace("/mpiwg/online","")
             if not metaUrl.endswith("index.meta"):              if not metaUrl.endswith("index.meta"):
                 metaUrl += "/index.meta"                  metaUrl += "/index.meta"
                   
         for n in range(num_retries):          for cnt in range(num_retries):
             try:              try:
                 # patch dirk encoding fehler treten dann nicht mehr auf                  # patch dirk encoding fehler treten dann nicht mehr auf
                 # dom = NonvalidatingReader.parseUri(metaUrl)                  # dom = NonvalidatingReader.parseUri(metaUrl)
                 txt=urllib.urlopen(metaUrl).read()                  txt=urllib.urlopen(metaUrl).read()
                 dom = Parse(txt)                  dom = Parse(txt)
                   break
             except:              except:
                 zLOG.LOG("ERROR documentViewer (getIndexMata)", zLOG.INFO,"%s (%s)"%sys.exc_info()[0:2])                  zLOG.LOG("ERROR documentViewer (getIndexMata)", zLOG.INFO,"%s (%s)"%sys.exc_info()[0:2])
                                   

Removed from v.1.12  
changed lines
  Added in v.1.13


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>