Aschwin Marsman wrote:
> > It looks like os.spawn*() only executes one command, not a shell command
> > or pipeline like "cat file | sed expr > tt".
>
> A shell command or pipeline is operating system specific also, if it can't
> be done with Python alone, you always have multi platform support problems.
Yep. Since A-A-P needs to execute compilers, linkers and other
programs, this is unavoidable. Python doesn't offer
platform-independent functions for everything either, quite a few things
are "Unix only" or "Windows only". I'm adding functions for this now
and then. I might even consider contributing some code to the Python
libraries.
To make it easy for the user to write a portable recipe, the plan is to
detect what tools are present on the system and provide a uniform
interface to it. The actions are used for this. For example, to
compile a C file into an object:
:do compile foo.c
The compile action can be defined explicitly:
:action compile object c
:sys $CC $CPPFLAGS $CFLAGS -c $source
But most of the actions will defined by default. See the "default.aap"
recipe in the distribution. The current list is only to try out the
mechanism, it has to be expanded considerably later. One item that
should be complete now is viewing a html page:
# Use the $BROWSER environment variable, a proposed standard; colon separated
# alternatives. If not set, search for one of the known browsers.
BROWSER = `os.environ.get('BROWSER')`
:action view html,xml,php
@if not BROWSER:
:progsearch BROWSER netscape mozilla konquerer grail iexplore mosaic
lynx w3m
:export BROWSER
:syspath '$BROWSER' $source
> What are the OS-es that need to be supported?
Unix (all kinds), MS-Windows (95 and later) and MacOS.
Unix is what I'm working on now. MS-Windows won't be too difficult to
add later. MacOS is going to be a challenge!
--
hundred-and-one symptoms of being an internet addict:
250. You've given up the search for the "perfect woman" and instead,
sit in front of the PC until you're just too tired to care.
/// Bram Moolenaar --
Bram@... --
http://www.moolenaar.net \\\
/// Creator of Vim --
http://vim.sf.net --
ftp://ftp.vim.org/pub/vim \\\
\\\ Project leader for A-A-P --
http://www.a-a-p.org ///
\\\ Lord Of The Rings helps Uganda -
http://iccf-holland.org/lotr.html ///