diff --git a/direct/src/http/LandingPage.py b/direct/src/http/LandingPage.py index 9ec2a7f67a..2e793e5dd3 100755 --- a/direct/src/http/LandingPage.py +++ b/direct/src/http/LandingPage.py @@ -3,13 +3,18 @@ from direct.directnotify.DirectNotifyGlobal import directNotify from pandac.PandaModules import VirtualFileSystem from pandac.PandaModules import Filename from pandac.PandaModules import DSearchPath +from direct.showbase import ElementTree as ET import LandingPageHTML +from StringIO import StringIO class LandingPage: notify = directNotify.newCategory("LandingPage") def __init__(self): self.headerTemplate = LandingPageHTML.header self.footerTemplate = LandingPageHTML.footer + + # allow modifications to the page head tag + self._headET = ET.Element('head') self.menu = {} @@ -47,10 +52,18 @@ class LandingPage: return LandingPageHTML.getTabs(self.menu,activeTab) def getHeader(self, activeTab = "Main"): + headContent = '' + for child in self._headET.getchildren(): + fileStr = StringIO() + ET.ElementTree(child).write(fileStr) + headContent += fileStr.getvalue() s = self.headerTemplate % {'titlestring' : LandingPageHTML.title, - 'menustring' : self.getMenu(activeTab)} + 'menustring' : self.getMenu(activeTab), + 'headContent' : headContent,} return s - + + def getHead(self): + return self._headET def getFooter(self): return self.footerTemplate % {'contact' : LandingPageHTML.contactInfo} diff --git a/direct/src/http/LandingPageHTML.py b/direct/src/http/LandingPageHTML.py index 779fea2f75..9b8ca4f860 100755 --- a/direct/src/http/LandingPageHTML.py +++ b/direct/src/http/LandingPageHTML.py @@ -261,6 +261,7 @@ header = ''' %(titlestring)s +%(headContent)s