Lose unnecessary next() methods
authorPanu Matilainen <pmatilai@redhat.com>
Tue, 22 Sep 2009 17:50:41 +0000 (20:50 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Tue, 22 Sep 2009 17:50:41 +0000 (20:50 +0300)
- python adds next() methods for objects supporting iterators

python/rpmds-py.c
python/rpmfi-py.c
python/rpmmi-py.c
python/rpmts-py.c

index d13fe28..67af3fb 100644 (file)
@@ -227,19 +227,6 @@ rpmds_iternext(rpmdsObject * s)
 }
 
 static PyObject *
-rpmds_Next(rpmdsObject * s)
-{
-    PyObject * result;
-
-    result = rpmds_iternext(s);
-
-    if (result == NULL) {
-       Py_RETURN_NONE;
-    }
-    return result;
-}
-
-static PyObject *
 rpmds_SetNoPromote(rpmdsObject * s, PyObject * args, PyObject * kwds)
 {
     int nopromote;
@@ -386,9 +373,6 @@ static struct PyMethodDef rpmds_methods[] = {
        "ds.Color -> Color      - Return current Color.\n" },
  {"Refs",      (PyCFunction)rpmds_Refs,        METH_NOARGS,
        "ds.Refs -> Refs        - Return current Refs.\n" },
- {"next",      (PyCFunction)rpmds_Next,        METH_NOARGS,
-"ds.next() -> (N, EVR, Flags)\n\
-- Retrieve next dependency triple.\n" },
  {"SetNoPromote",(PyCFunction)rpmds_SetNoPromote, METH_VARARGS|METH_KEYWORDS,
        NULL},
  {"Notify",    (PyCFunction)rpmds_Notify,      METH_VARARGS|METH_KEYWORDS,
index b48c980..cfc9892 100644 (file)
@@ -221,34 +221,6 @@ rpmfi_iternext(rpmfiObject * s)
     return result;
 }
 
-static PyObject *
-rpmfi_Next(rpmfiObject * s)
-{
-    PyObject * result = NULL;
-
-    result = rpmfi_iternext(s);
-
-    if (result == NULL) {
-       Py_RETURN_NONE;
-    }
-
-    return result;
-}
-
-#ifdef NOTYET
-static PyObject *
-rpmfi_NextD(rpmfiObject * s)
-{
-    Py_RETURN_NONE;
-}
-
-static PyObject *
-rpmfi_InitD(rpmfiObject * s)
-{
-    Py_RETURN_NONE;
-}
-#endif
-
 static struct PyMethodDef rpmfi_methods[] = {
  {"Debug",     (PyCFunction)rpmfi_Debug,       METH_VARARGS|METH_KEYWORDS,
        NULL},
@@ -294,15 +266,6 @@ static struct PyMethodDef rpmfi_methods[] = {
        NULL},
  {"FClass",    (PyCFunction)rpmfi_FClass,      METH_NOARGS,
        NULL},
- {"next",      (PyCFunction)rpmfi_Next,        METH_NOARGS,
-"fi.next() -> (FN, FSize, FMode, FMtime, FFlags, FRdev, FInode, FNlink, FState, VFlags, FUser, FGroup, FDigest))\n\
-- Retrieve next file info tuple.\n" },
-#ifdef NOTYET
- {"NextD",     (PyCFunction)rpmfi_NextD,       METH_NOARGS,
-       NULL},
- {"InitD",     (PyCFunction)rpmfi_InitD,       METH_NOARGS,
-       NULL},
-#endif
  {NULL,                NULL}           /* sentinel */
 };
 
index ea9941f..fad151d 100644 (file)
@@ -90,21 +90,6 @@ rpmmi_iternext(rpmmiObject * s)
 /**
  */
 static PyObject *
-rpmmi_Next(rpmmiObject * s)
-{
-    PyObject * result;
-
-    result = rpmmi_iternext(s);
-
-    if (result == NULL) {
-       Py_RETURN_NONE;
-    }
-    return result;
-}
-
-/**
- */
-static PyObject *
 rpmmi_Instance(rpmmiObject * s)
 {
     int rc = 0;
@@ -154,9 +139,6 @@ rpmmi_Pattern(rpmmiObject * s, PyObject * args, PyObject * kwds)
 /** \ingroup py_c
  */
 static struct PyMethodDef rpmmi_methods[] = {
-    {"next",       (PyCFunction) rpmmi_Next,           METH_NOARGS,
-"mi.next() -> hdr\n\
-- Retrieve next header that matches. Iterate directly in python if possible.\n" },
     {"instance",    (PyCFunction) rpmmi_Instance,      METH_NOARGS,
        NULL },
     {"count",       (PyCFunction) rpmmi_Count,         METH_NOARGS,
index e250292..847c3f7 100644 (file)
@@ -1001,26 +1001,6 @@ fprintf(stderr, "*** rpmts_iternext(%p) ts %p tsi %p %d\n", s, s->ts, s->tsi, s-
 }
 
 /**
- * @todo Add TR_ADDED filter to iterator.
- */
-static PyObject *
-rpmts_Next(rpmtsObject * s)
-{
-    PyObject * result;
-
-if (_rpmts_debug)
-fprintf(stderr, "*** rpmts_Next(%p) ts %p\n", s, s->ts);
-
-    result = rpmts_iternext(s);
-
-    if (result == NULL) {
-       Py_RETURN_NONE;
-    }
-
-    return result;
-}
-
-/**
  */
 static specObject *
 spec_Parse(rpmtsObject * s, PyObject * args, PyObject * kwds)
@@ -1187,9 +1167,6 @@ static struct PyMethodDef rpmts_methods[] = {
  {"dbMatch",   (PyCFunction) rpmts_Match,      METH_VARARGS|METH_KEYWORDS,
 "ts.dbMatch([TagN, [key, [len]]]) -> mi\n\
 - Create a match iterator for the default transaction rpmdb.\n" },
- {"next",              (PyCFunction)rpmts_Next,        METH_NOARGS,
-"ts.next() -> te\n\
-- Retrieve next transaction set element.\n" },
     {NULL,             NULL}           /* sentinel */
 };