diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-07-29 16:07:06 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-07-29 16:07:06 +0400 |
commit | 2553cdf195a1d1bbf19bde23b8bbe58de802d1f3 (patch) | |
tree | f5f7e25465de4f99c406dbba25864b150c84b67d /release | |
parent | ab38e1d3795f58b5b3e9ca0377c9348ed710471a (diff) |
style cleanup
Diffstat (limited to 'release')
30 files changed, 102 insertions, 102 deletions
diff --git a/release/scripts/modules/bl_i18n_utils/bl_process_msg.py b/release/scripts/modules/bl_i18n_utils/bl_process_msg.py index f189e3a0d80..b884423606d 100644 --- a/release/scripts/modules/bl_i18n_utils/bl_process_msg.py +++ b/release/scripts/modules/bl_i18n_utils/bl_process_msg.py @@ -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. @@ -291,7 +290,7 @@ def dump_messages_pytext(messages, check_ctxt): # 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 diff --git a/release/scripts/modules/bl_i18n_utils/check_po.py b/release/scripts/modules/bl_i18n_utils/check_po.py index b669a9ddff2..03a933887c6 100755 --- a/release/scripts/modules/bl_i18n_utils/check_po.py +++ b/release/scripts/modules/bl_i18n_utils/check_po.py @@ -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 @@ -145,24 +144,24 @@ def main(): 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"], diff --git a/release/scripts/modules/bl_i18n_utils/clean_po.py b/release/scripts/modules/bl_i18n_utils/clean_po.py index f0b8dd6b1d2..2924ad9fb74 100755 --- a/release/scripts/modules/bl_i18n_utils/clean_po.py +++ b/release/scripts/modules/bl_i18n_utils/clean_po.py @@ -65,7 +65,6 @@ def main(): help="Restrict processed languages to those.") args = parser.parse_args() - ret = 0 if args.langs: diff --git a/release/scripts/modules/bl_i18n_utils/import_po_from_branches.py b/release/scripts/modules/bl_i18n_utils/import_po_from_branches.py index cbbef17b37d..a15bea9ef0d 100755 --- a/release/scripts/modules/bl_i18n_utils/import_po_from_branches.py +++ b/release/scripts/modules/bl_i18n_utils/import_po_from_branches.py @@ -56,12 +56,11 @@ def main(): 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 @@ def main(): 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." \ diff --git a/release/scripts/modules/bl_i18n_utils/merge_po.py b/release/scripts/modules/bl_i18n_utils/merge_po.py index 51e587ca4c8..baf67de2e81 100755 --- a/release/scripts/modules/bl_i18n_utils/merge_po.py +++ b/release/scripts/modules/bl_i18n_utils/merge_po.py @@ -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 @@ 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() @@ -78,7 +77,7 @@ def main(): # 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) diff --git a/release/scripts/modules/bl_i18n_utils/rtl_preprocess.py b/release/scripts/modules/bl_i18n_utils/rtl_preprocess.py index 9b2ee983952..5ee5c71be8b 100755 --- a/release/scripts/modules/bl_i18n_utils/rtl_preprocess.py +++ b/release/scripts/modules/bl_i18n_utils/rtl_preprocess.py @@ -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.") diff --git a/release/scripts/modules/bl_i18n_utils/settings.py b/release/scripts/modules/bl_i18n_utils/settings.py index 094d8e481e9..d323dd37979 100644 --- a/release/scripts/modules/bl_i18n_utils/settings.py +++ b/release/scripts/modules/bl_i18n_utils/settings.py @@ -55,7 +55,7 @@ DOMAIN = "blender" # 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 @@ _msg_re = r"(?P<msg_raw>" + _str_whole_re.format(_="_msg") + r")" 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_")) ) diff --git a/release/scripts/modules/bl_i18n_utils/spell_check_utils.py b/release/scripts/modules/bl_i18n_utils/spell_check_utils.py index 12db7317011..d668f2badfc 100644 --- a/release/scripts/modules/bl_i18n_utils/spell_check_utils.py +++ b/release/scripts/modules/bl_i18n_utils/spell_check_utils.py @@ -414,7 +414,7 @@ dict_uimsgs = { "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", diff --git a/release/scripts/modules/bl_i18n_utils/update_branches.py b/release/scripts/modules/bl_i18n_utils/update_branches.py index 6626fa937a6..199b09aa13a 100755 --- a/release/scripts/modules/bl_i18n_utils/update_branches.py +++ b/release/scripts/modules/bl_i18n_utils/update_branches.py @@ -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. diff --git a/release/scripts/modules/bl_i18n_utils/update_mo.py b/release/scripts/modules/bl_i18n_utils/update_mo.py index 2ca24a76cfe..4a68f19fab0 100755 --- a/release/scripts/modules/bl_i18n_utils/update_mo.py +++ b/release/scripts/modules/bl_i18n_utils/update_mo.py @@ -47,7 +47,7 @@ def process_po(po, lang, mo=None): mo_dir = os.path.join(TRUNK_MO_DIR, lang, "LC_MESSAGES") # Create dirs if not existing! if not os.path.isdir(mo_dir): - os.makedirs(mo_dir, exist_ok = True) + os.makedirs(mo_dir, exist_ok=True) # show stats cmd = (GETTEXT_MSGFMT_EXECUTABLE, diff --git a/release/scripts/modules/bl_i18n_utils/update_po.py b/release/scripts/modules/bl_i18n_utils/update_po.py index d098b50e907..4c6495c5cfe 100755 --- a/release/scripts/modules/bl_i18n_utils/update_po.py +++ b/release/scripts/modules/bl_i18n_utils/update_po.py @@ -36,8 +36,8 @@ except: GETTEXT_MSGMERGE_EXECUTABLE = settings.GETTEXT_MSGMERGE_EXECUTABLE -BRANCHES_DIR = settings.BRANCHES_DIR -TRUNK_PO_DIR = settings.TRUNK_PO_DIR +BRANCHES_DIR = settings.BRANCHES_DIR +TRUNK_PO_DIR = settings.TRUNK_PO_DIR FILE_NAME_POT = settings.FILE_NAME_POT diff --git a/release/scripts/modules/bl_i18n_utils/update_pot.py b/release/scripts/modules/bl_i18n_utils/update_pot.py index ca5d156be9b..f98fc5d7705 100755 --- a/release/scripts/modules/bl_i18n_utils/update_pot.py +++ b/release/scripts/modules/bl_i18n_utils/update_pot.py @@ -74,12 +74,13 @@ 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() for srch in pygettexts: m = srch(f) - line = pos =0 + line = pos = 0 while m: d = m.groupdict() # Context. @@ -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(): diff --git a/release/scripts/modules/bl_i18n_utils/update_trunk.py b/release/scripts/modules/bl_i18n_utils/update_trunk.py index 5e0ceab387c..b7f8f375744 100755 --- a/release/scripts/modules/bl_i18n_utils/update_trunk.py +++ b/release/scripts/modules/bl_i18n_utils/update_trunk.py @@ -65,7 +65,6 @@ def main(): help="Restrict processed languages to those.") args = parser.parse_args() - ret = 0 failed = set() diff --git a/release/scripts/modules/bl_i18n_utils/utils.py b/release/scripts/modules/bl_i18n_utils/utils.py index ebf0f994a7a..3e5394d85a4 100644 --- a/release/scripts/modules/bl_i18n_utils/utils.py +++ b/release/scripts/modules/bl_i18n_utils/utils.py @@ -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) @@ -156,7 +155,7 @@ def parse_messages(fname): reading_ctxt = True if line.startswith(COMMENT_PREFIX): is_commented = True - line = line[9+len(COMMENT_PREFIX):-1] + line = line[9 + len(COMMENT_PREFIX):-1] else: line = line[9:-1] msgctxt_lines.append(line) @@ -167,7 +166,7 @@ def parse_messages(fname): reading_msgid = True if line.startswith(COMMENT_PREFIX): is_commented = True - line = line[7+len(COMMENT_PREFIX):-1] + line = line[7 + len(COMMENT_PREFIX):-1] else: line = line[7:-1] msgid_lines.append(line) @@ -180,7 +179,7 @@ def parse_messages(fname): reading_msgid = False reading_msgstr = True if line.startswith(COMMENT_PREFIX): - line = line[8+len(COMMENT_PREFIX):-1] + line = line[8 + len(COMMENT_PREFIX):-1] if not is_commented: is_broken = True else: @@ -194,13 +193,13 @@ def parse_messages(fname): elif line.startswith("#"): if reading_msgid: if is_commented: - msgid_lines.append(line[1+len(COMMENT_PREFIX):-1]) + msgid_lines.append(line[1 + len(COMMENT_PREFIX):-1]) else: msgid_lines.append(line) is_broken = True elif reading_msgstr: if is_commented: - msgstr_lines.append(line[1+len(COMMENT_PREFIX):-1]) + msgstr_lines.append(line[1 + len(COMMENT_PREFIX):-1]) else: msgstr_lines.append(line) is_broken = True @@ -338,13 +337,13 @@ def print_stats(stats, glob_stats=None, prefix=""): lvl = lvl_ttips = lvl_trans_ttips = lvl_ttips_in_trans = lvl_comm = 0.0 if tot_msgs > 0: - lvl = float(trans_msgs)/float(tot_msgs) - lvl_ttips = float(tot_ttips)/float(tot_msgs) - lvl_comm = float(comm_msgs)/float(tot_msgs+comm_msgs) + lvl = float(trans_msgs) / float(tot_msgs) + lvl_ttips = float(tot_ttips) / float(tot_msgs) + lvl_comm = float(comm_msgs) / float(tot_msgs+comm_msgs) if tot_ttips > 0: - lvl_trans_ttips = float(trans_ttips)/float(tot_ttips) + lvl_trans_ttips = float(trans_ttips) / float(tot_ttips) if trans_msgs > 0: - lvl_ttips_in_trans = float(trans_ttips)/float(trans_msgs) + lvl_ttips_in_trans = float(trans_ttips) / float(trans_msgs) if glob_stats: glob_stats["nbr"] += 1.0 @@ -368,9 +367,8 @@ def print_stats(stats, glob_stats=None, prefix=""): "{:>6.1%} of translated messages are tooltips ({} over {}).\n" "".format(lvl_ttips_in_trans, trans_ttips, trans_msgs), "{:>6.1%} of messages are commented ({} over {}).\n" - "".format(lvl_comm, comm_msgs, comm_msgs+tot_msgs), + "".format(lvl_comm, comm_msgs, comm_msgs + tot_msgs), "This translation is currently made of {} signs.\n" "".format(nbr_trans_signs)) print(prefix.join(lines)) return 0 - diff --git a/release/scripts/modules/console_python.py b/release/scripts/modules/console_python.py index 2aaadb17b71..d32606eb0b0 100644 --- a/release/scripts/modules/console_python.py +++ b/release/scripts/modules/console_python.py @@ -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 diff --git a/release/scripts/startup/bl_ui/properties_data_armature.py b/release/scripts/startup/bl_ui/properties_data_armature.py index 29170cde1fa..e194d7a1370 100644 --- a/release/scripts/startup/bl_ui/properties_data_armature.py +++ b/release/scripts/startup/bl_ui/properties_data_armature.py @@ -323,7 +323,7 @@ class DATA_PT_onion_skinning(OnionSkinButtonsPanel): # , Panel): # inherit from def draw(self, context): ob = context.object - + self.draw_settings(context, ob.pose.animation_visualization, bones=True) diff --git a/release/scripts/startup/bl_ui/properties_data_speaker.py b/release/scripts/startup/bl_ui/properties_data_speaker.py index 1d7646e9280..ca922dfb544 100644 --- a/release/scripts/startup/bl_ui/properties_data_speaker.py +++ b/release/scripts/startup/bl_ui/properties_data_speaker.py @@ -105,7 +105,7 @@ class DATA_PT_cone(DataButtonsPanel, Panel): speaker = context.speaker split = layout.split() - + col = split.column() col.label("Angle:") col.prop(speaker, "cone_angle_outer", text="Outer") diff --git a/release/scripts/startup/bl_ui/properties_game.py b/release/scripts/startup/bl_ui/properties_game.py index 54817c27714..5ff49a7d369 100644 --- a/release/scripts/startup/bl_ui/properties_game.py +++ b/release/scripts/startup/bl_ui/properties_game.py @@ -347,7 +347,7 @@ class RENDER_PT_game_stereo(RenderButtonsPanel, Panel): elif dome_type == 'PANORAM_SPH': col = split.column() col.prop(gs, "dome_buffer_resolution", text="Resolution", slider=True) - + col = split.column() col.prop(gs, "dome_tessellation", text="Tessellation") @@ -394,7 +394,7 @@ class RENDER_PT_game_system(RenderButtonsPanel, Panel): layout = self.layout gs = context.scene.game_settings - + row = layout.row() row.prop(gs, "use_frame_rate") row.prop(gs, "restrict_animation_updates") @@ -413,7 +413,7 @@ class RENDER_PT_game_display(RenderButtonsPanel, Panel): def draw(self, context): layout = self.layout - + gs = context.scene.game_settings layout.prop(context.scene.render, "fps", text="Animation Frame Rate", slider=False) @@ -581,13 +581,13 @@ class WORLD_PT_game_mist(WorldButtonsPanel, Panel): world = context.world layout.active = world.mist_settings.use_mist - + layout.prop(world.mist_settings, "falloff") row = layout.row(align=True) row.prop(world.mist_settings, "start") row.prop(world.mist_settings, "depth") - + layout.prop(world.mist_settings, "intensity", text="Minimum Intensity") diff --git a/release/scripts/startup/bl_ui/properties_mask_common.py b/release/scripts/startup/bl_ui/properties_mask_common.py index 699ade3cb95..e40b46fda70 100644 --- a/release/scripts/startup/bl_ui/properties_mask_common.py +++ b/release/scripts/startup/bl_ui/properties_mask_common.py @@ -16,7 +16,7 @@ # # ##### END GPL LICENSE BLOCK ##### -# <pep8 compliant> +# <pep8-80 compliant> # panels get subclassed (not registered directly) # menus are referenced `as is` @@ -122,7 +122,7 @@ class MASK_PT_spline(): col = layout.column() col.prop(spline, "weight_interpolation") - + row = col.row() row.prop(spline, "use_cyclic") row.prop(spline, "use_fill") diff --git a/release/scripts/startup/bl_ui/properties_scene.py b/release/scripts/startup/bl_ui/properties_scene.py index 361332428b6..8449d26f6e6 100644 --- a/release/scripts/startup/bl_ui/properties_scene.py +++ b/release/scripts/startup/bl_ui/properties_scene.py @@ -39,7 +39,7 @@ class SCENE_PT_scene(SceneButtonsPanel, Panel): def draw(self, context): layout = self.layout - + scene = context.scene layout.prop(scene, "camera") @@ -53,7 +53,7 @@ class SCENE_PT_audio(SceneButtonsPanel, Panel): def draw(self, context): layout = self.layout - + scene = context.scene rd = context.scene.render ffmpeg = rd.ffmpeg @@ -83,7 +83,7 @@ class SCENE_PT_unit(SceneButtonsPanel, Panel): def draw(self, context): layout = self.layout - + unit = context.scene.unit_settings col = layout.column() diff --git a/release/scripts/startup/bl_ui/properties_texture.py b/release/scripts/startup/bl_ui/properties_texture.py index 96094708ea2..46a17675c91 100644 --- a/release/scripts/startup/bl_ui/properties_texture.py +++ b/release/scripts/startup/bl_ui/properties_texture.py @@ -116,7 +116,7 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel, Panel): def draw(self, context): layout = self.layout - + slot = getattr(context, "texture_slot", None) node = getattr(context, "texture_node", None) space = context.space_data diff --git a/release/scripts/startup/bl_ui/properties_world.py b/release/scripts/startup/bl_ui/properties_world.py index 5af87875018..0b8d8a45a08 100644 --- a/release/scripts/startup/bl_ui/properties_world.py +++ b/release/scripts/startup/bl_ui/properties_world.py @@ -82,7 +82,7 @@ class WORLD_PT_world(WorldButtonsPanel, Panel): def draw(self, context): layout = self.layout - + world = context.world row = layout.row() @@ -112,7 +112,7 @@ class WORLD_PT_ambient_occlusion(WorldButtonsPanel, Panel): def draw(self, context): layout = self.layout - + light = context.world.light_settings layout.active = light.use_ambient_occlusion @@ -132,7 +132,7 @@ class WORLD_PT_environment_lighting(WorldButtonsPanel, Panel): def draw(self, context): layout = self.layout - + light = context.world.light_settings layout.active = light.use_environment_light @@ -152,7 +152,7 @@ class WORLD_PT_indirect_lighting(WorldButtonsPanel, Panel): def draw(self, context): layout = self.layout - + light = context.world.light_settings layout.active = light.use_indirect_light and light.gather_method == 'APPROXIMATE' @@ -171,7 +171,7 @@ class WORLD_PT_gather(WorldButtonsPanel, Panel): def draw(self, context): layout = self.layout - + light = context.world.light_settings layout.active = light.use_ambient_occlusion or light.use_environment_light or light.use_indirect_light @@ -226,7 +226,7 @@ class WORLD_PT_mist(WorldButtonsPanel, Panel): def draw(self, context): layout = self.layout - + world = context.world layout.active = world.mist_settings.use_mist @@ -256,7 +256,7 @@ class WORLD_PT_stars(WorldButtonsPanel, Panel): def draw(self, context): layout = self.layout - + world = context.world layout.active = world.star_settings.use_stars diff --git a/release/scripts/startup/bl_ui/space_clip.py b/release/scripts/startup/bl_ui/space_clip.py index 53fcf71c31f..559cf7f93b7 100644 --- a/release/scripts/startup/bl_ui/space_clip.py +++ b/release/scripts/startup/bl_ui/space_clip.py @@ -188,11 +188,11 @@ class CLIP_PT_tools_marker(CLIP_PT_tracking_panel, Panel): def draw(self, context): layout = self.layout - + sc = context.space_data clip = sc.clip settings = clip.tracking.settings - + col = layout.column(align=True) col.operator("clip.add_marker_move") col.operator("clip.detect_features") @@ -293,7 +293,7 @@ class CLIP_PT_tools_solve(CLIP_PT_tracking_panel, Panel): def draw(self, context): layout = self.layout - + clip = context.space_data.clip tracking = clip.tracking settings = tracking.settings @@ -484,7 +484,7 @@ class CLIP_PT_track(CLIP_PT_tracking_panel, Panel): def draw(self, context): layout = self.layout - + sc = context.space_data clip = context.space_data.clip act_track = clip.tracking.tracks.active @@ -551,7 +551,7 @@ class CLIP_PT_track_settings(CLIP_PT_tracking_panel, Panel): def draw(self, context): layout = self.layout - + clip = context.space_data.clip settings = clip.tracking.settings @@ -786,7 +786,7 @@ class CLIP_PT_proxy(CLIP_PT_clip_view_panel, Panel): def draw(self, context): layout = self.layout - + sc = context.space_data clip = sc.clip @@ -864,7 +864,7 @@ class CLIP_MT_view(Menu): def draw(self, context): layout = self.layout - + sc = context.space_data if sc.view == 'CLIP': @@ -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' diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py index 87f7104d74e..3d9b3afc4ee 100644 --- a/release/scripts/startup/bl_ui/space_image.py +++ b/release/scripts/startup/bl_ui/space_image.py @@ -213,7 +213,7 @@ class IMAGE_MT_uvs_snap(Menu): def draw(self, context): layout = self.layout - + layout.operator_context = 'EXEC_REGION_WIN' layout.operator("uv.snap_selected", text="Selected to Pixels").target = 'PIXELS' @@ -231,7 +231,7 @@ class IMAGE_MT_uvs_mirror(Menu): def draw(self, context): layout = self.layout - + layout.operator_context = 'EXEC_REGION_WIN' layout.operator("transform.mirror", text="X Axis").constraint_axis[0] = True @@ -839,7 +839,7 @@ class IMAGE_UV_sculpt(Panel, ImagePaintPanel): row = col.row(align=True) self.prop_unified_strength(row, context, brush, "strength", slider=True, text="Strength") self.prop_unified_strength(row, context, brush, "use_pressure_strength") - + col = layout.column() col.prop(toolsettings, "uv_sculpt_lock_borders") col.prop(toolsettings, "uv_sculpt_all_islands") @@ -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 diff --git a/release/scripts/startup/bl_ui/space_node.py b/release/scripts/startup/bl_ui/space_node.py index 9ff290698d3..961ab08efdd 100644 --- a/release/scripts/startup/bl_ui/space_node.py +++ b/release/scripts/startup/bl_ui/space_node.py @@ -226,7 +226,7 @@ class NODE_PT_quality(bpy.types.Panel): def draw(self, context): layout = self.layout - + snode = context.space_data tree = snode.node_tree @@ -236,7 +236,7 @@ class NODE_PT_quality(bpy.types.Panel): layout.prop(tree, "use_opencl") layout.prop(tree, "two_pass") layout.prop(snode, "show_highlight") - + class NODE_MT_node_color_presets(Menu): """Predefined node color""" diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py index fb212f594c8..d099db1645b 100644 --- a/release/scripts/startup/bl_ui/space_sequencer.py +++ b/release/scripts/startup/bl_ui/space_sequencer.py @@ -184,7 +184,7 @@ class SEQUENCER_MT_add(Menu): def draw(self, context): layout = self.layout - + layout.operator_context = 'INVOKE_REGION_WIN' if len(bpy.data.scenes) > 10: @@ -217,7 +217,7 @@ class SEQUENCER_MT_add_effect(Menu): def draw(self, context): layout = self.layout - + layout.operator_context = 'INVOKE_REGION_WIN' layout.operator("sequencer.effect_strip_add", text="Add").type = 'ADD' @@ -836,7 +836,7 @@ class SEQUENCER_PT_preview(SequencerButtonsPanel_Output, Panel): def draw(self, context): layout = self.layout - + render = context.scene.render col = layout.column() diff --git a/release/scripts/startup/bl_ui/space_text.py b/release/scripts/startup/bl_ui/space_text.py index 56b242382df..eca9bc22db9 100644 --- a/release/scripts/startup/bl_ui/space_text.py +++ b/release/scripts/startup/bl_ui/space_text.py @@ -302,7 +302,7 @@ class TEXT_MT_toolbox(Menu): def draw(self, context): layout = self.layout - + layout.operator_context = 'INVOKE_DEFAULT' layout.operator("text.cut") diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py index 5f59a76e724..e443c7804a6 100644 --- a/release/scripts/startup/bl_ui/space_userpref.py +++ b/release/scripts/startup/bl_ui/space_userpref.py @@ -79,7 +79,7 @@ class USERPREF_HT_header(Header): def draw(self, context): layout = self.layout - + layout.template_header(menus=False) userpref = context.user_preferences @@ -138,7 +138,7 @@ class USERPREF_MT_splash(Menu): def draw(self, context): layout = self.layout - + split = layout.split() row = split.row() row.label("") @@ -852,7 +852,7 @@ class USERPREF_MT_ndof_settings(Menu): def draw(self, context): layout = self.layout - + input_prefs = context.user_preferences.inputs layout.separator() @@ -982,7 +982,7 @@ class USERPREF_MT_addons_dev_guides(Menu): # menu to open web-pages with addons development guides def draw(self, context): layout = self.layout - + layout.operator("wm.url_open", text="API Concepts", icon='URL').url = "http://wiki.blender.org/index.php/Dev:2.5/Py/API/Intro" layout.operator("wm.url_open", text="Addon Guidelines", icon='URL').url = "http://wiki.blender.org/index.php/Dev:2.5/Py/Scripts/Guidelines/Addons" layout.operator("wm.url_open", text="How to share your addon", icon='URL').url = "http://wiki.blender.org/index.php/Dev:Py/Sharing" diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index aea587844cf..5f6ed15e6e1 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -177,7 +177,7 @@ class VIEW3D_MT_transform(VIEW3D_MT_transform_base): class VIEW3D_MT_transform_object(VIEW3D_MT_transform_base): def draw(self, context): layout = self.layout - + # base menu VIEW3D_MT_transform_base.draw(self, context) @@ -214,7 +214,7 @@ class VIEW3D_MT_transform_object(VIEW3D_MT_transform_base): class VIEW3D_MT_transform_armature(VIEW3D_MT_transform_base): def draw(self, context): layout = self.layout - + # base menu VIEW3D_MT_transform_base.draw(self, context) @@ -431,23 +431,23 @@ class VIEW3D_MT_view_align_selected(Menu): props = layout.operator("view3d.viewnumpad", text="Top") props.align_active = True props.type = 'TOP' - + props = layout.operator("view3d.viewnumpad", text="Bottom") props.align_active = True props.type = 'BOTTOM' - + props = layout.operator("view3d.viewnumpad", text="Front") props.align_active = True props.type = 'FRONT' - + props = layout.operator("view3d.viewnumpad", text="Back") props.align_active = True props.type = 'BACK' - + props = layout.operator("view3d.viewnumpad", text="Right") props.align_active = True props.type = 'RIGHT' - + props = layout.operator("view3d.viewnumpad", text="Left") props.align_active = True props.type = 'LEFT' @@ -1198,7 +1198,7 @@ class VIEW3D_MT_vertex_group(Menu): def draw(self, context): layout = self.layout - + layout.operator_context = 'EXEC_AREA' layout.operator("object.vertex_group_assign", text="Assign to New Group").new = True @@ -1357,7 +1357,7 @@ class VIEW3D_MT_particle_specials(Menu): def draw(self, context): layout = self.layout - + particle_edit = context.tool_settings.particle_edit layout.operator("particle.rekey") @@ -1801,7 +1801,7 @@ class VIEW3D_MT_edit_mesh_edges(Menu): def draw(self, context): layout = self.layout - + layout.operator_context = 'INVOKE_REGION_WIN' layout.operator("mesh.edge_face_add") @@ -1849,7 +1849,7 @@ class VIEW3D_MT_edit_mesh_faces(Menu): def draw(self, context): layout = self.layout - + layout.operator_context = 'INVOKE_REGION_WIN' layout.operator("mesh.flip_normals") @@ -2643,7 +2643,7 @@ class VIEW3D_PT_etch_a_ton(Panel): def draw(self, context): layout = self.layout - + toolsettings = context.scene.tool_settings col = layout.column() diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py index a83a6e215fa..ac962ab5097 100644 --- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py +++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py @@ -1124,7 +1124,7 @@ class VIEW3D_MT_tools_projectpaint_clone(Menu): def draw(self, context): layout = self.layout - + for i, tex in enumerate(context.active_object.data.uv_textures): props = layout.operator("wm.context_set_int", text=tex.name) props.data_path = "active_object.data.uv_texture_clone_index" |