Index: PCbuild/_curses_panel.vcproj =================================================================== --- PCbuild/_curses_panel.vcproj (revision 0) +++ PCbuild/_curses_panel.vcproj (revision 0) @@ -0,0 +1,546 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: PCbuild/_curses.vcproj =================================================================== --- PCbuild/_curses.vcproj (revision 0) +++ PCbuild/_curses.vcproj (revision 0) @@ -0,0 +1,554 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: PCbuild/pcbuild.sln =================================================================== --- PCbuild/pcbuild.sln (revision 68937) +++ PCbuild/pcbuild.sln (working copy) @@ -1,5 +1,5 @@ Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 +# Visual C++ Express 2008 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "python", "python.vcproj", "{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}" ProjectSection(ProjectDependencies) = postProject {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} @@ -132,6 +132,16 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "kill_python", "kill_python.vcproj", "{6DE10744-E396-40A5-B4E2-1B69AA7C8D31}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_curses", "_curses.vcproj", "{551D15AA-89FF-4096-B355-B91A52217D3E}" + ProjectSection(ProjectDependencies) = postProject + {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_curses_panel", "_curses_panel.vcproj", "{551D15AA-89FF-4096-B355-B91A52217D3F}" + ProjectSection(ProjectDependencies) = postProject + {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -552,6 +562,30 @@ {6DE10744-E396-40A5-B4E2-1B69AA7C8D31}.Release|Win32.Build.0 = Release|Win32 {6DE10744-E396-40A5-B4E2-1B69AA7C8D31}.Release|x64.ActiveCfg = Release|x64 {6DE10744-E396-40A5-B4E2-1B69AA7C8D31}.Release|x64.Build.0 = Release|x64 + {551D15AA-89FF-4096-B355-B91A52217D3E}.Debug|Win32.ActiveCfg = Debug|Win32 + {551D15AA-89FF-4096-B355-B91A52217D3E}.Debug|Win32.Build.0 = Debug|Win32 + {551D15AA-89FF-4096-B355-B91A52217D3E}.Debug|x64.ActiveCfg = Debug|Win32 + {551D15AA-89FF-4096-B355-B91A52217D3E}.PGInstrument|Win32.ActiveCfg = Release|Win32 + {551D15AA-89FF-4096-B355-B91A52217D3E}.PGInstrument|Win32.Build.0 = Release|Win32 + {551D15AA-89FF-4096-B355-B91A52217D3E}.PGInstrument|x64.ActiveCfg = Release|Win32 + {551D15AA-89FF-4096-B355-B91A52217D3E}.PGUpdate|Win32.ActiveCfg = Release|Win32 + {551D15AA-89FF-4096-B355-B91A52217D3E}.PGUpdate|Win32.Build.0 = Release|Win32 + {551D15AA-89FF-4096-B355-B91A52217D3E}.PGUpdate|x64.ActiveCfg = Release|Win32 + {551D15AA-89FF-4096-B355-B91A52217D3E}.Release|Win32.ActiveCfg = Release|Win32 + {551D15AA-89FF-4096-B355-B91A52217D3E}.Release|Win32.Build.0 = Release|Win32 + {551D15AA-89FF-4096-B355-B91A52217D3E}.Release|x64.ActiveCfg = Release|Win32 + {551D15AA-89FF-4096-B355-B91A52217D3F}.Debug|Win32.ActiveCfg = Debug|Win32 + {551D15AA-89FF-4096-B355-B91A52217D3F}.Debug|Win32.Build.0 = Debug|Win32 + {551D15AA-89FF-4096-B355-B91A52217D3F}.Debug|x64.ActiveCfg = Debug|Win32 + {551D15AA-89FF-4096-B355-B91A52217D3F}.PGInstrument|Win32.ActiveCfg = Release|Win32 + {551D15AA-89FF-4096-B355-B91A52217D3F}.PGInstrument|Win32.Build.0 = Release|Win32 + {551D15AA-89FF-4096-B355-B91A52217D3F}.PGInstrument|x64.ActiveCfg = Release|Win32 + {551D15AA-89FF-4096-B355-B91A52217D3F}.PGUpdate|Win32.ActiveCfg = Release|Win32 + {551D15AA-89FF-4096-B355-B91A52217D3F}.PGUpdate|Win32.Build.0 = Release|Win32 + {551D15AA-89FF-4096-B355-B91A52217D3F}.PGUpdate|x64.ActiveCfg = Release|Win32 + {551D15AA-89FF-4096-B355-B91A52217D3F}.Release|Win32.ActiveCfg = Release|Win32 + {551D15AA-89FF-4096-B355-B91A52217D3F}.Release|Win32.Build.0 = Release|Win32 + {551D15AA-89FF-4096-B355-B91A52217D3F}.Release|x64.ActiveCfg = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE Index: PCbuild/readme.txt =================================================================== --- PCbuild/readme.txt (revision 68937) +++ PCbuild/readme.txt (working copy) @@ -182,7 +182,21 @@ build_ssl.py/MSVC isn't clever enough to clean OpenSSL - you must do this by hand. +_curses and _curses_panel + Python wrapper for the pdcurses library. Homepage + http://pdcurses.sourceforge.net/ + Download the source from the pdcurses homepage and extract it into a + a directory named pdcurses in the directory above the Python sources + (..\..\pdcurses relative to the PCbuild directory). + + A pre-build event should compile the pdcurses sources for all + platforms and configurations. The pre-build event should also make + sure that the different platform and configuration combinations wind + up in different output directories, so you should be able to rebuild + without cleaning first (although incremental builds of pdcurses are + not possible). + The subprojects above wrap external projects Python doesn't control, and as such, a little more work is required in order to download the relevant source files for each project before they can be built. The buildbots do this each Index: Lib/test/regrtest.py =================================================================== --- Lib/test/regrtest.py (revision 68937) +++ Lib/test/regrtest.py (working copy) @@ -781,7 +781,6 @@ test_bsddb3 test_commands test_crypt - test_curses test_dbm test_dl test_fcntl Index: Lib/test/test_curses.py =================================================================== --- Lib/test/test_curses.py (revision 68937) +++ Lib/test/test_curses.py (working copy) @@ -21,7 +21,7 @@ # XXX: if newterm was supported we could use it instead of initscr and not exit term = os.environ.get('TERM') -if not term or term == 'unknown': +if sys.platform != 'win32' and not term or term == 'unknown': raise TestSkipped, "$TERM=%r, calling initscr() may cause exit" % term if sys.platform == "cygwin": @@ -165,9 +165,13 @@ curses.echo() ; curses.echo(1) f = tempfile.TemporaryFile() - stdscr.putwin(f) + if sys.platform == 'win32': + realf = f.file + else: + realf = f + stdscr.putwin(realf) f.seek(0) - curses.getwin(f) + curses.getwin(realf) f.close() curses.halfdelay(1) @@ -178,14 +182,16 @@ win = curses.newwin(5,5) win = curses.newwin(5,5, 1,1) curses.nl() ; curses.nl(1) - curses.putp('abc') + if sys.platform != 'win32': + curses.putp('abc') curses.qiflush() curses.raw() ; curses.raw(1) curses.setsyx(5,5) curses.tigetflag('hc') curses.tigetnum('co') curses.tigetstr('cr') - curses.tparm('cr') + if sys.platform != 'win32': + curses.tparm('cr') curses.typeahead(sys.__stdin__.fileno()) curses.unctrl('a') curses.ungetch('a') Index: Modules/_cursesmodule.c =================================================================== --- Modules/_cursesmodule.c (revision 68937) +++ Modules/_cursesmodule.c (working copy) @@ -119,10 +119,14 @@ #defines many common symbols (such as "lines") which breaks the curses module in other ways. So the code will just specify explicit prototypes here. */ +#ifdef _WIN32 +#include +#else extern int setupterm(char *,int,int *); #ifdef __sgi #include #endif +#endif #if !defined(HAVE_NCURSES_H) && (defined(sgi) || defined(__sun) || defined(SCO5)) #define STRICT_SYSV_CURSES /* Don't use ncurses extensions */ @@ -2007,7 +2011,9 @@ PyCurses_setupterm(PyObject* self, PyObject *args, PyObject* keywds) { int fd = -1; +#ifndef _WIN32 int err; +#endif char* termstr = NULL; static char *kwlist[] = {"term", "fd", NULL}; @@ -2036,6 +2042,7 @@ } } +#ifndef _WIN32 if (setupterm(termstr,fd,&err) == ERR) { char* s = "setupterm: unknown error"; @@ -2048,6 +2055,7 @@ PyErr_SetString(PyCursesError,s); return NULL; } +#endif initialised_setupterm = TRUE;