Using _recipe in python snippts
Adriaan de Groot <adridg-FlD2LfDziEhmR6Xm/[email protected]>
| Newsgroups | gmane.comp.tools.aap.devel |
|---|---|
| Message-ID | <[email protected]> |
In order to test if a variable is set, I've taken to using
_recipe.has_key() - something like this:
:if _recipe.has_key("SUBDIRS"):
:child $SUBDIRS
I couldn't quickly find another way to do this.
Now the problem is that _recipe doesn't always exist. In particular,
suppose I have a main.aap in .,./a,and ./a/a that looks like this:
==main.aap
:child a/main.aap
==
Finally, in ./a/a/a, main.aap looks lile:
==main.aap
:print $TOPDIR
@if _recipe.has_key("SUBDIRS"):
:child $SUBDIRS
==
If I run AAP on this setup, AAP tells me (paraphrased): recipe "a"# does
not exist. I haven't quite figured out how to convice AAP that it _does_
exist - adding :program targets in each recipe doesn't seem to make a
difference.
So how _should_ I be testing for the existence of a variable in a Python
snippet?
--
Adriaan de Groot adridg-FlD2LfDziEhmR6Xm/[email protected] Kamer A6020 024-3652272
GPG Key Fingerprint 934E 31AA 80A7 723F 54F9 50ED 76AC EE01 FEA2 A3FE
http://www.cs.kun.nl/~adridg/research/
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01