lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Uses langdefs.py to create language list for create-weblinks-itexi.p


From: Phil Holmes
Subject: Re: Uses langdefs.py to create language list for create-weblinks-itexi.py (issue 4951047)
Date: Tue, 13 Sep 2011 16:42:16 +0100

----- Original Message ----- From: <address@hidden>
To: <address@hidden>; <address@hidden>
Cc: <address@hidden>; <address@hidden>
Sent: Monday, September 05, 2011 7:10 PM
Subject: Re: Uses langdefs.py to create language list for create-weblinks-itexi.py (issue 4951047)


LTGM, not tested, but I'm willing to put it up and just see if anything
breaks.

My only qualm is that this takes lang.LANGAUGES, instead of defining a
WEB_LANGUAGES.  At the moment they're the same, but somebody might come
in to do a new translation, and we don't want to enable that on the
website until it's complete.
But I'm content to cross that bridge when we come to it.

http://codereview.appspot.com/4951047/

I've reduced the reply-to list, because this is not really a review comment but a request for suggestions.

I've got a patch that does this. However, there is an issue I want to check about how it can be done. At present, langdefs is called in 2 ways: from python, by including langdefs.py, and then by using the objects created in the module; and from make, simply by saying something like LANGS = python langdefs.py. The latter syntax is provided for in langdefs because of these lines:

if __name__ == '__main__':
print ' '.join ([l.code for l in LANGUAGES if l.enabled and l.code != 'en'])

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

In other words, using an argument to langdefs. langdefs is modified to check whether it has an argument, and that argument is "web" and if so it returns WEB_LANGS. I can't think of a better way of doing this, but it seems a bit hacky. Can anyone else propose a better way?

Thanks.

--
Phil Holmes




reply via email to

[Prev in Thread] Current Thread [Next in Thread]