[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[www_shared] 19/19: add mybabel wrapper
From: |
gnunet |
Subject: |
[www_shared] 19/19: add mybabel wrapper |
Date: |
Sat, 25 Jan 2020 11:29:34 +0100 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository www_shared.
commit 6a51c97bddcffef78e0c3b39a0eddd69876b6907
Author: Christian Grothoff <address@hidden>
AuthorDate: Mon Dec 23 01:56:08 2019 +0100
add mybabel wrapper
---
mybabel.py | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/mybabel.py b/mybabel.py
new file mode 100644
index 0000000..50fa0c4
--- /dev/null
+++ b/mybabel.py
@@ -0,0 +1,25 @@
+#! /usr/bin/python3
+#
+# This code is in the public domain.
+#
+# This is a wrapper around 'pybabel' that sets our include path
+# to find the 'i18nfix' module. It takes the name of the
+# pybabel program as the first argument (must be a Python script!)
+# and passes the other arguments to pybabel after setting our
+# sys.path.
+#
+import shutil
+import sys
+
+# First, extend the search path as needed (without setting PYTHONPATH!)
+sys.path.insert(0, ".")
+
+# Now, find the actual pybabel program in the $PATH
+pb=shutil.which(sys.argv[1])
+
+# Remove 'pybabel' from argv[] so that pybabel doesn't confuse
+# itself for the first command-line argument ;-)
+sys.argv.remove(sys.argv[1])
+
+# Now we can run pybabel. Yeah!
+exec(compile(source=open(pb).read(), filename=pb, mode='exec'))
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [www_shared] 05/19: add sitemap generator script in python., (continued)
- [www_shared] 05/19: add sitemap generator script in python., gnunet, 2020/01/25
- [www_shared] 07/19: debug print statements., gnunet, 2020/01/25
- [www_shared] 11/19: Merge branch 'default' of gnunet.org:www_shared into default, gnunet, 2020/01/25
- [www_shared] 17/19: news.macro.j2: use date: title for shortnews, gnunet, 2020/01/25
- [www_shared] 12/19: merge README.text and README, gnunet, 2020/01/25
- [www_shared] 18/19: avoid need to have Makefile set PYTHONPATH (breaks then other things), gnunet, 2020/01/25
- [www_shared] 16/19: remove forgotten todo file, gnunet, 2020/01/25
- [www_shared] 13/19: Add copyright header, fix copyright headers., gnunet, 2020/01/25
- [www_shared] 10/19: licensing, notes, todo, readme, gnunet, 2020/01/25
- [www_shared] 15/19: site.py: expose conf directly to jinja2., gnunet, 2020/01/25
- [www_shared] 19/19: add mybabel wrapper,
gnunet <=