From f42c071d0d8231d971d13327ccd6a7a59e64f124 Mon Sep 17 00:00:00 2001 From: str4d <str4d@mail.i2p> Date: Thu, 6 Jun 2013 01:26:25 +0000 Subject: [PATCH] Copy env's pybabel into base dir to fix string extraction The jinja2 extracter needs to know about our custom HighlightExtension (used on pages such as get-involved/develop/applications), which is not in the env's python path. Copying pybabel into the base dir gives it access to our modules. This is only required for string extraction; other scripts use pybabel from the env directly. If the env's pybabel version is updated, this copy must also be updated. --- extract-messages.sh | 2 +- i2p2www/babel.cfg | 1 + pybabel | 10 ++++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100755 pybabel diff --git a/extract-messages.sh b/extract-messages.sh index 1593068d3..3c98a2a3e 100755 --- a/extract-messages.sh +++ b/extract-messages.sh @@ -1,7 +1,7 @@ #!/bin/sh . ./translation.vars -TZ=UTC env/bin/pybabel extract --msgid-bugs-address="http://trac.i2p2.de" \ +TZ=UTC ./pybabel extract --msgid-bugs-address="http://trac.i2p2.de" \ --project=$PROJECT \ --version=$VERSION \ -F $BABELCFG \ diff --git a/i2p2www/babel.cfg b/i2p2www/babel.cfg index 729a93120..2ed8881a7 100644 --- a/i2p2www/babel.cfg +++ b/i2p2www/babel.cfg @@ -1,4 +1,5 @@ [python: **.py] [jinja2: **/pages/**.html] +extensions=jinja2.ext.autoescape,jinja2.ext.with_,i2p2www.extensions.HighlightExtension [jinja2: **/blog/**.rst] extensions=jinja2.ext.autoescape,jinja2.ext.with_ diff --git a/pybabel b/pybabel new file mode 100755 index 000000000..0c119a664 --- /dev/null +++ b/pybabel @@ -0,0 +1,10 @@ +#!env/bin/python +# EASY-INSTALL-ENTRY-SCRIPT: 'Babel==0.9.6','console_scripts','pybabel' +__requires__ = 'Babel==0.9.6' +import sys +from pkg_resources import load_entry_point + +if __name__ == '__main__': + sys.exit( + load_entry_point('Babel==0.9.6', 'console_scripts', 'pybabel')() + ) -- GitLab