gnunet-svn
[Top][All Lists]
Advanced

[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.



reply via email to

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