Пример #1
0
 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
Пример #2
0
 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
Пример #3
0
 def testUpdateParamsSeasonSpecified(self):
     params = {"season": "10"}
     Settings.updateParams(params)
     Settings.setRootDirectory("/home/sehicl")
     self.assertEquals("/home/sehicl/data/2009-10.xml", params["xmlFile"])
Пример #4
0
 def testUpdateParamsNoSeasonSpecified(self):
     params = {}
     Settings.defaultSeason = 8
     Settings.setRootDirectory("/home/sehicl")
     Settings.updateParams(params)
     self.assertEquals("/home/sehicl/data/2007-08.xml", params["xmlFile"])
Пример #5
0
 def testUpdateParamsSeasonSpecified(self):
     params = {"season": "10"}
     Settings.updateParams(params)
     Settings.setRootDirectory("/home/sehicl")
     self.assertEquals("/home/sehicl/data/2009-10.xml", params["xmlFile"])
Пример #6
0
 def testUpdateParamsNoSeasonSpecified(self):
     params = {}
     Settings.defaultSeason = 8
     Settings.setRootDirectory("/home/sehicl")
     Settings.updateParams(params)
     self.assertEquals("/home/sehicl/data/2007-08.xml", params["xmlFile"])