Commit: 95f51bb01deaf2f863f97aff1dbcd967ea524287 Author: Roman Kornev Date: Mon Apr 6 23:37:54 2020 +1000 Branches: master https://developer.blender.org/rB95f51bb01deaf2f863f97aff1dbcd967ea524287
Keymap: sort exported key-maps This makes the resulting key-maps easier to compare. =================================================================== M release/scripts/modules/bl_keymap_utils/io.py =================================================================== diff --git a/release/scripts/modules/bl_keymap_utils/io.py b/release/scripts/modules/bl_keymap_utils/io.py index a93e86bc0a1..8cddbd37ea3 100644 --- a/release/scripts/modules/bl_keymap_utils/io.py +++ b/release/scripts/modules/bl_keymap_utils/io.py @@ -136,6 +136,9 @@ def keyconfig_export_as_data(wm, kc, filepath, *, all_keymaps=False): # First add all user_modified keymaps (found in keyconfigs.user.keymaps list), # then add all remaining keymaps from the currently active custom keyconfig. # + # Sort the resulting list according to top context name, + # while this isn't essential, it makes comparing keymaps simpler. + # # This will create a final list of keymaps that can be used as a "diff" against # the default blender keyconfig, recreating the current setup from a fresh blender # without needing to export keymaps which haven't been edited. @@ -152,6 +155,10 @@ def keyconfig_export_as_data(wm, kc, filepath, *, all_keymaps=False): else: export_keymaps = keyconfig_merge(edited_kc, edited_kc) + # Sort the keymap list by top context name before exporting, + # not essential, just convenient to order them predictably. + export_keymaps.sort(key=lambda k: k[0].name) + with open(filepath, "w") as fh: fw = fh.write fw("keyconfig_data = \\\n[") _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs