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:
authorCampbell Barton <ideasman42@gmail.com>2019-03-29 22:12:48 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-03-29 23:14:28 +0300
commit25ec4b437fe927205a810470cdc23efd7282c85b (patch)
tree6d7ba2fe73703915b4b94d3f2dab03fb731e9544 /source/blender/python/intern/bpy_app_translations.c
parent18d06e8d21ed8c9a19df4205abcd7ed17eb9af00 (diff)
Cleanup: style, use braces for the Python API
Diffstat (limited to 'source/blender/python/intern/bpy_app_translations.c')
-rw-r--r--source/blender/python/intern/bpy_app_translations.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/source/blender/python/intern/bpy_app_translations.c b/source/blender/python/intern/bpy_app_translations.c
index 1ed68201a2e..f571caee8ec 100644
--- a/source/blender/python/intern/bpy_app_translations.c
+++ b/source/blender/python/intern/bpy_app_translations.c
@@ -89,8 +89,9 @@ static bool _ghashutil_keycmp(const void *a, const void *b)
const GHashKey *B = b;
/* Note: comparing msgid first, most of the time it will be enough! */
- if (BLI_ghashutil_strcmp(A->msgid, B->msgid) == false)
+ if (BLI_ghashutil_strcmp(A->msgid, B->msgid) == false) {
return BLI_ghashutil_strcmp(A->msgctxt, B->msgctxt);
+ }
return true; /* true means they are not equal! */
}
@@ -249,8 +250,9 @@ const char *BPY_app_translations_py_pgettext(const char *msgctxt, const char *ms
const char *tmp;
/* Just in case, should never happen! */
- if (!_translations)
+ if (!_translations) {
return msgid;
+ }
tmp = BLT_lang_get();
if (!STREQ(tmp, locale) || !_translations_cache) {
@@ -458,8 +460,9 @@ static PyObject *app_translations_locales_get(PyObject *UNUSED(self), void *UNUS
if (items) {
/* This is not elegant, but simple! */
for (it = items; it->identifier; it++) {
- if (it->value)
+ if (it->value) {
num_locales++;
+ }
}
}
@@ -467,8 +470,9 @@ static PyObject *app_translations_locales_get(PyObject *UNUSED(self), void *UNUS
if (items) {
for (it = items; it->identifier; it++) {
- if (it->value)
+ if (it->value) {
PyTuple_SET_ITEM(ret, pos++, PyUnicode_FromString(it->description));
+ }
}
}
@@ -801,8 +805,9 @@ PyObject *BPY_app_translations_struct(void)
PyStructSequence_InitType(&BlenderAppTranslationsContextsType, &app_translations_contexts_desc);
}
- if (PyType_Ready(&BlenderAppTranslationsType) < 0)
+ if (PyType_Ready(&BlenderAppTranslationsType) < 0) {
return NULL;
+ }
ret = PyObject_CallObject((PyObject *)&BlenderAppTranslationsType, NULL);