Re: propogating locals in sub-includes

"Jonathan Ellis" <[email protected]> Wed, 12 Dec 2007 16:58:23 -0800
Newsgroups gmane.comp.python.spyce.general
Message-ID <[email protected]>
It might work if you do

A: include.spyce(B, locals())
B: incluce.spyce(C, include.context)
C: include.vars.foo

But I'm not sure the include module is smart enough for that to work.

The "modern" way to reuse code in spyce is custom tags.

On Wed, 12 Dec 2007 13:47:37 -0500, "Jason Persampieri"
<[email protected]> said:
> Next question.
> 
> I have a *spyce.include* inside a file that is itself *spyce-include*'d.
> I've accepted the necessity of using *include.vars* to access data in my
> included file (sadly... I wish they were just added to the included
> file's
> local namespace, but oh well), but it would be nice if *include.context*
> was
> automagically added to the context dict when including another file.
> 
> Basically, if file A includes file B which includes file C, I'd like to
> access A.foo in C via *include.vars.foo*.
> 
> Or am I missing something obvious (for the umpteenth time)?
> 
> Jason Persampieri
> Programmer
> Boston College - Bioinformatics Dept.

-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace