Clean up dead code, fix type errors, and add publish workflow

Remove unused _append_ops_call_method, fix _property_data_from_member
call signature, replace sys.version_info guard with hasattr check for
__buffer__ protocol, fix implicit string concatenations, add msgbus
overrides for 4.0-4.4, add conformance tests, and add publish script.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-03 11:07:52 +02:00
co-authored by Claude Opus 4.6
parent 673b9e54bc
commit f4df542dd1
17 changed files with 954 additions and 165 deletions
@@ -0,0 +1,75 @@
from dataclasses import dataclass
import os
import sys
import argparse
from typing import cast
import bpy
def argparse_create():
parser = argparse.ArgumentParser(
prog=os.path.basename(sys.argv[0]) + " --command keyconfig_export",
description="Write key-configuration to a file.",
)
parser.add_argument(
"-o",
"--output",
dest="output",
metavar="OUTPUT",
type=str,
help="The path to write the keymap to.",
required=True,
)
parser.add_argument(
"-a",
"--all",
dest="all",
action="store_true",
help="Write all key-maps (not only customized key-maps).",
required=False,
)
return parser
@dataclass
class Arguments:
output: str
all: bool
def keyconfig_export(argv: list[str]):
parser = argparse_create()
args = cast(Arguments, cast(object, parser.parse_args(argv)))
# Ensure the key configuration is loaded in background mode.
bpy.utils.keyconfig_init()
bpy.ops.preferences.keyconfig_export(
filepath=args.output,
all=args.all,
)
return 0
cli_commands: list[object] = []
def register():
cli_commands.append(
bpy.utils.register_cli_command("keyconfig_export", keyconfig_export)
)
def unregister():
for cmd in cli_commands:
bpy.utils.unregister_cli_command(cmd)
cli_commands.clear()
if __name__ == "__main__":
register()