Add wantwrite().
authorfredrik <fredrik@959494ce-11ee-0310-bf91-de5d638817bd>
Wed, 22 Nov 2006 18:50:47 +0000 (18:50 +0000)
committerfredrik <fredrik@959494ce-11ee-0310-bf91-de5d638817bd>
Wed, 22 Nov 2006 18:50:47 +0000 (18:50 +0000)
git-svn-id: svn+ssh://svn.dolda2000.com/srv/svn/repos/src/doldaconnect@767 959494ce-11ee-0310-bf91-de5d638817bd

lib/python/dolmod.c

index a015b57..adf07a2 100644 (file)
@@ -382,6 +382,14 @@ static PyObject *mod_lexsexpr(PyObject *self, PyObject *args)
     return(ret);
 }
 
+static PyObject *mod_wantwrite(PyObject *self)
+{
+    if(dc_wantwrite())
+       Py_RETURN_TRUE;
+    else
+       Py_RETURN_FALSE;
+}
+
 static PyMethodDef methods[] = {
     {"connect", mod_connect, METH_VARARGS,
      "Connect to a Dolda Connect server"},
@@ -399,6 +407,8 @@ static PyMethodDef methods[] = {
      "Perform an asynchronous login procedure"},
     {"lexsexpr", mod_lexsexpr, METH_VARARGS,
      "Use a standard algorithm to lex a search expression"},
+    {"wantwrite", (PyCFunction)mod_wantwrite, METH_NOARGS,
+     "Return a boolean indicating whether there is output to be fed to the server"},
     {NULL, NULL, 0, NULL}
 };