comparison restService/restService.py @ 23:7fdd2d68fd6b

imagepath added
author dwinter
date Tue, 12 Mar 2013 14:32:56 +0100
parents cf4503528b5e
children 6776aeff118c
comparison
equal deleted inserted replaced
22:f748e2b684c9 23:7fdd2d68fd6b
24 '/indexMeta/(.+)','indexMeta', 24 '/indexMeta/(.+)','indexMeta',
25 '/','serviceDescription', 25 '/','serviceDescription',
26 '/searchLines','searchLines', 26 '/searchLines','searchLines',
27 '/searchLines/annotator/search','searchLines', 27 '/searchLines/annotator/search','searchLines',
28 '/getPurls','getPurls', 28 '/getPurls','getPurls',
29 '/searchSolr','searchSolr' 29 '/searchSolr','searchSolr',
30 '/imagePath/(.+)','imagePath'
30 ) 31 )
31 32
32 33
33 app = web.application(urls, globals()) 34 app = web.application(urls, globals())
34 35
89 90
90 91
91 return path 92 return path
92 93
93 94
95 class imagePath:
96
97 def __init__(self):
98 self.md=manageIndexMetaPURLs.IndexMetaPURLManager()
99
100 def GET(self,purl):
101
102 path,validity=self.md.getImagePathValidity(purl)
103
104 if path is None:
105 raise web.notfound("Cannnot find a URL to this path")
106
107 if validity is manageIndexMetaPURLs.PERM_NON_VALID:
108 raise web.notfound("PURL NON VALID ANYMORE!")
109
110 if validity is manageIndexMetaPURLs.TEMP_NON_VALID:
111 return web.notfound("PURL currently not VALID try later!")
112
113
114 return path
115
116
94 117
95 118
96 if __name__ == "__main__": 119 if __name__ == "__main__":
97 app.run() 120 app.run()