def getHtml(self, params={}): html = """ <html> <head> {header} </head> <body id=\"{pageId}\"> {body} </body> </html> """ self.allParams = {} self.allParams.update(self.coreParams) self.allParams.update(params) Settings.updateParams(self.allParams) theHeader = self.getHtmlHeader() thePageId = self.pageId theBody = self.getHtmlBody() answer = Page.stripWhitespace(html.format(header=theHeader, pageId=thePageId, body=theBody)) return answer
def getHtml(self, params={}): html = """ <html> <head> {header} </head> <body id=\"{pageId}\"> {body} </body> </html> """ self.allParams = {} self.allParams.update(self.coreParams) self.allParams.update(params) Settings.updateParams(self.allParams) theHeader = self.getHtmlHeader() thePageId = self.pageId theBody = self.getHtmlBody() answer = Page.stripWhitespace( html.format(header=theHeader, pageId=thePageId, body=theBody)) return answer
def testUpdateParamsSeasonSpecified(self): params = {"season": "10"} Settings.updateParams(params) Settings.setRootDirectory("/home/sehicl") self.assertEquals("/home/sehicl/data/2009-10.xml", params["xmlFile"])
def testUpdateParamsNoSeasonSpecified(self): params = {} Settings.defaultSeason = 8 Settings.setRootDirectory("/home/sehicl") Settings.updateParams(params) self.assertEquals("/home/sehicl/data/2007-08.xml", params["xmlFile"])