Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXiao Xiangquan <xiaoxiangquan@gmail.com>2011-06-20 14:07:46 +0400
committerXiao Xiangquan <xiaoxiangquan@gmail.com>2011-06-20 14:07:46 +0400
commit9a2f36b50f818c0c1b659363a1df298f7043e207 (patch)
tree29356fc32cdf7faba05e099e67e3da5adf349c39 /source/blender/python/generic/blf_py_api.c
parent558d549aeb2ec7da41d31986707774eae0821da8 (diff)
handle SpaceType and UserPref popups
Diffstat (limited to 'source/blender/python/generic/blf_py_api.c')
-rw-r--r--source/blender/python/generic/blf_py_api.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/source/blender/python/generic/blf_py_api.c b/source/blender/python/generic/blf_py_api.c
index f7b49ad28dc..a6bbb26be86 100644
--- a/source/blender/python/generic/blf_py_api.c
+++ b/source/blender/python/generic/blf_py_api.c
@@ -391,6 +391,27 @@ static PyObject *py_blf_gettext(PyObject *UNUSED(self), PyObject *args)
return PyUnicode_DecodeUTF8( msgstr, strlen(msgstr), error_handle );
}
+PyDoc_STRVAR(py_blf_fake_gettext_doc,
+".. function:: fake_gettext(msgid)\n"
+"\n"
+" Just tag the msgid.\n"
+"\n"
+" :arg msgid: the source string.\n"
+" :type msgid: string\n"
+" :return: the source string.\n"
+" :rtype: string\n"
+);
+static PyObject *py_blf_fake_gettext(PyObject *UNUSED(self), PyObject *args)
+{
+ char* msgid;
+ char* error_handle;
+
+ if (!PyArg_ParseTuple(args, "s:blf.gettext", &msgid))
+ return NULL;
+
+ return PyUnicode_DecodeUTF8( msgid, strlen(msgid), error_handle );
+}
+
/*----------------------------MODULE INIT-------------------------*/
static PyMethodDef BLF_methods[] = {
{"aspect", (PyCFunction) py_blf_aspect, METH_VARARGS, py_blf_aspect_doc},
@@ -407,6 +428,7 @@ static PyMethodDef BLF_methods[] = {
{"size", (PyCFunction) py_blf_size, METH_VARARGS, py_blf_size_doc},
{"load", (PyCFunction) py_blf_load, METH_VARARGS, py_blf_load_doc},
{"gettext", (PyCFunction) py_blf_gettext, METH_VARARGS, py_blf_gettext_doc},
+ {"fake_gettext", (PyCFunction) py_blf_fake_gettext, METH_VARARGS, py_blf_fake_gettext_doc},
{NULL, NULL, 0, NULL}
};