I think you're right, it wouldn't be _too_ hard to allow PSPs to extend
other PSPs.  You're welcome to try...  I'm not likely to try any time soon.

What would be even cooler is if we could come up with a way for a Python
servlet to be derived from a PSP to make it fully general.  Random thought,
without looking at the PSP code at all: Perhaps we would need to expose a
PSPFactory:


from PSP.PSPFactory import PSPFactory

# This returns the Python class corresponding to MyPSP.psp
MyPSP = PSPFactory('MyPSP')

class MyServlet(MyPSP):
        # override methods here...


I'm not sure if this is possible though.

- Geoff


> -----Original Message-----
> From: Luke Holden [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 08, 2003 2:20 PM
> To: Geoffrey Talvola
> Cc: 'Webware devel'
> Subject: Re: [Webware-devel] Bug with PSP and using mixins
> 
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> > The PSP compiler at compile time has no way to know whether you're
> > specifying a module or class, so it generates code that 
> dynamically checks
> > at import time.
> 
> Ahhhh okay. That makes since.
> 
> Curious question... PSP currently does not currently allow 
> you to extend other 
> PSP pages does it?
> 
> If not... how hard would it be to add this?
> 
> If it does not... I don't think it would be TOO hard to add? 
> Maybe have it so 
> using .psp in the import name would make the compiler know 
> that what your 
> trying to import a PSP page vs a class/module. And in the 
> extend part, it 
> would replace the page name with the compiled class based on 
> information it 
> gathered from the import.
> 
> so you could have:
> <%@ page imports = "layout:siteLayout.psp, 
> Security.SecureMixIn:SecureMixIn" 
> %>
> 
> <% page extends = "SecureMixIn,siteLayout.psp" %>
> 
> With siteLayout.psp being replaced by the classname/whatnot 
> of the compiled 
> siteLayout page.
> 
> So then siteLayout.psp could be something like:
> 
> <%@ page method = "writeHTMLBody" %>
> <%@ page imports = "BaseLayout:BaseLayout" %>
> <%@ page extends = "BaseLayout" %>
> <%@ page indentType="braces" %>
> 
> ... some html code here...
> <% self.includeURL("navigation/nav") %>
> ... more html code ...
> <% self.writeScreen() %>
> ... last bit of html code ...
> 
> 
> 
> Which would be GREAT, considering SiteLayout.py is mainly 
> for... layout =)
> See my Model2+1 wiki page for an example of how I am using SiteLayout.
> 
> Anyways... going to also cc this to the mailing list.
> 
> Thanks
> - -- 
> Luke Holden
> eBI Solutions
> Main: (949) 387-5182
> Email: [EMAIL PROTECTED]
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.1 (GNU/Linux)
> 
> iD8DBQE+HHnx3q5xXfLZTQkRApgHAJ9UaKeI88NBIyBchojSvB+9x0FkzACfUcOl
> apwsm0qHpGuo83YB1kqoD9U=
> =3Ug3
> -----END PGP SIGNATURE-----
> 


-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
Webware-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-devel

Reply via email to