comparison restService/redirector.py @ 14:a2bcca6539fd

static pages
author dwinter
date Mon, 12 Nov 2012 09:29:28 +0100
parents 0287aed01f2b
children 5bab6e95980e
comparison
equal deleted inserted replaced
13:a1577a498c85 14:a2bcca6539fd
13 13
14 viewers={} # hash mit allen viewer name --> urls 14 viewers={} # hash mit allen viewer name --> urls
15 purlHandler=None 15 purlHandler=None
16 def __init__(self): 16 def __init__(self):
17 #read config file for the viewers 17 #read config file for the viewers
18 confFile= file("/usr/local/metadataServices/purlService/restService/viewer.config") 18 #confFile= file("/usr/local/metadataServices/purlService/restService/viewer.config")
19 19 confFile= file("/Users/dwinter/Documents/Projekte/MetaDataManagement/purlService/restService/viewer.config")
20 self.purlHandler = manageIndexMetaPURLs.IndexMetaPURLManager() 20 self.purlHandler = manageIndexMetaPURLs.IndexMetaPURLManager()
21 21
22 for line in confFile.readlines(): 22 for line in confFile.readlines():
23 splitted=line.split(",") 23 splitted=line.split(",")
24 24
51 if flavour not in self.viewers.keys(): 51 if flavour not in self.viewers.keys():
52 raise web.notfound("no viewer for %s"%flavour) 52 raise web.notfound("no viewer for %s"%flavour)
53 53
54 formats = self.viewers[flavour] 54 formats = self.viewers[flavour]
55 55
56
57 viewerWithIndexMetaFormatString = formats[0].rstrip().lstrip().replace("\n",'') 56 viewerWithIndexMetaFormatString = formats[0].rstrip().lstrip().replace("\n",'')
58 viewerWithImagePathFormatString = formats[1].lstrip().lstrip().replace("\n",'') 57 viewerWithImagePathFormatString = formats[1].lstrip().lstrip().replace("\n",'')
59
60 58
61 59
62 # checke ob es einen Image path gibt 60 # checke ob es einen Image path gibt
63 path,validity = self.purlHandler.getImagePathValidity(purl) 61 path,validity = self.purlHandler.getImagePathValidity(purl)
64 if path is not None and path!="": 62 if path is not None and path!="":