style cleanup
This commit is contained in:
@@ -270,7 +270,6 @@ def dump_messages_rna(messages, check_ctxt):
|
||||
walk_keymap_hierarchy(KM_HIERARCHY, "KM_HIERARCHY")
|
||||
|
||||
|
||||
|
||||
def dump_messages_pytext(messages, check_ctxt):
|
||||
""" dumps text inlined in the python user interface: eg.
|
||||
|
||||
|
||||
@@ -94,7 +94,6 @@ def main():
|
||||
help="Restrict processed languages to those.")
|
||||
args = parser.parse_args()
|
||||
|
||||
|
||||
if args.pot:
|
||||
global FILE_NAME_POT
|
||||
FILE_NAME_POT = args.pot
|
||||
@@ -152,15 +151,15 @@ def main():
|
||||
_ctx_txt = "s are"
|
||||
else:
|
||||
_ctx_txt = " is"
|
||||
print("\nAverage stats for all {:.0f} processed files:\n" \
|
||||
" {:>6.1%} done!\n" \
|
||||
" {:>6.1%} of messages are tooltips.\n" \
|
||||
" {:>6.1%} of tooltips are translated.\n" \
|
||||
" {:>6.1%} of translated messages are tooltips.\n" \
|
||||
" {:>6.1%} of messages are commented.\n" \
|
||||
" The org msgids are currently made of {} signs.\n" \
|
||||
" All processed translations are currently made of {} signs.\n" \
|
||||
" {} specific context{} present:\n {}\n" \
|
||||
print("\nAverage stats for all {:.0f} processed files:\n"
|
||||
" {:>6.1%} done!\n"
|
||||
" {:>6.1%} of messages are tooltips.\n"
|
||||
" {:>6.1%} of tooltips are translated.\n"
|
||||
" {:>6.1%} of translated messages are tooltips.\n"
|
||||
" {:>6.1%} of messages are commented.\n"
|
||||
" The org msgids are currently made of {} signs.\n"
|
||||
" All processed translations are currently made of {} signs.\n"
|
||||
" {} specific context{} present:\n {}\n"
|
||||
"".format(glob_stats["nbr"], glob_stats["lvl"] / glob_stats["nbr"],
|
||||
glob_stats["lvl_ttips"] / glob_stats["nbr"],
|
||||
glob_stats["lvl_trans_ttips"]/glob_stats["nbr"],
|
||||
|
||||
@@ -65,7 +65,6 @@ def main():
|
||||
help="Restrict processed languages to those.")
|
||||
args = parser.parse_args()
|
||||
|
||||
|
||||
ret = 0
|
||||
|
||||
if args.langs:
|
||||
|
||||
@@ -56,7 +56,6 @@ def main():
|
||||
help="Restrict processed languages to those.")
|
||||
args = parser.parse_args()
|
||||
|
||||
|
||||
ret = 0
|
||||
|
||||
threshold = float(settings.IMPORT_MIN_LEVEL) / 100.0
|
||||
|
||||
@@ -59,7 +59,6 @@ def main():
|
||||
help="The po's to merge into the dst.po one.")
|
||||
args = parser.parse_args()
|
||||
|
||||
|
||||
ret = 0
|
||||
done_msgkeys = set()
|
||||
done_fuzzy_msgkeys = set()
|
||||
|
||||
@@ -86,6 +86,7 @@ FRIBIDI_FLAGS_DEFAULT = FRIBIDI_FLAG_SHAPE_MIRRORING | \
|
||||
FRIBIDI_FLAGS_ARABIC = FRIBIDI_FLAG_SHAPE_ARAB_PRES | \
|
||||
FRIBIDI_FLAG_SHAPE_ARAB_LIGA
|
||||
|
||||
|
||||
##### Kernel processing funcs. #####
|
||||
def protect_format_seq(msg):
|
||||
"""
|
||||
@@ -185,6 +186,7 @@ def log2vis(msgs):
|
||||
|
||||
yield fbc_str.value
|
||||
|
||||
|
||||
##### Command line stuff. #####
|
||||
def main():
|
||||
import argparse
|
||||
@@ -208,7 +210,6 @@ def main():
|
||||
help="The po's to pre-process messages.")
|
||||
args = parser.parse_args()
|
||||
|
||||
|
||||
msgs, state, u1 = utils.parse_messages(args.src)
|
||||
if state["is_broken"]:
|
||||
print("Source po is BROKEN, aborting.")
|
||||
|
||||
@@ -38,6 +38,7 @@ except:
|
||||
|
||||
PY3 = settings.PYTHON3_EXEC
|
||||
|
||||
|
||||
def main():
|
||||
import argparse
|
||||
parser = argparse.ArgumentParser(description="" \
|
||||
@@ -59,7 +60,6 @@ def main():
|
||||
help="Restrict processed languages to those.")
|
||||
args = parser.parse_args()
|
||||
|
||||
|
||||
ret = 0
|
||||
|
||||
# Generate a temp messages file.
|
||||
|
||||
@@ -74,6 +74,7 @@ pygettexts = tuple(re.compile(r).search
|
||||
_clean_str = re.compile(settings.str_clean_re).finditer
|
||||
clean_str = lambda s: "".join(m.group("clean") for m in _clean_str(s))
|
||||
|
||||
|
||||
def check_file(path, rel_path, messages):
|
||||
with open(path, encoding="utf-8") as f:
|
||||
f = f.read()
|
||||
@@ -149,6 +150,8 @@ from spell_check_utils import (dict_uimsgs,
|
||||
)
|
||||
|
||||
_spell_checked = set()
|
||||
|
||||
|
||||
def spell_check(txt, cache):
|
||||
ret = []
|
||||
|
||||
@@ -194,6 +197,8 @@ def gen_empty_pot():
|
||||
|
||||
escape_re = tuple(re.compile(r[0]) for r in settings.ESCAPE_RE)
|
||||
escape = lambda s, n: escape_re[n].sub(settings.ESCAPE_RE[n][1], s)
|
||||
|
||||
|
||||
def merge_messages(msgs, states, messages, do_checks, spell_cache):
|
||||
num_added = num_present = 0
|
||||
for (context, msgid), srcs in messages.items():
|
||||
|
||||
@@ -65,7 +65,6 @@ def main():
|
||||
help="Restrict processed languages to those.")
|
||||
args = parser.parse_args()
|
||||
|
||||
|
||||
ret = 0
|
||||
failed = set()
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@ def stripeol(s):
|
||||
def is_tooltip(msgid):
|
||||
return len(msgid) > 30
|
||||
|
||||
|
||||
def parse_messages(fname):
|
||||
"""
|
||||
Returns a tupple (messages, states, stats).
|
||||
@@ -82,7 +83,6 @@ def parse_messages(fname):
|
||||
fuzzy_messages = set()
|
||||
commented_messages = set()
|
||||
|
||||
|
||||
def clean_vars():
|
||||
nonlocal reading_msgid, reading_msgstr, reading_msgctxt, \
|
||||
reading_comment, is_fuzzy, is_translated, is_commented, \
|
||||
@@ -143,7 +143,6 @@ def parse_messages(fname):
|
||||
|
||||
clean_vars()
|
||||
|
||||
|
||||
with open(fname, 'r', encoding="utf-8") as f:
|
||||
for line_nr, line in enumerate(f):
|
||||
line = stripeol(line)
|
||||
@@ -373,4 +372,3 @@ def print_stats(stats, glob_stats=None, prefix=""):
|
||||
"".format(nbr_trans_signs))
|
||||
print(prefix.join(lines))
|
||||
return 0
|
||||
|
||||
|
||||
@@ -308,7 +308,8 @@ def banner(context):
|
||||
'OUTPUT')
|
||||
add_scrollback("Convenience Imports: from mathutils import *; "
|
||||
"from math import *", 'OUTPUT')
|
||||
add_scrollback("Convenience Variables: C = bpy.context, D = bpy.data", 'OUTPUT')
|
||||
add_scrollback("Convenience Variables: C = bpy.context, D = bpy.data",
|
||||
'OUTPUT')
|
||||
add_scrollback("", 'OUTPUT')
|
||||
sc.prompt = PROMPT
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#
|
||||
# ##### END GPL LICENSE BLOCK #####
|
||||
|
||||
# <pep8 compliant>
|
||||
# <pep8-80 compliant>
|
||||
|
||||
# panels get subclassed (not registered directly)
|
||||
# menus are referenced `as is`
|
||||
|
||||
@@ -1172,6 +1172,7 @@ class CLIP_PT_active_mask_point(MASK_PT_point, Panel):
|
||||
bl_space_type = 'CLIP_EDITOR'
|
||||
bl_region_type = 'UI'
|
||||
|
||||
|
||||
class CLIP_PT_tools_mask(MASK_PT_tools, Panel):
|
||||
bl_space_type = 'CLIP_EDITOR'
|
||||
bl_region_type = 'TOOLS'
|
||||
|
||||
@@ -849,7 +849,6 @@ class IMAGE_UV_sculpt(Panel, ImagePaintPanel):
|
||||
col.prop(toolsettings, "uv_relax_method")
|
||||
|
||||
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Mask (similar code in space_clip.py, keep in sync)
|
||||
# note! - panel placement does _not_ fit well with image panels... need to fix
|
||||
@@ -886,6 +885,7 @@ class IMAGE_PT_active_mask_point(MASK_PT_point, Panel):
|
||||
bl_space_type = 'IMAGE_EDITOR'
|
||||
bl_region_type = 'PREVIEW'
|
||||
|
||||
|
||||
class IMAGE_PT_tools_mask(MASK_PT_tools, Panel):
|
||||
bl_space_type = 'IMAGE_EDITOR'
|
||||
bl_region_type = 'UI' # is 'TOOLS' in the clip editor
|
||||
|
||||
Reference in New Issue
Block a user