aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/py/source/main.cpp
diff options
context:
space:
mode:
authorThomas Grill <xovo@users.sourceforge.net>2004-01-07 03:38:25 +0000
committerThomas Grill <xovo@users.sourceforge.net>2004-01-07 03:38:25 +0000
commitd563db671892f0719195aeeb89cac6ee3fe7c69e (patch)
tree2724d6e05233b1b7c5e475938553b1b907c2cbf6 /externals/grill/py/source/main.cpp
parent58e4d7bbbdebe1ee96b318873391b634ca3b8a8f (diff)
""
svn path=/trunk/; revision=1251
Diffstat (limited to 'externals/grill/py/source/main.cpp')
-rw-r--r--externals/grill/py/source/main.cpp21
1 files changed, 13 insertions, 8 deletions
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) {