From 61057e7c818ea08cf58e6bb69eab1f3a2e138bd4 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Sat, 30 Mar 2013 20:28:01 -0400 Subject: [PATCH] Record.rtype --- devsupApp/src/dbrec.c | 8 ++++++++ python/devsup/_nullapi.py | 3 +++ 2 files changed, 11 insertions(+) diff --git a/devsupApp/src/dbrec.c b/devsupApp/src/dbrec.c index f7821b5..ec84f05 100644 --- a/devsupApp/src/dbrec.c +++ b/devsupApp/src/dbrec.c @@ -73,6 +73,12 @@ static PyObject* pyRecord_name(pyRecord *self) return PyString_FromString(prec->name); } +static PyObject* pyRecord_rtype(pyRecord *self) +{ + dbCommon *prec=self->entry.precnode->precord; + return PyString_FromString(prec->rdes->name); +} + static PyObject* pyRecord_info(pyRecord *self, PyObject *args) { const char *name; @@ -233,6 +239,8 @@ static PyObject *pyRecord_asyncFinish(pyRecord *self, PyObject *args, PyObject * static PyMethodDef pyRecord_methods[] = { {"name", (PyCFunction)pyRecord_name, METH_NOARGS, "Return record name string"}, + {"rtype", (PyCFunction)pyRecord_rtype, METH_NOARGS, + "Return record type name string"}, {"isPyRecord", (PyCFunction)pyRecord_ispyrec, METH_NOARGS, "Is this record using Python Device."}, {"info", (PyCFunction)pyRecord_info, METH_VARARGS, diff --git a/python/devsup/_nullapi.py b/python/devsup/_nullapi.py index 49ef52e..052d451 100644 --- a/python/devsup/_nullapi.py +++ b/python/devsup/_nullapi.py @@ -17,6 +17,9 @@ class Record(object): def name(self): """Record name """ + def rtype(self): + """Record type + """ def isPyRecord(self): """Is this record using Python Device. """