[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [49354] trunk/blender/release/scripts: style cleanup

Campbell Barton ideasman42 at gmail.com
Sun Jul 29 14:07:07 CEST 2012


Revision: 49354
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49354
Author:   campbellbarton
Date:     2012-07-29 12:07:06 +0000 (Sun, 29 Jul 2012)
Log Message:
-----------
style cleanup

Modified Paths:
--------------
    trunk/blender/release/scripts/modules/bl_i18n_utils/bl_process_msg.py
    trunk/blender/release/scripts/modules/bl_i18n_utils/check_po.py
    trunk/blender/release/scripts/modules/bl_i18n_utils/clean_po.py
    trunk/blender/release/scripts/modules/bl_i18n_utils/import_po_from_branches.py
    trunk/blender/release/scripts/modules/bl_i18n_utils/merge_po.py
    trunk/blender/release/scripts/modules/bl_i18n_utils/rtl_preprocess.py
    trunk/blender/release/scripts/modules/bl_i18n_utils/settings.py
    trunk/blender/release/scripts/modules/bl_i18n_utils/spell_check_utils.py
    trunk/blender/release/scripts/modules/bl_i18n_utils/update_branches.py
    trunk/blender/release/scripts/modules/bl_i18n_utils/update_mo.py
    trunk/blender/release/scripts/modules/bl_i18n_utils/update_po.py
    trunk/blender/release/scripts/modules/bl_i18n_utils/update_pot.py
    trunk/blender/release/scripts/modules/bl_i18n_utils/update_trunk.py
    trunk/blender/release/scripts/modules/bl_i18n_utils/utils.py
    trunk/blender/release/scripts/modules/console_python.py
    trunk/blender/release/scripts/startup/bl_ui/properties_data_armature.py
    trunk/blender/release/scripts/startup/bl_ui/properties_data_speaker.py
    trunk/blender/release/scripts/startup/bl_ui/properties_game.py
    trunk/blender/release/scripts/startup/bl_ui/properties_mask_common.py
    trunk/blender/release/scripts/startup/bl_ui/properties_scene.py
    trunk/blender/release/scripts/startup/bl_ui/properties_texture.py
    trunk/blender/release/scripts/startup/bl_ui/properties_world.py
    trunk/blender/release/scripts/startup/bl_ui/space_clip.py
    trunk/blender/release/scripts/startup/bl_ui/space_image.py
    trunk/blender/release/scripts/startup/bl_ui/space_node.py
    trunk/blender/release/scripts/startup/bl_ui/space_sequencer.py
    trunk/blender/release/scripts/startup/bl_ui/space_text.py
    trunk/blender/release/scripts/startup/bl_ui/space_userpref.py
    trunk/blender/release/scripts/startup/bl_ui/space_view3d.py
    trunk/blender/release/scripts/startup/bl_ui/space_view3d_toolbar.py

Modified: trunk/blender/release/scripts/modules/bl_i18n_utils/bl_process_msg.py
===================================================================
--- trunk/blender/release/scripts/modules/bl_i18n_utils/bl_process_msg.py	2012-07-29 10:03:46 UTC (rev 49353)
+++ trunk/blender/release/scripts/modules/bl_i18n_utils/bl_process_msg.py	2012-07-29 12:07:06 UTC (rev 49354)
@@ -270,7 +270,6 @@
     walk_keymap_hierarchy(KM_HIERARCHY, "KM_HIERARCHY")
 
 
-
 def dump_messages_pytext(messages, check_ctxt):
     """ dumps text inlined in the python user interface: eg.
 
@@ -291,7 +290,7 @@
 
     # Break recursive nodes look up on some kind of nodes.
     # E.g. we don’t want to get strings inside subscripts (blah["foo"])!
-    stopper_nodes = {ast.Subscript,}
+    stopper_nodes = {ast.Subscript, }
 
     for func_id, func in bpy.types.UILayout.bl_rna.functions.items():
         # check it has a 'text' argument

Modified: trunk/blender/release/scripts/modules/bl_i18n_utils/check_po.py
===================================================================
--- trunk/blender/release/scripts/modules/bl_i18n_utils/check_po.py	2012-07-29 10:03:46 UTC (rev 49353)
+++ trunk/blender/release/scripts/modules/bl_i18n_utils/check_po.py	2012-07-29 12:07:06 UTC (rev 49354)
@@ -94,7 +94,6 @@
                         help="Restrict processed languages to those.")
     args = parser.parse_args()
 
-
     if args.pot:
         global FILE_NAME_POT
         FILE_NAME_POT = args.pot
@@ -145,24 +144,24 @@
                         ret = t
 
     if args.stats and glob_stats["nbr"] != 0.0:
-        nbr_contexts = len(glob_stats["contexts"]-{""})
+        nbr_contexts = len(glob_stats["contexts"] - {""})
         if nbr_contexts != 1:
             if nbr_contexts == 0:
                 nbr_contexts = "No"
             _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" \
-              "".format(glob_stats["nbr"], glob_stats["lvl"]/glob_stats["nbr"],
-                        glob_stats["lvl_ttips"]/glob_stats["nbr"],
+        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"],
                         glob_stats["lvl_ttips_in_trans"]/glob_stats["nbr"],
                         glob_stats["lvl_comm"]/glob_stats["nbr"], glob_stats["nbr_signs"],

Modified: trunk/blender/release/scripts/modules/bl_i18n_utils/clean_po.py
===================================================================
--- trunk/blender/release/scripts/modules/bl_i18n_utils/clean_po.py	2012-07-29 10:03:46 UTC (rev 49353)
+++ trunk/blender/release/scripts/modules/bl_i18n_utils/clean_po.py	2012-07-29 12:07:06 UTC (rev 49354)
@@ -65,7 +65,6 @@
                         help="Restrict processed languages to those.")
     args = parser.parse_args()
 
-
     ret = 0
 
     if args.langs:

Modified: trunk/blender/release/scripts/modules/bl_i18n_utils/import_po_from_branches.py
===================================================================
--- trunk/blender/release/scripts/modules/bl_i18n_utils/import_po_from_branches.py	2012-07-29 10:03:46 UTC (rev 49353)
+++ trunk/blender/release/scripts/modules/bl_i18n_utils/import_po_from_branches.py	2012-07-29 12:07:06 UTC (rev 49354)
@@ -56,12 +56,11 @@
                         help="Restrict processed languages to those.")
     args = parser.parse_args()
 
-
     ret = 0
 
-    threshold = float(settings.IMPORT_MIN_LEVEL)/100.0
+    threshold = float(settings.IMPORT_MIN_LEVEL) / 100.0
     if args.threshold is not None:
-        threshold = float(args.threshold)/100.0
+        threshold = float(args.threshold) / 100.0
 
     for lang in os.listdir(BRANCHES_DIR):
         if args.langs and lang not in args.langs:
@@ -74,7 +73,7 @@
             trans_msgs = stats["trans_msg"]
             lvl = 0.0
             if tot_msgs:
-                lvl = float(trans_msgs)/float(tot_msgs)
+                lvl = float(trans_msgs) / float(tot_msgs)
             if lvl > threshold:
                 if state["is_broken"] and args.strict:
                     print("{:<10}: {:>6.1%} done, but BROKEN, skipped." \

Modified: trunk/blender/release/scripts/modules/bl_i18n_utils/merge_po.py
===================================================================
--- trunk/blender/release/scripts/modules/bl_i18n_utils/merge_po.py	2012-07-29 10:03:46 UTC (rev 49353)
+++ trunk/blender/release/scripts/modules/bl_i18n_utils/merge_po.py	2012-07-29 12:07:06 UTC (rev 49354)
@@ -21,7 +21,7 @@
 # <pep8 compliant>
 
 # Merge one or more .po files into the first dest one.
-# If a msgkey is present in more than one merged po, the one in the first file wins, unless 
+# If a msgkey is present in more than one merged po, the one in the first file wins, unless
 # it’s marked as fuzzy and one later is not.
 # The fuzzy flag is removed if necessary.
 # All other comments are never modified.
@@ -59,7 +59,6 @@
                         help="The po's to merge into the dst.po one.")
     args = parser.parse_args()
 
-
     ret = 0
     done_msgkeys = set()
     done_fuzzy_msgkeys = set()
@@ -78,7 +77,7 @@
     # If we don’t want to replace existing valid translations, pre-populate
     # done_msgkeys and done_fuzzy_msgkeys.
     if not args.replace:
-        done_msgkeys =  dst_states["trans_msg"].copy()
+        done_msgkeys = dst_states["trans_msg"].copy()
         done_fuzzy_msgkeys = dst_states["fuzzy_msg"].copy()
     for po in args.src:
         messages, states, stats = utils.parse_messages(po)

Modified: trunk/blender/release/scripts/modules/bl_i18n_utils/rtl_preprocess.py
===================================================================
--- trunk/blender/release/scripts/modules/bl_i18n_utils/rtl_preprocess.py	2012-07-29 10:03:46 UTC (rev 49353)
+++ trunk/blender/release/scripts/modules/bl_i18n_utils/rtl_preprocess.py	2012-07-29 12:07:06 UTC (rev 49354)
@@ -86,6 +86,7 @@
 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 @@
 
         yield fbc_str.value
 
+
 ##### Command line stuff. #####
 def main():
     import argparse
@@ -208,7 +210,6 @@
                         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.")

Modified: trunk/blender/release/scripts/modules/bl_i18n_utils/settings.py
===================================================================
--- trunk/blender/release/scripts/modules/bl_i18n_utils/settings.py	2012-07-29 10:03:46 UTC (rev 49353)
+++ trunk/blender/release/scripts/modules/bl_i18n_utils/settings.py	2012-07-29 12:07:06 UTC (rev 49354)
@@ -55,7 +55,7 @@
 
 # Our own "gettext" stuff.
 # File type (ext) to parse.
-PYGETTEXT_ALLOWED_EXTS =  {".c", ".cpp", ".cxx", ".hpp", ".hxx", ".h"}
+PYGETTEXT_ALLOWED_EXTS = {".c", ".cpp", ".cxx", ".hpp", ".hxx", ".h"}
 
 # Where to search contexts definitions, relative to SOURCE_DIR (defined below).
 PYGETTEXT_CONTEXTS_DEFSRC = os.path.join("source", "blender", "blenfont",
@@ -97,7 +97,7 @@
 PYGETTEXT_KEYWORDS = (() +
     tuple((r"{}\(\s*" + _msg_re + r"\s*\)").format(it)
           for it in ("IFACE_", "TIP_", "N_")) +
-    tuple((r"{}\(\s*" + _ctxt_re + r"\s*,\s*"+ _msg_re + r"\s*\)").format(it)
+    tuple((r"{}\(\s*" + _ctxt_re + r"\s*,\s*" + _msg_re + r"\s*\)").format(it)
           for it in ("CTX_IFACE_", "CTX_TIP_", "CTX_N_"))
 )
 

Modified: trunk/blender/release/scripts/modules/bl_i18n_utils/spell_check_utils.py
===================================================================
--- trunk/blender/release/scripts/modules/bl_i18n_utils/spell_check_utils.py	2012-07-29 10:03:46 UTC (rev 49353)
+++ trunk/blender/release/scripts/modules/bl_i18n_utils/spell_check_utils.py	2012-07-29 12:07:06 UTC (rev 49354)
@@ -414,7 +414,7 @@
     "gpu", "gpus",
     "hc",
     "hdr",
-    "hh", "mm", "ss", "ff", # hh:mm:ss:ff timecode
+    "hh", "mm", "ss", "ff",  # hh:mm:ss:ff timecode
     "hsv", "hsva",
     "id",
     "itu",

Modified: trunk/blender/release/scripts/modules/bl_i18n_utils/update_branches.py
===================================================================
--- trunk/blender/release/scripts/modules/bl_i18n_utils/update_branches.py	2012-07-29 10:03:46 UTC (rev 49353)
+++ trunk/blender/release/scripts/modules/bl_i18n_utils/update_branches.py	2012-07-29 12:07:06 UTC (rev 49354)
@@ -38,6 +38,7 @@
 
 PY3 = settings.PYTHON3_EXEC
 
+
 def main():
     import argparse
     parser = argparse.ArgumentParser(description="" \
@@ -59,7 +60,6 @@
                         help="Restrict processed languages to those.")
     args = parser.parse_args()
 
-
     ret = 0
 
     # Generate a temp messages file.

Modified: trunk/blender/release/scripts/modules/bl_i18n_utils/update_mo.py
===================================================================
--- trunk/blender/release/scripts/modules/bl_i18n_utils/update_mo.py	2012-07-29 10:03:46 UTC (rev 49353)
+++ trunk/blender/release/scripts/modules/bl_i18n_utils/update_mo.py	2012-07-29 12:07:06 UTC (rev 49354)
@@ -47,7 +47,7 @@

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list