/usr/share/paster_templates/webkit/+package+/sitepage.py_tmpl is in python-pastewebkit 1.0-7.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | import os
from Component import CPage
from Component.notify import NotifyComponent
from ZPTKit.zptcomponent import ZPTComponent
from paste.deploy import CONFIG
from paste.url import URL
# -*- Extra imports: -*-
__all__ = ['SitePage', 'CONFIG']
class SitePage(CPage):
components = [
ZPTComponent([os.path.join(os.path.dirname(__file__),
'templates')]),
NotifyComponent(),
# -*- Extra components: -*-
]
def title(self):
return self.options.get('title', CPage.title(self))
def awake(self, trans):
CPage.awake(self, trans)
# Add application-wide setup routines here
self.setup()
def setup(self):
# This method should only be overridden by servlets, not
# abstract classes (also teardown()).
pass
def sleep(self, trans):
self.teardown()
CPage.sleep(self, trans)
def teardown(self):
pass
def writeHTML(self):
self.writeTemplate()
def preAction(self, action):
self.setView('writeContent')
def postAction(self, action):
if self.view() is not None:
self.writeHTML()
|