diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-05-29 07:50:29 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-05-29 08:55:25 +0300 |
commit | 654fde2dd213e8799da09875eab961d5286b2452 (patch) | |
tree | 28ead63734dbde1f1f003f16c97781c0aaafc58c /source/blender/python/intern/bpy_library_load.c | |
parent | e115b7b06d325c00edae733f3eefd6dbab2dd89e (diff) |
PyAPI: use bpy_rna_types_capi.c to set type methods
Remove use of '_bpy' as an intermediate module to store functions
which were then assigned in bpy_types.py.
Diffstat (limited to 'source/blender/python/intern/bpy_library_load.c')
-rw-r--r-- | source/blender/python/intern/bpy_library_load.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/python/intern/bpy_library_load.c b/source/blender/python/intern/bpy_library_load.c index 989b7931444..05cbc9af601 100644 --- a/source/blender/python/intern/bpy_library_load.c +++ b/source/blender/python/intern/bpy_library_load.c @@ -459,15 +459,15 @@ static PyObject *bpy_lib_dir(BPy_Library *self) return PyDict_Keys(self->dict); } -int BPY_library_load_module(PyObject *mod_par) +PyMethodDef BPY_library_load_method_def = { + "load", + (PyCFunction)bpy_lib_load, + METH_STATIC | METH_VARARGS | METH_KEYWORDS, + bpy_lib_load_doc, +}; + +int BPY_library_load_type_ready(void) { - static PyMethodDef load_meth = { - "load", - (PyCFunction)bpy_lib_load, - METH_STATIC | METH_VARARGS | METH_KEYWORDS, - bpy_lib_load_doc, - }; - PyModule_AddObject(mod_par, "_library_load", PyCFunction_New(&load_meth, NULL)); /* some compilers don't like accessing this directly, delay assignment */ bpy_lib_Type.tp_getattro = PyObject_GenericGetAttr; |