Re: Why isn't $target available from python?

Bram Moolenaar <[email protected]>
Newsgroups gmane.comp.tools.aap.user
Message-ID <[email protected]>
Adriaan de Groot wrote:

> Every recipe I see uses lots of `sufreplace("","bla",source)` stuff, but you 
> can't substitute target in there for source. Target isn't available in that 
> python context. Why is that? 

$target should be available, but when using it from Python you may have
to add a scope, because it may have been defined in another scope.
Using "_no.target" should work.

I don't like the difference between using $target in an Aap expression
and _no.target in an Python expression, but I have not found a method to
avoid the scope name in Python and always using $_no.target in Aap code
is not nice either.

-- 
In many of the more relaxed civilizations on the Outer Eastern Rim of the
Galaxy, "The Hitchhiker's Guide to the Galaxy" has already supplanted the
great "Encyclopedia Galactica" as the standard repository of all knowledge
and wisdom, for though it has many omissions and contains much that is
apocryphal, or at least wildly inaccurate, it scores over the older, more
pedestrian work in two important respects.
First, it is slightly cheaper; and second, it has the words "DON'T PANIC"
inscribed in large friendly letters on its cover.
		-- Douglas Adams, "The Hitchhiker's Guide to the Galaxy"

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///          Creator of Vim - Vi IMproved -- http://www.Vim.org          \\\
\\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
 \\\  Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html  ///


-------------------------------------------------------
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.