Changeset 55
- Timestamp:
- 12/12/06 18:11:46 (2 years ago)
- Files:
-
- trunk/infrastructure/pyd/def.d (modified) (4 diffs)
- trunk/infrastructure/pyd/exception.d (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/infrastructure/pyd/def.d
r54 r55 35 35 private PyMethodDef[][char[]] module_methods; 36 36 private PyObject*[char[]] pyd_modules; 37 38 private void ready_module_methods(char[] modulename) { 39 PyMethodDef empty; 40 if (!(modulename in module_methods)) { 41 module_methods[modulename] = (PyMethodDef[]).init; 42 module_methods[modulename] ~= empty; 43 } 44 } 37 45 38 46 PyObject* Pyd_Module_p(char[] modulename="") { … … 81 89 pragma(msg, "def: " ~ name); 82 90 PyMethodDef empty; 83 if (!(modulename in module_methods)) { 84 module_methods[modulename] = (PyMethodDef[]).init; 85 module_methods[modulename] ~= empty; 86 } 91 ready_module_methods(modulename); 87 92 PyMethodDef[]* list = &module_methods[modulename]; 88 93 … … 99 104 PyObject* module_init(char[] name) { 100 105 //_loadPythonSupport(); 106 ready_module_methods(""); 101 107 pyd_modules[""] = Py_InitModule((name ~ \0).ptr, module_methods[""].ptr); 102 108 return pyd_modules[""]; … … 107 113 */ 108 114 PyObject* add_module(char[] name) { 115 ready_module_methods(name); 109 116 pyd_modules[name] = Py_InitModule((name ~ \0).ptr, module_methods[name].ptr); 110 117 return pyd_modules[name]; trunk/infrastructure/pyd/exception.d
r54 r55 87 87 } 88 88 89 alias exception_catcher!(PyObject*) exception_catcher_PyObjectPtr; 90 alias exception_catcher!(int) exception_catcher_int; 91 alias exception_catcher!(void) exception_catcher_void; 92 89 93 /** 90 94 * This simple exception class holds a Python exception.
