def application(environ, start_response): import sys path = 'YOUR_WWW_ROOT_DIRECTORY' if path not in sys.path: sys.path.append(path) from pyinfo import pyinfo output = pyinfo() start_response('200 OK', [('Content-type', 'text/html')]) return [output]
def application(environ, start_response): import sys path = '/var/www/webroot/ROOT' if path not in sys.path: sys.path.append(path) from pyinfo import pyinfo output = pyinfo() start_response('200 OK', [('Content-type', 'text/html')]) yield output.encode('utf-8')
def onPreRender(self): osiris.IMainPage.onPreRender(self) self.page.addCss("/" + globalvars.extension.id.getString() + "/css/pythoninfo.css") document = osiris.XMLDocument() root = document.create("modules") template = osiris.HtmlXSLControl() template.stylesheet = self.loadStylesheet(os.path.join(os.path.dirname(__file__), "pythoninfo.xsl")) template.document = document self.getArea(osiris.pageAreaContent).controls.add(template) from pyinfo import pyinfo output = pyinfo() output = "<div class=\"pyinfo\">" + output + "</div>" self.getArea(osiris.pageAreaContent).controls.add(osiris.HtmlLiteral(output))
def onPreRender(self): osiris.IMainPage.onPreRender(self) self.page.addCss("/" + globalvars.extension.id.getString() + "/css/pythoninfo.css") document = osiris.XMLDocument() root = document.create("modules") template = osiris.HtmlXSLControl() template.stylesheet = self.loadStylesheet( os.path.join(os.path.dirname(__file__), "pythoninfo.xsl")) template.document = document self.getArea(osiris.pageAreaContent).controls.add(template) from pyinfo import pyinfo output = pyinfo() output = "<div class=\"pyinfo\">" + output + "</div>" self.getArea(osiris.pageAreaContent).controls.add( osiris.HtmlLiteral(output))
def get(self): self.write(pyinfo.pyinfo())
def info(): return pyinfo()
def pyinfopage(): return pyinfo()