Mercurial > hg > purlService
changeset 23:7fdd2d68fd6b
imagepath added
author | dwinter |
---|---|
date | Tue, 12 Mar 2013 14:32:56 +0100 |
parents | f748e2b684c9 |
children | 9ef155b1eec5 |
files | restService/restService.py |
diffstat | 1 files changed, 24 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/restService/restService.py Wed Jan 30 08:37:48 2013 +0100 +++ b/restService/restService.py Tue Mar 12 14:32:56 2013 +0100 @@ -26,7 +26,8 @@ '/searchLines','searchLines', '/searchLines/annotator/search','searchLines', '/getPurls','getPurls', - '/searchSolr','searchSolr' + '/searchSolr','searchSolr', + '/imagePath/(.+)','imagePath' ) @@ -91,6 +92,28 @@ return path +class imagePath: + + def __init__(self): + self.md=manageIndexMetaPURLs.IndexMetaPURLManager() + + def GET(self,purl): + + path,validity=self.md.getImagePathValidity(purl) + + if path is None: + raise web.notfound("Cannnot find a URL to this path") + + if validity is manageIndexMetaPURLs.PERM_NON_VALID: + raise web.notfound("PURL NON VALID ANYMORE!") + + if validity is manageIndexMetaPURLs.TEMP_NON_VALID: + return web.notfound("PURL currently not VALID try later!") + + + return path + + if __name__ == "__main__":