from Page import Page class SidebarPage(Page): """WebKit page template class for pages with a sidebar. SidebarPage is an abstract superclass for pages that have a sidebar (as well as a header and "content well"). Sidebars are normally used for navigation (e.g., a menu or list of links), showing small bits of info and occasionally a simple form (such as login or search). Subclasses should override cornerTitle(), writeSidebar() and writeContent() (and title() if necessary; see Page). The utility methods menuHeading() and menuItem() can be used by subclasses, typically in their implementation of writeSidebar(). WebKit itself uses this class: Examples/ExamplePage and Admin/AdminPage both inherit from it. TO DO * More consequent use style sheets; get rid of tables completely. * The header, corner and colors are not easy to customize via subclasses. """ ## StyleSheet ## _styleSheet = ''' ''' def writeStyleSheet(self): """We're using a simple internal style sheet. This way we avoid having to care about where an external style sheet should be located when this class is used in another context. """ self.writeln('' % self._styleSheet) ## Content methods ## def writeBodyParts(self): wr = self.writeln wr('
| ') self.writeSidebar() wr(' | ') wr('') self.writeContent() wr(' | ') wr('