mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Added PyMac_OutputSeen(), which acknowledges all current output in the stdio window, i.e. it acts like input has been read insofar as the keep-console-open option is interested.
This commit is contained in:
parent
f1a0a4be63
commit
8413b47ba7
3 changed files with 23 additions and 0 deletions
|
@ -129,6 +129,7 @@ int PyMac_setfiletype(char *, long, long); /* Set file creator and type */
|
||||||
/* from macmain.c: */
|
/* from macmain.c: */
|
||||||
void PyMac_Exit(int);
|
void PyMac_Exit(int);
|
||||||
void PyMac_InitApplication(void);
|
void PyMac_InitApplication(void);
|
||||||
|
void PyMac_OutputSeen(void);
|
||||||
#ifdef USE_MAC_APPLET_SUPPORT
|
#ifdef USE_MAC_APPLET_SUPPORT
|
||||||
void PyMac_InitApplet(void);
|
void PyMac_InitApplet(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -691,6 +691,18 @@ MacOS_KeepConsole(PyObject *self, PyObject *args)
|
||||||
return Py_None;
|
return Py_None;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static char OutputSeen_doc[] = "Call to reset the 'unseen output' flag for the keep-console-open option";
|
||||||
|
|
||||||
|
static PyObject *
|
||||||
|
MacOS_OutputSeen(PyObject *self, PyObject *args)
|
||||||
|
{
|
||||||
|
if (!PyArg_ParseTuple(args, ""))
|
||||||
|
return NULL;
|
||||||
|
PyMac_OutputSeen();
|
||||||
|
Py_INCREF(Py_None);
|
||||||
|
return Py_None;
|
||||||
|
}
|
||||||
|
|
||||||
static PyMethodDef MacOS_Methods[] = {
|
static PyMethodDef MacOS_Methods[] = {
|
||||||
#if !TARGET_API_MAC_CARBON
|
#if !TARGET_API_MAC_CARBON
|
||||||
{"AcceptHighLevelEvent", MacOS_AcceptHighLevelEvent, 1, accepthle_doc},
|
{"AcceptHighLevelEvent", MacOS_AcceptHighLevelEvent, 1, accepthle_doc},
|
||||||
|
@ -711,6 +723,7 @@ static PyMethodDef MacOS_Methods[] = {
|
||||||
{"MaxBlock", MacOS_MaxBlock, 1, MaxBlock_doc},
|
{"MaxBlock", MacOS_MaxBlock, 1, MaxBlock_doc},
|
||||||
{"CompactMem", MacOS_CompactMem, 1, CompactMem_doc},
|
{"CompactMem", MacOS_CompactMem, 1, CompactMem_doc},
|
||||||
{"KeepConsole", MacOS_KeepConsole, 1, KeepConsole_doc},
|
{"KeepConsole", MacOS_KeepConsole, 1, KeepConsole_doc},
|
||||||
|
{"OutputSeen", MacOS_OutputSeen, 1, OutputSeen_doc},
|
||||||
{NULL, NULL} /* Sentinel */
|
{NULL, NULL} /* Sentinel */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -538,6 +538,15 @@ Py_Main(argc, argv)
|
||||||
/*NOTREACHED*/
|
/*NOTREACHED*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
** Reset the "unseen output" flag
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
PyMac_OutputSeen()
|
||||||
|
{
|
||||||
|
gusisioux_state = GUSISIOUX_STATE_LASTREAD;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Terminate application
|
** Terminate application
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue