Commit 74816f7c authored by Manuel Günther's avatar Manuel Günther
Browse files

Finished porting of C++ documentation

parent 1f420b5c
Pipeline #11582 canceled with stages
......@@ -604,10 +604,6 @@ static PyModuleDef module_definition = {
static PyObject* create_module (void) {
PyBobIoVideoWriter_Type.tp_new = PyType_GenericNew;
if (PyType_Ready(&PyBobIoVideoWriter_Type) < 0) return 0;
# if PY_VERSION_HEX >= 0x03000000
PyObject* module = PyModule_Create(&module_definition);
auto module_ = make_xsafe(module);
......@@ -619,9 +615,7 @@ static PyObject* create_module (void) {
if (!module) return 0;
if (!init_BobIoVideoReader(module)) return 0;
Py_INCREF(&PyBobIoVideoWriter_Type);
if (PyModule_AddObject(module, "writer", (PyObject *)&PyBobIoVideoWriter_Type) < 0) return 0;
if (!init_BobIoVideoWriter(module)) return 0;
/* imports dependencies */
if (import_bob_blitz() < 0) return 0;
......
......@@ -39,8 +39,6 @@ typedef struct {
} PyBobIoVideoReaderIteratorObject;
extern PyTypeObject PyBobIoVideoReaderIterator_Type;
// Writer
typedef struct {
PyObject_HEAD
......
......@@ -306,7 +306,8 @@ static auto s_load = bob::extension::FunctionDoc(
" The flag ``raise_on_error``, which is set to ``False`` by default influences the error reporting in case problems are found with the video file. "
"If you set it to ``True``, we will report problems raising exceptions. "
"If you set it to ``False`` (the default), we will truncate the file at the frame with problems and will not report anything. "
"It is your task to verify if the number of frames returned matches the expected number of frames as reported by the :py:attr:`number_of_frames` (or ``len``) of this object."
"It is your task to verify if the number of frames returned matches the expected number of frames as reported by the :py:attr:`number_of_frames` (or ``len``) of this object.",
true
)
.add_prototype("raise_on_error", "video")
.add_parameter("raise_on_error", "bool", "[Default: ``False``] Raise an excpetion in case of errors?")
......
......@@ -61,8 +61,7 @@ static PyObject* build_version_dictionary() {
if (!dict_steal(retval, "bob.core", bob_core_version())) return 0;
if (!dict_steal(retval, "bob.io.base", bob_io_base_version())) return 0;
Py_INCREF(retval);
return retval;
return Py_BuildValue("O", retval);
}
static PyMethodDef module_methods[] = {
......@@ -87,20 +86,20 @@ static PyModuleDef module_definition = {
static PyObject* create_module (void) {
# if PY_VERSION_HEX >= 0x03000000
PyObject* m = PyModule_Create(&module_definition);
auto m_ = make_xsafe(m);
PyObject* module = PyModule_Create(&module_definition);
auto module_ = make_xsafe(module);
const char* ret = "O";
# else
PyObject* m = Py_InitModule3(BOB_EXT_MODULE_NAME, module_methods, module_docstr);
PyObject* module = Py_InitModule3(BOB_EXT_MODULE_NAME, module_methods, module_docstr);
const char* ret = "N";
# endif
if (!m) return 0;
if (!module) return 0;
/* register version numbers and constants */
if (PyModule_AddStringConstant(m, "module", BOB_EXT_MODULE_VERSION) < 0) return 0;
if (PyModule_AddObject(m, "externals", build_version_dictionary()) < 0) return 0;
if (PyModule_AddStringConstant(module, "module", BOB_EXT_MODULE_VERSION) < 0) return 0;
if (PyModule_AddObject(module, "externals", build_version_dictionary()) < 0) return 0;
return Py_BuildValue(ret, m);
return Py_BuildValue(ret, module);
}
PyMODINIT_FUNC BOB_EXT_ENTRY_NAME (void) {
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment