Cleanup: pep8

This commit is contained in:
2018-07-03 06:27:53 +02:00
parent dbe1b07e05
commit b66aa0b0a6
25 changed files with 184 additions and 157 deletions

View File

@@ -209,6 +209,8 @@ def modules(module_cache=addons_fake_modules, *, refresh=True):
)
)
return mod_list
modules._is_first = True

View File

@@ -172,6 +172,7 @@ def ui_draw_filter_register(
class Wrapper(cls_real):
__slots__ = ()
def __getattribute__(self, attr):
if attr == "layout":
return UILayout_Fake(self_real.layout)

View File

@@ -43,14 +43,17 @@ else:
# XXX This is a quick hack to make it work with new I18n... objects! To be reworked!
def main():
import argparse
parser = argparse.ArgumentParser(description=
parser = argparse.ArgumentParser(
description=(
"Merge one or more .po files into the first dest one.\n"
"If a msgkey (msgctxt, msgid) is present in more than one merged po, the one in the first file "
"wins, unless its marked as fuzzy and one later is not.\n"
"The fuzzy flag is removed if necessary.\n"
"All other comments are never modified.\n"
"Commented messages in dst will always remain commented, and commented messages are never merged "
"from sources.")
"from sources."
),
)
parser.add_argument('-s', '--stats', action="store_true", help="Show statistics info.")
parser.add_argument('-r', '--replace', action="store_true",
help="Replace existing messages of same \"level\" already in dest po.")

View File

@@ -98,5 +98,6 @@ def main():
for value in read_blend_rend_chunk(arg):
print("%d %d %s" % value)
if __name__ == '__main__':
main()

View File

@@ -225,4 +225,5 @@ class BPyOpsSubModOp:
return ("<function bpy.ops.%s.%s at 0x%x'>" %
(self._module, self._func, id(self)))
ops_fake_module = BPyOps()

View File

@@ -183,6 +183,8 @@ def clean_name(name, replace="_"):
trans = maketrans_init()
return name.translate(trans)
clean_name._trans_cache = {}
@@ -223,6 +225,7 @@ def display_name(name):
name = _clean_utf8(name)
return name
def display_name_to_filepath(name):
"""
Performs the reverse of display_name using literal versions of characters

View File

@@ -142,7 +142,8 @@ def orientation_helper_factory(name, axis_forward='Y', axis_up='Z'):
members['axis_forward'] = EnumProperty(
name="Forward",
items=(('X', "X Forward", ""),
items=(
('X', "X Forward", ""),
('Y', "Y Forward", ""),
('Z', "Z Forward", ""),
('-X', "-X Forward", ""),
@@ -160,7 +161,8 @@ def orientation_helper_factory(name, axis_forward='Y', axis_up='Z'):
members['axis_up'] = EnumProperty(
name="Up",
items=(('X', "X Up", ""),
items=(
('X', "X Up", ""),
('Y', "Y Up", ""),
('Z', "Z Up", ""),
('-X', "-X Up", ""),
@@ -394,7 +396,8 @@ def unpack_face_list(list_of_tuples):
path_reference_mode = EnumProperty(
name="Path Mode",
description="Method used to reference paths",
items=(('AUTO', "Auto", "Use Relative paths with subdirectories only"),
items=(
('AUTO', "Auto", "Use Relative paths with subdirectories only"),
('ABSOLUTE', "Absolute", "Always write absolute paths"),
('RELATIVE', "Relative", "Always write relative paths "
"(where possible)"),

View File

@@ -153,6 +153,7 @@ def topretty_py(py_data, indent=" "):
return "\n".join(lines)
if __name__ == "__main__":
# testing code.

View File

@@ -19,12 +19,12 @@
# ##### END GPL LICENSE BLOCK #####
# Original copyright (see docstring):
#*****************************************************************************
# ****************************************************************************
# Copyright (C) 2001-2006 Fernando Perez <fperez@colorado.edu>
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.
#*****************************************************************************
# ****************************************************************************
# <pep8 compliant>

View File

@@ -224,6 +224,7 @@ def execute(context, is_interactive):
return {'FINISHED'}
execute.hooks = []

View File

@@ -40,6 +40,7 @@ def shell_run(text):
add_scrollback(output, style)
PROMPT = "$ "
@@ -64,7 +65,7 @@ def execute(context, is_interactive):
def autocomplete(context):
#~ sc = context.space_data
# sc = context.space_data
# TODO
return {'CANCELLED'}

View File

@@ -179,6 +179,7 @@ def graph_armature(obj, filepath, FAKE_PARENT=True, CONSTRAINTS=True, DRIVERS=Tr
print("\nSaved:", filepath)
return True
if __name__ == "__main__":
import os
tmppath = "/tmp/test.dot"

View File

@@ -219,6 +219,7 @@ def RKS_GEN_scaling(ksi, context, ks, data):
# ------
# Property identifiers for Bendy Bones
bbone_property_ids = (
"bbone_curveinx",

View File

@@ -174,7 +174,7 @@ def draw_kmi(display_keymaps, kc, km, kmi, layout, level):
sub.prop(kmi, "propvalue", text="")
else:
# One day...
#~ sub.prop_search(kmi, "idname", bpy.context.window_manager, "operators_all", text="")
# sub.prop_search(kmi, "idname", bpy.context.window_manager, "operators_all", text="")
sub.prop(kmi, "idname", text="")
if map_type not in {'TEXTINPUT', 'TIMER'}:
@@ -207,6 +207,7 @@ def draw_kmi(display_keymaps, kc, km, kmi, layout, level):
draw_km(display_keymaps, kc, kmm, None, layout, level + 1)
layout.context_pointer_set("keymap", km)
_EVENT_TYPES = set()
_EVENT_TYPE_MAP = {}
_EVENT_TYPE_MAP_EXTRA = {}
@@ -260,8 +261,8 @@ def draw_filtered(display_keymaps, filter_type, filter_text, layout):
kmi_test_type = []
# initialize? - so if a if a kmi has a MOD assigned it wont show up.
#~ for kv in key_mod.values():
#~ kmi_test_dict[kv] = {False}
# for kv in key_mod.values():
# kmi_test_dict[kv] = {False}
# altname: attr
for kk, kv in key_mod.items():
@@ -374,7 +375,7 @@ def draw_keymaps(context, layout):
row = subcol.row(align=True)
#~ row.prop_search(wm.keyconfigs, "active", wm, "keyconfigs", text="Key Config")
# row.prop_search(wm.keyconfigs, "active", wm, "keyconfigs", text="Key Config")
text = bpy.path.display_name(wm.keyconfigs.active.name)
if not text:
text = "Blender (default)"
@@ -382,8 +383,8 @@ def draw_keymaps(context, layout):
row.operator("wm.keyconfig_preset_add", text="", icon='ZOOMIN')
row.operator("wm.keyconfig_preset_add", text="", icon='ZOOMOUT').remove_active = True
#~ layout.context_pointer_set("keyconfig", wm.keyconfigs.active)
#~ row.operator("wm.keyconfig_remove", text="", icon='X')
# layout.context_pointer_set("keyconfig", wm.keyconfigs.active)
# row.operator("wm.keyconfig_remove", text="", icon='X')
row.separator()
rowsub = row.split(align=True, percentage=0.33)
# postpone drawing into rowsub, so we can set alert!

View File

@@ -304,7 +304,8 @@ def select_next(bm, report):
uuid_cmp_test = fn(uuid_cmp)
ele_pair_next_uuid_test = [
(ele, uuid) for (ele, uuid) in ele_pair_next_uuid
if uuid_cmp_test == fn(uuid)]
if uuid_cmp_test == fn(uuid)
]
if len(ele_pair_next_uuid_test) > 1:
ele_pair_next_uuid = ele_pair_next_uuid_test
elif len(ele_pair_next_uuid_test) == 1:

View File

@@ -527,6 +527,8 @@ class BUILTIN_KSI_WholeCharacter(KeyingSetInfo):
ksi.addProp(ks, bone, prop)
# All properties that are likely to get animated in a character rig, only selected bones.
class BUILTIN_KSI_WholeCharacterSelected(KeyingSetInfo):
"""Insert a keyframe for all properties that are likely to get animated in a character rig """
"""(only selected bones)"""
@@ -557,6 +559,8 @@ class BUILTIN_KSI_WholeCharacterSelected(KeyingSetInfo):
###############################
# Delta Location
class BUILTIN_KSI_DeltaLocation(KeyingSetInfo):
"""Insert keyframes for additional location offset"""
bl_label = "Delta Location"
@@ -643,6 +647,7 @@ class BUILTIN_KSI_DeltaScale(KeyingSetInfo):
###############################
# Note that this controls order of options in 'insert keyframe' menu.
# Better try to keep some logical order here beyond mere alphabetical one, also because of menu entries shortcut.
# See also T51867.

View File

@@ -69,6 +69,7 @@ def group_tools_draw(self, layout, context):
layout.operator("node.group_ungroup")
layout.separator()
# maps node tree type to group node type
node_tree_group_type = {
'CompositorNodeTree': 'CompositorNodeGroup',