Source

Webware / PSP / Examples / Hello.psp

Full commit
<%-- This is a PSP comment. It won't show up in the HTML or even in the class that this file will generate --%>

<%@ page imports = "sys,os,time,PSP.Examples.PSPExamplePage:PSPExamplePage"%><%-- Here's the modules that I need in this file. --%>
<%@ page method="writeContent" %><%-- This is the method of the base class that I want to override, writeHTML is the default. --%>
<%@ page extends="PSPExamplePage"%><%--This is the base class for this page. Page is the default. --%>
<%@ page isInstanceSafe="yes" %><%-- Each instance of this class can be used multiple times. --%>
<%@ page indentType="spaces" %><%-- Use spaces to indent the sourcefile that this template will produce. --%>

<%--  Method declaration Test --%>
<psp:method name="title" params="">
return "PSP Hello"
</psp:method>

<h1 align="center" style="color:navy">Hello from PSP!</h1>

<%-- This image is served by WebKit --%>
<p align="center"><img src="psplogo.png" alt="Python Server Pages"></p>

<p>This is <strong>PSP</strong>. You can browse through the <a href="PSPDocs.psp">docs</a> here.</p>

<p>Here are some examples. <a href="PSPTests">PSPTests</a> shows most of the functionality:</p>

<ul><%
import glob
filesyspath = self.request().serverSidePath()
files = glob.glob(os.path.join(os.path.dirname(filesyspath), "*.psp"))
for i in files:
    file = os.path.split(i)[1]$%><%-- Aha! Here's where we need the complex block syntax. Ok. --%>
<li><a href="<%=file%>"> <%= file %></a></li>
<% end %></ul>

<p>So anyway, read through the <a href="PSPDocs.psp">docs</a>, and look at <a href="PSPTests">PSPTests</a> for examples. Let us know what we can do better or more effectively.</p>