def restart_server(self): self.sessionFileRemove() self.topyFileRemove() print("start to parser Config") parser=configParser.pyLatteConfigPaser() self.urlMap=parser.getUrlMap() self.databaseInfo = parser.getDataBaseInfo() self.filterMap=parser.getFilterMap() print("end to parser Config\n") print("start to pylToPy") for item in self.urlMap.values(): print("processing pylTopy : "+item) #Looking for filter to execute before pyl files executed. filterStr = "" for item1 in self.filterMap.keys(): if item in self.filterMap[item1]: filterStr += open('pyl/'+item1, encoding='utf-8').read()+"\n" #print(str) #print(filterStr); #if item in self.filterMap p=pylToPy.pylToPy(item,filterStr) p.outPy() print("end to pylToPy\n") print(pylatte_AsciiArt) pass
def __call__(self, environ, start_response): ##print(self.parser.getLastConfigFileModifyTime()) ##print(self.parser.getConfigFileModifyTime()) if self.parser.getLastConfigFileModifyTime() != self.parser.getConfigFileModifyTime(): """설정파일을 읽어왔을때의 그 파일의 수정시간이 다른다면 다시 읽어오기.""" self.parser = configParser.pyLatteConfigPaser() pass environ["urlMap"] = self.parser.getUrlMap() environ["filterMap"] = self.parser.getFilterMap() appiter = self.app(environ, start_response) for item in appiter: #print(str(item)) yield item
def __init__(self, app): self.app = app self.parser = configParser.pyLatteConfigPaser() print(pylatte_AsciiArt)