From d563db671892f0719195aeeb89cac6ee3fe7c69e Mon Sep 17 00:00:00 2001 From: Thomas Grill Date: Wed, 7 Jan 2004 03:38:25 +0000 Subject: "" svn path=/trunk/; revision=1251 --- externals/grill/py/source/main.cpp | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'externals/grill/py/source/main.cpp') diff --git a/externals/grill/py/source/main.cpp b/externals/grill/py/source/main.cpp index 84698211..72ccaa82 100644 --- a/externals/grill/py/source/main.cpp +++ b/externals/grill/py/source/main.cpp @@ -128,21 +128,18 @@ py::~py() } -void py::m__dir(PyObject *obj) +void py::GetDir(PyObject *obj,AtomList &lst) { if(obj) { PY_LOCK PyObject *pvar = PyObject_Dir(obj); - if(pvar == NULL) { + if(!pvar) PyErr_Print(); // no method found - } else { - AtomList *lst = GetPyArgs(pvar); - if(lst) { - // dump dir to attribute outlet - ToOutAnything(GetOutAttr(),thisTag(),lst->Count(),lst->Atoms()); - delete lst; + AtomList *l = GetPyArgs(pvar); + if(l) { + lst = *l; delete l; } else post("%s - %s: List could not be created",thisName(),GetString(thisTag())); @@ -153,6 +150,14 @@ void py::m__dir(PyObject *obj) } } +void py::m__dir(PyObject *obj) +{ + AtomList lst; + GetDir(obj,lst); + // dump dir to attribute outlet + ToOutAnything(GetOutAttr(),thisTag(),lst.Count(),lst.Atoms()); +} + V py::m__doc(PyObject *obj) { if(obj) { -- cgit v1.2.1