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:
authorSergey Sharybin <sergey@blender.org>2020-11-12 11:26:20 +0300
committerSergey Sharybin <sergey@blender.org>2020-11-12 11:26:20 +0300
commitde6cee4fc1913982b0b2bd786bfd813c935bbe73 (patch)
treea726c0c63bbd1d6c47c90c32119ce14c8048cddc /release/scripts/modules/bl_i18n_utils
parente4d432500a0e2f978fe019da43deb843da405032 (diff)
parent88bb29dea668df8cc46aa7f55895f229748bdbb4 (diff)
Merge branch 'master' into codesign_error_tracker
Diffstat (limited to 'release/scripts/modules/bl_i18n_utils')
-rw-r--r--release/scripts/modules/bl_i18n_utils/bl_extract_messages.py23
-rw-r--r--release/scripts/modules/bl_i18n_utils/settings.py1
-rw-r--r--release/scripts/modules/bl_i18n_utils/utils.py2
-rwxr-xr-xrelease/scripts/modules/bl_i18n_utils/utils_rtl.py22
-rw-r--r--release/scripts/modules/bl_i18n_utils/utils_spell_check.py7
5 files changed, 32 insertions, 23 deletions
diff --git a/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py b/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py
index cee8f89abd3..063e3cafb73 100644
--- a/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py
+++ b/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py
@@ -177,7 +177,7 @@ def print_info(reports, pot):
_print("\t“{}”|“{}”:".format(*key))
# We support multi-lines tooltips now...
# ~ if multi_lines and key in multi_lines:
- # ~ _print("\t\t-> newline in this message!")
+ # ~ _print("\t\t-> newline in this message!")
if not_capitalized and key in not_capitalized:
_print("\t\t-> message not capitalized!")
if end_point and key in end_point:
@@ -456,9 +456,11 @@ def dump_py_messages_from_files(msgs, reports, files, settings):
Recursively get strings, needed in case we have "Blah" + "Blah", passed as an argument in that case it won't
evaluate to a string. However, break on some kind of stopper nodes, like e.g. Subscript.
"""
- if type(node) == ast.Str:
+ # New in py 3.8: all constants are of type 'ast.Constant'.
+ # 'ast.Str' will have to be removed when we officially switch to this version.
+ if type(node) in {ast.Str, getattr(ast, "Constant", None)}:
eval_str = ast.literal_eval(node)
- if eval_str:
+ if eval_str and type(eval_str) == str:
yield (is_split, eval_str, (node,))
else:
is_split = (type(node) in separate_nodes)
@@ -624,6 +626,7 @@ def dump_py_messages_from_files(msgs, reports, files, settings):
}
for fp in files:
+ # ~ print("Checking File ", fp)
with open(fp, 'r', encoding="utf8") as filedata:
root_node = ast.parse(filedata.read(), fp, 'exec')
@@ -631,8 +634,8 @@ def dump_py_messages_from_files(msgs, reports, files, settings):
for node in ast.walk(root_node):
if type(node) == ast.Call:
- # print("found function at")
- # print("%s:%d" % (fp, node.lineno))
+ # ~ print("found function at")
+ # ~ print("%s:%d" % (fp, node.lineno))
# We can't skip such situations! from blah import foo\nfoo("bar") would also be an ast.Name func!
if type(node.func) == ast.Name:
@@ -657,31 +660,31 @@ def dump_py_messages_from_files(msgs, reports, files, settings):
if kw.arg == arg_kw:
context_elements[arg_kw] = kw.value
break
- # print(context_elements)
+ # ~ print(context_elements)
for kws, proc in translate_kw[msgid]:
if set(kws) <= context_elements.keys():
args = tuple(context_elements[k] for k in kws)
- #print("running ", proc, " with ", args)
+ # ~ print("running ", proc, " with ", args)
ctxt = proc(*args)
if ctxt:
msgctxts[msgid] = ctxt
break
- # print(translate_args)
+ # ~ print(func_args)
# do nothing if not found
for arg_kw, (arg_pos, _) in func_args.items():
msgctxt = msgctxts[arg_kw]
estr_lst = [(None, ())]
if arg_pos < len(node.args):
estr_lst = extract_strings_split(node.args[arg_pos])
- #print(estr, nds)
else:
for kw in node.keywords:
if kw.arg == arg_kw:
+ # ~ print(kw.arg, kw.value)
estr_lst = extract_strings_split(kw.value)
break
- #print(estr, nds)
for estr, nds in estr_lst:
+ # ~ print(estr, nds)
if estr:
if nds:
msgsrc = "{}:{}".format(fp_rel, sorted({nd.lineno for nd in nds})[0])
diff --git a/release/scripts/modules/bl_i18n_utils/settings.py b/release/scripts/modules/bl_i18n_utils/settings.py
index a6101474aa9..e304ef5ea17 100644
--- a/release/scripts/modules/bl_i18n_utils/settings.py
+++ b/release/scripts/modules/bl_i18n_utils/settings.py
@@ -376,6 +376,7 @@ WARN_MSGID_NOT_CAPITALIZED_ALLOWED = {
"multi-res modifier",
"non-triangle face",
"normal",
+ "performance impact!",
"right",
"the lazy dog",
"unable to load movie clip",
diff --git a/release/scripts/modules/bl_i18n_utils/utils.py b/release/scripts/modules/bl_i18n_utils/utils.py
index 61837cc0956..4cb25816a34 100644
--- a/release/scripts/modules/bl_i18n_utils/utils.py
+++ b/release/scripts/modules/bl_i18n_utils/utils.py
@@ -185,7 +185,7 @@ def enable_addons(addons=None, support=None, disable=False, check_only=False):
ret = [
mod for mod in addon_utils.modules()
if (((addons and mod.__name__ in addons) or
- (not addons and addon_utils.module_bl_info(mod)["support"] in support)) and
+ (not addons and addon_utils.module_bl_info(mod)["support"] in support)) and
(mod.__name__ not in black_list))
]
diff --git a/release/scripts/modules/bl_i18n_utils/utils_rtl.py b/release/scripts/modules/bl_i18n_utils/utils_rtl.py
index 1a71bb735bc..2b6a56c5deb 100755
--- a/release/scripts/modules/bl_i18n_utils/utils_rtl.py
+++ b/release/scripts/modules/bl_i18n_utils/utils_rtl.py
@@ -37,27 +37,27 @@ import ctypes
import re
-#define FRIBIDI_MASK_NEUTRAL 0x00000040L /* Is neutral */
+# define FRIBIDI_MASK_NEUTRAL 0x00000040L /* Is neutral */
FRIBIDI_PAR_ON = 0x00000040
-#define FRIBIDI_FLAG_SHAPE_MIRRORING 0x00000001
-#define FRIBIDI_FLAG_REORDER_NSM 0x00000002
+# define FRIBIDI_FLAG_SHAPE_MIRRORING 0x00000001
+# define FRIBIDI_FLAG_REORDER_NSM 0x00000002
-#define FRIBIDI_FLAG_SHAPE_ARAB_PRES 0x00000100
-#define FRIBIDI_FLAG_SHAPE_ARAB_LIGA 0x00000200
-#define FRIBIDI_FLAG_SHAPE_ARAB_CONSOLE 0x00000400
+# define FRIBIDI_FLAG_SHAPE_ARAB_PRES 0x00000100
+# define FRIBIDI_FLAG_SHAPE_ARAB_LIGA 0x00000200
+# define FRIBIDI_FLAG_SHAPE_ARAB_CONSOLE 0x00000400
-#define FRIBIDI_FLAG_REMOVE_BIDI 0x00010000
-#define FRIBIDI_FLAG_REMOVE_JOINING 0x00020000
-#define FRIBIDI_FLAG_REMOVE_SPECIALS 0x00040000
+# define FRIBIDI_FLAG_REMOVE_BIDI 0x00010000
+# define FRIBIDI_FLAG_REMOVE_JOINING 0x00020000
+# define FRIBIDI_FLAG_REMOVE_SPECIALS 0x00040000
-#define FRIBIDI_FLAGS_DEFAULT ( \
+# define FRIBIDI_FLAGS_DEFAULT ( \
# FRIBIDI_FLAG_SHAPE_MIRRORING | \
# FRIBIDI_FLAG_REORDER_NSM | \
# FRIBIDI_FLAG_REMOVE_SPECIALS )
-#define FRIBIDI_FLAGS_ARABIC ( \
+# define FRIBIDI_FLAGS_ARABIC ( \
# FRIBIDI_FLAG_SHAPE_ARAB_PRES | \
# FRIBIDI_FLAG_SHAPE_ARAB_LIGA )
diff --git a/release/scripts/modules/bl_i18n_utils/utils_spell_check.py b/release/scripts/modules/bl_i18n_utils/utils_spell_check.py
index 0ec3a322173..05985cac868 100644
--- a/release/scripts/modules/bl_i18n_utils/utils_spell_check.py
+++ b/release/scripts/modules/bl_i18n_utils/utils_spell_check.py
@@ -124,13 +124,14 @@ class SpellChecker:
"forcefield", "forcefields",
"fulldome", "fulldomes",
"fullscreen",
- "gridline",
+ "gridline", "gridlines",
"hardlight",
"hemi",
"hostname",
"inbetween",
"inscatter", "inscattering",
"libdata",
+ "lightcache",
"lightprobe", "lightprobes",
"lightless",
"lineset",
@@ -161,6 +162,7 @@ class SpellChecker:
"online",
"playhead",
"popup", "popups",
+ "pointcloud",
"pre",
"precache", "precaching",
"precalculate",
@@ -182,6 +184,7 @@ class SpellChecker:
"reprojection", "reproject", "reprojecting",
"resize",
"restpose",
+ "resync",
"retarget", "retargets", "retargeting", "retargeted",
"retiming",
"rigidbody",
@@ -605,9 +608,11 @@ class SpellChecker:
"catmull",
"catrom",
"chebychev",
+ "conrady", # Brown-Conrady
"courant",
"cryptomatte", "crypto",
"embree",
+ "gmp",
"hosek",
"kutta",
"lennard",