diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 2001-02-11 01:08:04 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 2001-02-11 01:08:04 (GMT) |
commit | 8a38714ba05a3734f812bb1bbebdc527732a22bc (patch) | |
tree | 90f53048b00a22476549e1ef3c38470fca66e3c7 /Mac/Python/macmain.c | |
parent | 6a9aec47b72cf42bed0f845e751eb243f85b43d6 (diff) | |
download | cpython-8a38714ba05a3734f812bb1bbebdc527732a22bc.zip cpython-8a38714ba05a3734f812bb1bbebdc527732a22bc.tar.gz cpython-8a38714ba05a3734f812bb1bbebdc527732a22bc.tar.bz2 |
Bit the bullet and added a private GUSISIOUX for Python. This makes the delayconsole and keepopen code neater. Also tells Sioux to behave better with events, and handles cmd-. during print better. The pythonpreferences have also changed due to this.
Diffstat (limited to 'Mac/Python/macmain.c')
-rw-r--r-- | Mac/Python/macmain.c | 42 |
1 files changed, 30 insertions, 12 deletions
diff --git a/Mac/Python/macmain.c b/Mac/Python/macmain.c index 8dfbdaf..09d8648 100644 --- a/Mac/Python/macmain.c +++ b/Mac/Python/macmain.c @@ -53,9 +53,9 @@ extern int ccommand(char ***); #ifdef USE_MAC_SHARED_LIBRARY extern PyMac_AddLibResources(void); #endif -#ifdef USE_GUSI -#include "GUSISIOUX.h" -#endif +//#ifdef USE_GUSI +//#include "GUSISIOUX.h" +//#endif #define STARTUP "PythonStartup" @@ -71,6 +71,14 @@ short PyMac_AppRefNum; /* RefNum of application resource fork */ static char **orig_argv; static int orig_argc; +/* A flag which remembers whether the user has acknowledged all the console +** output (by typing something) +*/ +#define STATE_UNKNOWN 0 +#define STATE_LASTREAD 1 +#define STATE_LASTWRITE 2 +int console_output_state = STATE_UNKNOWN; + PyMac_PrefRecord PyMac_options; static void Py_Main(int, char **); /* Forward */ @@ -544,10 +552,18 @@ Py_Main(argc, argv) void PyMac_OutputSeen() { -#ifdef GUSISIOUX_STATE_UNKNOWN - gusisioux_state = GUSISIOUX_STATE_LASTREAD; -#endif + console_output_state = STATE_LASTREAD; +} + +/* +** Set the "unseen output" flag +*/ +void +PyMac_OutputNotSeen() +{ + console_output_state = STATE_LASTWRITE; } + /* ** Terminate application @@ -569,15 +585,11 @@ PyMac_Exit(status) keep = 0; break; case POPT_KEEPCONSOLE_OUTPUT: -#ifdef GUSISIOUX_STATE_UNKNOWN - if (gusisioux_state == GUSISIOUX_STATE_LASTWRITE || - gusisioux_state == GUSISIOUX_STATE_UNKNOWN ) + if (console_output_state == STATE_LASTWRITE || + console_output_state == STATE_UNKNOWN ) keep = 1; else keep = 0; -#else - keep = 1; -#endif break; case POPT_KEEPCONSOLE_ERROR: keep = (status != 0); @@ -636,3 +648,9 @@ Py_GetExecPrefix() { return PyMac_GetPythonDir(); } + +int +PyMac_GetDelayConsoleFlag() +{ + return (int)PyMac_options.delayconsole; +}
\ No newline at end of file |