diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 2000-10-12 21:24:05 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 2000-10-12 21:24:05 (GMT) |
commit | b19c667d944fb89ac3f0cd98397294756b6f95ad (patch) | |
tree | 7f1a494ca92e65bbf883f6c3734a14ff979a6655 /Mac/Modules | |
parent | dc86f9ebf9cfb98d7323c37e63f70ee9472d5e82 (diff) | |
download | cpython-b19c667d944fb89ac3f0cd98397294756b6f95ad.zip cpython-b19c667d944fb89ac3f0cd98397294756b6f95ad.tar.gz cpython-b19c667d944fb89ac3f0cd98397294756b6f95ad.tar.bz2 |
Added a method KeepConsole so programs can override the Keep console open option.
Diffstat (limited to 'Mac/Modules')
-rw-r--r-- | Mac/Modules/macosmodule.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Mac/Modules/macosmodule.c b/Mac/Modules/macosmodule.c index ec52da4..339de1a 100644 --- a/Mac/Modules/macosmodule.c +++ b/Mac/Modules/macosmodule.c @@ -26,6 +26,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "Python.h" #include "macglue.h" +#include "pythonresources.h" #include <Windows.h> #include <Files.h> @@ -676,6 +677,20 @@ MacOS_CompactMem(PyObject *self, PyObject *args) return Py_BuildValue("l", rv); } +static char KeepConsole_doc[] = "(flag) Keep console open 0:never, 1:on output 2:on error, 3:always"; + +static PyObject * +MacOS_KeepConsole(PyObject *self, PyObject *args) +{ + int value; + + if (!PyArg_ParseTuple(args, "i", &value)) + return NULL; + PyMac_options.keep_console = value; + Py_INCREF(Py_None); + return Py_None; +} + static PyMethodDef MacOS_Methods[] = { #if !TARGET_API_MAC_CARBON {"AcceptHighLevelEvent", MacOS_AcceptHighLevelEvent, 1, accepthle_doc}, @@ -695,6 +710,7 @@ static PyMethodDef MacOS_Methods[] = { {"FreeMem", MacOS_FreeMem, 1, FreeMem_doc}, {"MaxBlock", MacOS_MaxBlock, 1, MaxBlock_doc}, {"CompactMem", MacOS_CompactMem, 1, CompactMem_doc}, + {"KeepConsole", MacOS_KeepConsole, 1, KeepConsole_doc}, {NULL, NULL} /* Sentinel */ }; |