Changeset 43:f3bc59cf64d9 in documentViewer


Ignore:
Timestamp:
Jul 18, 2006, 4:59:57 PM (18 years ago)
Author:
casties
Branch:
default
Message:

fixed some problems with bad index.meta files (text-tools mode)

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • documentViewer.py

    r42 r43  
    285285           dom = self.getIndexMeta(url)
    286286       
     287       archivePath = None
     288       archiveName = None
     289
    287290       archiveNames=dom.xpath("//resource/name")
    288291       if archiveNames and (len(archiveNames)>0):
    289292           archiveName=getTextFromNode(archiveNames[0])
     293       else:
     294           zLOG.LOG("documentViewer (getdocinfofromtexttool)", zLOG.WARNING,"resource/name missing in: %s"%(url))
    290295       
    291296       archivePaths=dom.xpath("//resource/archive-path")
     
    295300           if archivePath[0] != '/':
    296301               archivePath = '/' + archivePath
    297            if not archivePath.endswith(archiveName):
     302           if archiveName and (not archivePath.endswith(archiveName)):
    298303               archivePath += "/" + archiveName
    299304       else:
    300            archivePath=None
     305           # try to get archive-path from url
     306           zLOG.LOG("documentViewer (getdocinfofromtexttool)", zLOG.WARNING,"resource/archive-path missing in: %s"%(url))
     307           if (not url.startswith('http')):
     308               archivePath = url.replace('index.meta', '')
     309               
     310       if archivePath is None:
     311           # we balk without archive-path
     312           raise IOError("Missing archive-path (for text-tool) in %s"%(url))
    301313       
    302314       imageDirs=dom.xpath("//texttool/image")
  • version.txt

    r42 r43  
    1 DocumentViewer 0.2.6
     1DocumentViewer 0.3.1
Note: See TracChangeset for help on using the changeset viewer.