----- Original Message -----
From: "Graham Percival" <gra...@percival-music.ca>
To: "Phil Holmes" <em...@philholmes.net>
Cc: <percival.music...@gmail.com>; <lilypond-devel@gnu.org>;
<jan.nieuwenhui...@gmail.com>
Sent: Tuesday, September 13, 2011 7:03 PM
Subject: Re: Uses langdefs.py to create language list
forcreate-weblinks-itexi.py (issue 4951047)
On Tue, Sep 13, 2011 at 04:42:16PM +0100, Phil Holmes wrote:
The problem is - how to return WEB_LANGS for the web-build, but
LANGUAGES for the doc build? My patch does this by using something
like this in website.make:
WEB_LANGS = python langdefs.py web
Um. I was just expecting you to define
WEB_LANGS =
on line 78 of langdefs.py ?
I might have missed something (since nobody actually understands
all parts of the build system), but surely that would be
sufficient? I must admit that I'm really confused about what
we're trying to do here, or how far along that path we've gotten
(if at all!).
That won't work, AFAICS. Langdefs.py is used in /Documentation/GNUmakefile
like this:
LANGS = $(shell $(PYTHON) $(top-src-dir)/python/langdefs.py)
In other words, LANGS (i.e. documentation languages) is set to equal
whatever langdefs.py returns when it's called from the command line. In
python, a command-line invocation is tested for with:
if __name__ == '__main__':
In langdefs.py, we have that line followed by:
print ' '.join ([l.code for l in LANGUAGES if l.enabled and l.code !=
'en'])
In other words, any command-line invocation of langdefs.py will always get
every value of LANGUAGES.code except en. Changing WEB_LANGS will have no
effect on this.
Note that this does not apply to python code that includes langdefs.py,
since in this case we can simply use:
langdef.WEB_LANGS
In website.make we currently have:
WEB_LANGS = cs de es fr hu it ja nl zh
which we want to change to something like
WEB_LANGS = $(shell $(PYTHON) $(top-src-dir)/python/langdefs.py)
The problem is "telling" langdefs that we want it to return to the command
line the value of WEB_LANGS, not LANGUAGES. I suggested doing this by
appending an argument to the command line invocation, so if we were to do
this, typing:
python langdefs.py
would give all the doc languages, but typing:
python langdefc.py web
would only return the web languages. As I said, I wasn't happy with this
approach, but it does work. My alternative I've now experimented with is to
set an environment variable in website.make: something like:
export MAKEWEB=1
and then pick this up in langdefs. My plan is to put a further patch on
Rietveld with this implementation. I'm just explaining it here 'cos it's
not 100% obvious why I'm doing it this way.
--
Phil Holmes
_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel