Mercurial > hg > documentViewer
changeset 634:618b600c805a
fix broken mode imagepath.
author | casties |
---|---|
date | Mon, 17 Aug 2015 16:14:38 +0200 |
parents | 5d1534bd19b3 |
children | 8d460ddb45b7 |
files | documentViewer.py version.txt |
diffstat | 2 files changed, 4 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/documentViewer.py Thu Jul 02 10:31:13 2015 +0200 +++ b/documentViewer.py Mon Aug 17 16:14:38 2015 +0200 @@ -551,6 +551,7 @@ docUrl = url.replace('/index.meta', '') if url.startswith('/mpiwg/online/'): docUrl = url.replace('/mpiwg/online/', '', 1) + elif mode=="textpath": #url points to an textfile #index.meta optional @@ -560,13 +561,11 @@ try: metaDom = self.metadataService.getDomFromPathOrUrl(docUrl) - removeINDEXMETA_NS(metaDom) - - except: metaDom = None + #metaDom = self.metadataService.getDomFromPathOrUrl(docUrl) #docinfo['imagePath'] = url.replace('/mpiwg/online', '', 1) docinfo['textURLPath'] = url.replace('/mpiwg/online', '', 1) @@ -586,9 +585,8 @@ elif mode=="imagepath": # url points to folder with images, index.meta optional # asssume index.meta in parent dir - + docUrl = getParentPath(url) metaDom = self.metadataService.getDomFromPathOrUrl(docUrl) - docinfo['imagePath'] = url.replace('/mpiwg/online', '', 1) elif mode=="hocr": @@ -624,7 +622,6 @@ # process index.meta contents if metaDom is not None and (metaDom.tag == 'resource' or metaDom.tag == "{%s}resource"%INDEXMETA_NS): - print("MD") # document directory name and path resource = self.metadataService.getResourceData(dom=metaDom, recursive=1) if resource: