Skip to content

Commit

Permalink
Add "isatty" function to StdOutRedirect. Needed by some logging frame…
Browse files Browse the repository at this point in the history
…work
  • Loading branch information
jcfr committed Nov 8, 2012
1 parent 3c84463 commit 7132dba
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/PythonQtStdOut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,21 @@ static PyObject *PythonQtStdOutRedirect_flush(PyObject * /*self*/, PyObject * /*
return Py_BuildValue("");
}


static PyObject *PythonQtStdOutRedirect_isatty(PyObject * /*self*/, PyObject * /*args*/)
{
long res = 0;
return PyBool_FromLong(res);
}

static PyMethodDef PythonQtStdOutRedirect_methods[] = {
{"write", (PyCFunction)PythonQtStdOutRedirect_write, METH_VARARGS,
"redirect the writing to a callback"},
{"flush", (PyCFunction)PythonQtStdOutRedirect_flush, METH_VARARGS,
"flush the output, currently not implemented but needed for logging framework"
},
{"isatty", (PyCFunction)PythonQtStdOutRedirect_isatty, METH_NOARGS,
"return False since this object is not a tty-like device. Needed for logging framework"
},
{NULL, NULL, 0 , NULL} /* sentinel */
};

Expand Down

0 comments on commit 7132dba

Please sign in to comment.