# HG changeset patch # User casties # Date 1153241997 -7200 # Node ID f3bc59cf64d91bd40b90483959adcfa347bb241b # Parent fbc7258e4b5c9f1894a22a95ae237bb2e5caead8 fixed some problems with bad index.meta files (text-tools mode) diff -r fbc7258e4b5c -r f3bc59cf64d9 documentViewer.py --- a/documentViewer.py Fri Jul 14 18:22:36 2006 +0200 +++ b/documentViewer.py Tue Jul 18 18:59:57 2006 +0200 @@ -284,9 +284,14 @@ if dom is None: dom = self.getIndexMeta(url) + archivePath = None + archiveName = None + archiveNames=dom.xpath("//resource/name") if archiveNames and (len(archiveNames)>0): archiveName=getTextFromNode(archiveNames[0]) + else: + zLOG.LOG("documentViewer (getdocinfofromtexttool)", zLOG.WARNING,"resource/name missing in: %s"%(url)) archivePaths=dom.xpath("//resource/archive-path") if archivePaths and (len(archivePaths)>0): @@ -294,10 +299,17 @@ # clean up archive path if archivePath[0] != '/': archivePath = '/' + archivePath - if not archivePath.endswith(archiveName): + if archiveName and (not archivePath.endswith(archiveName)): archivePath += "/" + archiveName else: - archivePath=None + # try to get archive-path from url + zLOG.LOG("documentViewer (getdocinfofromtexttool)", zLOG.WARNING,"resource/archive-path missing in: %s"%(url)) + if (not url.startswith('http')): + archivePath = url.replace('index.meta', '') + + if archivePath is None: + # we balk without archive-path + raise IOError("Missing archive-path (for text-tool) in %s"%(url)) imageDirs=dom.xpath("//texttool/image") if imageDirs and (len(imageDirs)>0): diff -r fbc7258e4b5c -r f3bc59cf64d9 version.txt --- a/version.txt Fri Jul 14 18:22:36 2006 +0200 +++ b/version.txt Tue Jul 18 18:59:57 2006 +0200 @@ -1,1 +1,1 @@ -DocumentViewer 0.2.6 \ No newline at end of file +DocumentViewer 0.3.1 \ No newline at end of file