diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-02-26 09:22:04 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-02-26 09:22:04 +0400 |
commit | 8558fdd4c7e09802357afc5eb99606575f5dc6b4 (patch) | |
tree | 77ae98936493102a6889ab57781e51d42fc0d205 /source | |
parent | bba6b535dee7e91f13b88cb706e8f94bfc273c90 (diff) |
patch [#34437] Fix text editor bug: ctrl+F is not configurable
in fact the keymap editor was missing other keymaps so added these too,
also updated keymap checker to make sure there is no mismatch with region/space types.
Diffstat (limited to 'source')
-rw-r--r-- | source/tests/bl_keymap_completeness.py | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/source/tests/bl_keymap_completeness.py b/source/tests/bl_keymap_completeness.py index d36f2d8e9ae..00322907f69 100644 --- a/source/tests/bl_keymap_completeness.py +++ b/source/tests/bl_keymap_completeness.py @@ -25,40 +25,56 @@ from bpy_extras import keyconfig_utils def check_maps(): - maps = set() + maps = {} def fill_maps(ls): - for entry in ls: - maps.add(entry[0]) - fill_maps(entry[3]) + for km_name, km_space_type, km_region_type, km_sub in ls: + maps[km_name] = (km_space_type, km_region_type) + fill_maps(km_sub) fill_maps(keyconfig_utils.KM_HIERARCHY) import bpy - maps_bl = set(bpy.context.window_manager.keyconfigs.active.keymaps.keys()) + keyconf = bpy.context.window_manager.keyconfigs.active + maps_bl = set(keyconf.keymaps.keys()) + maps_py = set(maps.keys()) err = False # Check keyconfig contains only maps that exist in blender - test = maps - maps_bl + test = maps_py - maps_bl if test: print("Keymaps that are in 'keyconfig_utils' but not blender") for km_id in sorted(test): print("\t%s" % km_id) err = True - test = maps_bl - maps + test = maps_bl - maps_py if test: print("Keymaps that are in blender but not in 'keyconfig_utils'") for km_id in sorted(test): - print("\t%s" % km_id) + km = keyconf.keymaps[km_id] + print(" ('%s', '%s', '%s', [])," % (km_id, km.space_type, km.region_type)) err = True + # Check space/region's are OK + print("Comparing keymap space/region types...") + for km_id, km in keyconf.keymaps.items(): + km_py = maps.get(km_id) + if km_py is not None: + km_space_type, km_region_type = km_py + if km_space_type != km.space_type or km_region_type != km.region_type: + print(" Error:") + print(" expected -- ('%s', '%s', '%s', [])," % (km_id, km.space_type, km.region_type)) + print(" got -- ('%s', '%s', '%s', [])," % (km_id, km_space_type, km_region_type)) + print("done!") + return err def main(): err = check_maps() + import bpy if err and bpy.app.background: # alert CTest we failed import sys |