from peak.api import * class SubComponent(binding.Component): security.allow( index_html = security.Anybody, ) def index_html(self): return "hello world from subcomponent" class TemplateTest(binding.Component): security.allow( index_html = security.Anybody, foo = security.Anybody, bar = security.Anybody, ) foo = "The title or templateTest" bar = 1,2,3 index_html = web.bindResource('/wwwmain.resources/template.pwt', permissionNeeded=security.Anybody) class WebApp(binding.Component): security.allow( index_html = security.Anybody, subcomp = security.Anybody, template = security.Anybody, foo = security.Anybody, bar = security.Anybody, xml = security.Anybody, image = security.Anybody, ) def index_html(self): return "Hello world!" foo = "The title" bar = 1,2,3 subcomp = binding.Make(SubComponent) template = binding.Make(TemplateTest) test = web.bindResource('/wwwmain.resources/template.pwt', permissionNeeded=security.Anybody) xml = web.bindResource('/wwwmain.resources/testxml.xml', permissionNeeded=security.Anybody) image = web.bindResource('/wwwmain.resources/testimage.jpg', permissionNeeded=security.Anybody)