From 36eb9f9121f2d5b51e54e759abf74a85c91960ff Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Sat, 31 Dec 2022 14:48:25 +0100 Subject: [PATCH] Export the Alliance library list in AllianceFramework (as a list). --- crlcore/src/pyCRL/PyAllianceFramework.cpp | 24 +++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/crlcore/src/pyCRL/PyAllianceFramework.cpp b/crlcore/src/pyCRL/PyAllianceFramework.cpp index b7583fde..e8a6599d 100644 --- a/crlcore/src/pyCRL/PyAllianceFramework.cpp +++ b/crlcore/src/pyCRL/PyAllianceFramework.cpp @@ -54,6 +54,15 @@ namespace CRL { using Isobar::PyCell_Link; + PyObject* AllianceLibsToList ( const AllianceLibraries& libs ) + { + PyObject* pyList = PyList_New( libs.size() ); + for ( size_t i=0 ; igetAllianceLibraries() ); + HCATCH + return pyList; + } + + static PyObject* PyAllianceFramework_getCell ( PyAllianceFramework* self, PyObject* args ) { cdebug_log(30,0) << "PyAllianceFramework_getCell ()" << endl; @@ -624,6 +646,8 @@ extern "C" { , "Gets a Library, by index." } , { "getAllianceLibrary" , (PyCFunction)PyAllianceFramework_getAllianceLibrary , METH_VARARGS , "Gets an AllianceLibrary, by index, name or Hurricane Library." } + , { "getAllianceLibraries" , (PyCFunction)PyAllianceFramework_getAllianceLibraries , METH_NOARGS + , "Returns the AllianceLibraries vector as a list." } , { "getCell" , (PyCFunction)PyAllianceFramework_getCell , METH_VARARGS , "Gets an Alliance Cell." } , { "saveCell" , (PyCFunction)PyAllianceFramework_saveCell , METH_VARARGS