mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Add PriceList to typemap for Python bindings
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@19915 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
83a23d7986
commit
0607593792
@ -127,33 +127,34 @@ typedef char gchar;
|
||||
PyExc_ValueError,
|
||||
"function returning gboolean returned a value that wasn't "
|
||||
"TRUE or FALSE.");
|
||||
return NULL;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
%typemap(out) GList *, CommodityList *, SplitList *, AccountList *, LotList *,
|
||||
MonetaryList * {
|
||||
MonetaryList *, PriceList * {
|
||||
guint i;
|
||||
gpointer data;
|
||||
PyObject *list = PyList_New(0);
|
||||
for (i = 0; i < g_list_length($1); i++)
|
||||
{
|
||||
data = g_list_nth_data($1, i);
|
||||
data = g_list_nth_data($1, i);
|
||||
if (GNC_IS_ACCOUNT(data))
|
||||
PyList_Append(list, SWIG_NewPointerObj(data, SWIGTYPE_p_Account, 0));
|
||||
PyList_Append(list, SWIG_NewPointerObj(data, SWIGTYPE_p_Account, 0));
|
||||
else if (GNC_IS_SPLIT(data))
|
||||
PyList_Append(list, SWIG_NewPointerObj(data, SWIGTYPE_p_Split, 0));
|
||||
PyList_Append(list, SWIG_NewPointerObj(data, SWIGTYPE_p_Split, 0));
|
||||
else if (GNC_IS_TRANSACTION(data))
|
||||
PyList_Append(list, SWIG_NewPointerObj(data, SWIGTYPE_p_Transaction, 0));
|
||||
PyList_Append(list, SWIG_NewPointerObj(data, SWIGTYPE_p_Transaction, 0));
|
||||
else if (GNC_IS_COMMODITY(data))
|
||||
PyList_Append(list, SWIG_NewPointerObj(data, SWIGTYPE_p_gnc_commodity, 0));
|
||||
PyList_Append(list, SWIG_NewPointerObj(data, SWIGTYPE_p_gnc_commodity, 0));
|
||||
else if (GNC_IS_LOT(data))
|
||||
PyList_Append(list, SWIG_NewPointerObj(data, SWIGTYPE_p_GNCLot, 0));
|
||||
else if ($1_descriptor == $descriptor(MonetaryList *)){
|
||||
PyList_Append(list, SWIG_NewPointerObj(data, $descriptor(gnc_monetary *), 0));
|
||||
}
|
||||
else if (GNC_IS_PRICE(data))
|
||||
PyList_Append(list, SWIG_NewPointerObj(data, SWIGTYPE_p_GNCPrice, 0));
|
||||
else if ($1_descriptor == $descriptor(MonetaryList *))
|
||||
PyList_Append(list, SWIG_NewPointerObj(data, $descriptor(gnc_monetary *), 0));
|
||||
else
|
||||
PyList_Append(list, SWIG_NewPointerObj(data, SWIGTYPE_p_void, 0));
|
||||
PyList_Append(list, SWIG_NewPointerObj(data, SWIGTYPE_p_void, 0));
|
||||
}
|
||||
$result = list;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user