Re: Programmatic parents?
Iwan Vosloo <[email protected]> Tue, 08 Aug 2006 08:56:38 +0200
| Newsgroups | gmane.comp.python.spyce.general |
|---|---|
| Message-ID | <[email protected]> |
Hi Jonathan,
On Mon, 2006-08-07 at 15:50 -0700, Jonathan Ellis wrote:
> You have strange requirements. :)
I suppose... It allows me to write pieces of website---in terms of
"children" only---that can be re-used in more than one complete website
while retaining the main look and layout of whichever main website such
children are plugged into. The latter is accomplished by means of the
"parent" the "children" are rendered inside of. I'm not aware of any
other way of doing this?
> But this should actually be pretty
> easy. Just look at how spyce.py:spyceProcess uses self._parent, and
> forge the appropriate parent data appropriately before your handler
> calls into that.
That's good news...but I can't find any such usage of self._parent.
(I'm on spyce 2.0.2 still, if that may be the reason.) My spyce.py only
has a method spyceProcess of class spyceWrapper. It does not use
self._parent:
def spyceProcess(self, *args, **kwargs):
"Process the current Spyce request."
path = sys.path
try:
# munge path so .spy can import from .py in current directory
if self._spycecode.getFilename():
path = copy.copy(sys.path)
sys.path.append(os.path.dirname(self._spycecode.getFilename()))
dict = { '_spyce_process': self.process,
'_spyce_args': args, '_spyce_kwargs': kwargs, }
exec '_spyce_result = apply(_spyce_process, _spyce_args,
_spyce_kwargs)' in dict
return dict['_spyce_result']
finally:
sys.path = path
Tx
-i
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642