import python module and export identifiers in Singular namespace
| 476 | |
| 477 | /// import python module and export identifiers in Singular namespace |
| 478 | BOOLEAN python_import(leftv result, leftv value) |
| 479 | { |
| 480 | if ((value == NULL) || (value->Typ()!= STRING_CMD)) |
| 481 | { |
| 482 | WerrorS("expected python_import('string')"); |
| 483 | return TRUE; |
| 484 | } |
| 485 | |
| 486 | from_module_import_all(reinterpret_cast<const char*>(value->Data())); |
| 487 | sync_contexts(); |
| 488 | |
| 489 | Py_INCREF(Py_None); |
| 490 | return PythonCastStatic<>(Py_None).assign_to(result); |
| 491 | } |
| 492 | |
| 493 | /// blackbox support - initialization |
| 494 | void* pyobject_Init(blackbox*) |
nothing calls this directly
no test coverage detected