|
msg66920 - (view) |
Author: anatoly techtonik (techtonik) |
Date: 2008-05-16 06:38 |
Make curses available on Windows by using PDCurses library. Alternative
patch for issue 1005895 using current trunk.
Attached .bat file is used to compile it under MinGW, but I'd be glad to
know how to integrate the patch into Python build system.
PDCurses includes support for mouse functions compatible with ncurses,
but to turn it on if requires to define NCURSES_MOUSE_VERSION to 2
before <curses.h> is included. I am not familiar with configure.* stuff,
so I've just pasted required definitions into _cursesmodule.c
With attached .bat file it works by external definition.
Some functions, such as initterm are not available on Windows platform
and were defined out.
I hope that curses module will be included in next Python 2.6
|
|
msg67288 - (view) |
Author: Martin v. Löwis (loewis) *  |
Date: 2008-05-24 09:51 |
The patch, in its current form, is incomplete. Can you please provide:
a) a VS 2008 project file, which builds both the curses module and the
pdcurses library, fetching the sources for that from ../../pdcurses (or
some such); the project file should be structured similar to all the
other project files in PCbuild
b) a patch to PCbuild/readme.txt, with instructions on how to build the
extension
|
|
msg80554 - (view) |
Author: Zach Hirsch (zhirsch) |
Date: 2009-01-26 00:49 |
Here's a patch against the head of trunk that adds vcproj files for
_curses and _curses_panel, modifies (slightly) the test suite and
_cursesmodule.c (again, slightly) to get Python to work with pdcurses on
windows. I also added a blurb to PCbuild\readme.txt.
With this, test_curses.py passes and I'm able to run all the curses
demos that come with Python's source.
|
|
msg82781 - (view) |
Author: A.M. Kuchling (akuchling) *  |
Date: 2009-02-26 22:22 |
I can't say anything about the Windows build aspects. Some observations
about the curses/test_curses changes:
* test_curses: I'd be happier to see the 'if' statement as sys.platform
!= 'win32' and (not term or term == 'unknown') -- easier to read.
* test_curses: does putp() make PDCurses crash, or is it not available?
If the latter, I'd prefer to see 'if hasattr(curses, "putp"): <putp
test>'. Same for the tparm() test.
* Given that you include term.h and IRIX included term.h, I wonder if we
should make _cursesmodule.c include term.h on all platforms that have
it, and then fix the resulting breakage claimed by the comment (if any).
* Is setupterm() a no-up on Windows? Maybe the function just shouldn't
be defined on Windows, then, so that user code can check for the
function's existence.
|
|
msg83365 - (view) |
Author: Zach Hirsch (zhirsch) |
Date: 2009-03-09 09:56 |
> * test_curses: I'd be happier to see the 'if' statement as sys.platform
> != 'win32' and (not term or term == 'unknown') -- easier to read.
OK, fixed.
> * test_curses: does putp() make PDCurses crash, or is it not available?
> If the latter, I'd prefer to see 'if hasattr(curses, "putp"): <putp
test>'. Same for the tparm() test.
They're stubs in pdcurses that always return an error. I'm not sure
which is better in this case -- make them available through the curses
module but always raise an exception on Windows, or make them
unavailable and have it be an AttributeError if something tries to call
them on Windows.
> * Given that you include term.h and IRIX included term.h, I wonder if we
> should make _cursesmodule.c include term.h on all platforms that have
it, and then fix the resulting breakage claimed by the comment (if any).
Yea, it was actually really easy to resolve the conflicts. I've done
that, and tested the result on Linux and OS X 10.4.
> * Is setupterm() a no-up on Windows? Maybe the function just shouldn't
> be defined on Windows, then, so that user code can check for the
function's existence.
PDCurses does the same thing for setupterm as it does for putp/tparm
(and a number of other unsupported functions) -- always returns an
error. However, the curses module keeps track of whether it's been
initialized based on whether setupterm has been called, so I think it
makes sense to keep setupterm available but not call PDCurses's
setupterm function on Windows.
|
|
msg94309 - (view) |
Author: (jmb) |
Date: 2009-10-21 07:24 |
I've built a package for python 2.6 using a slightly modified version of
this patch. I've uploaded it here: http://jeberger.free.fr/python/
I'm attaching my version of the patch here. I had to make two
modifications for it to work:
- Change all references to _ISPAD into _PAD (obviously this needs to be
done better since what I did will break the ncurses compatibility);
- Change "(long) (n << 8)" into "COLOR_PAIR (n)". This should be
compatible between curses implementations.
With this package, I've been able to run the Mercurial "crecord"
extension on Windows.
|
|
msg114011 - (view) |
Author: (ipatrol) |
Date: 2010-08-15 21:26 |
Any progress yat?
|
|
msg114013 - (view) |
Author: Martin v. Löwis (loewis) *  |
Date: 2010-08-15 21:30 |
It can't go into 2.x anymore.
|
|
msg114370 - (view) |
Author: Mark Lawrence (BreamoreBoy) |
Date: 2010-08-19 15:54 |
Brian or Tim any interest in this?
|
|
msg114399 - (view) |
Author: Tim Golden (tim.golden)  |
Date: 2010-08-19 18:46 |
I'll pick it up for the moment to shepherd it along because I'm reasonably keen to see a Windows curses in the stdlib. However, I'm no expert in curses and I don't promise to do anything immediate with it.
|
|
msg114740 - (view) |
Author: Roumen Petrov (rpetrov) |
Date: 2010-08-23 21:48 |
-1 for PDCurses
|
|
msg114770 - (view) |
Author: Tim Golden (tim.golden)  |
Date: 2010-08-24 07:27 |
I have no strong opinion, Roumen, (and no experience with the package)
but why -1 from you?
|
|
msg114778 - (view) |
Author: Roumen Petrov (rpetrov) |
Date: 2010-08-24 11:42 |
Recent ncurses pass python tests with only one small update (part of patch to issue 3871):
=====================================
--- ./Lib/test/test_curses.py.MINGW 2010-08-09 00:03:48.000000000 +0300
+++ ./Lib/test/test_curses.py 2010-08-09 00:05:38.000000000 +0300
@@ -167,11 +167,16 @@
curses.delay_output(1)
curses.echo() ; curses.echo(1)
- f = tempfile.TemporaryFile()
+ fx = tempfile.TemporaryFile()
+ # cf tempfile.py TemporaryFile vs NamedTemporaryFile
+ if os.name != 'posix' or os.sys.platform == 'cygwin':
+ f = fx.file
+ else:
+ f = fx
stdscr.putwin(f)
f.seek(0)
curses.getwin(f)
- f.close()
+ fx.close()
curses.halfdelay(1)
curses.intrflush(1)
=====================================
About TERM environment variable - I don't have time to test ncurses if is not set.
Also PDCurses is not updated since 2008.
|
|
msg116224 - (view) |
Author: anatoly techtonik (techtonik) |
Date: 2010-09-12 18:43 |
PDCurses is not updated, because it is considered stable and mature library that has been tested on Windows platform by many roguelikes. I doubt that ncurses hackers care about Windows compatibility more than just to make it run.
|
|
msg126887 - (view) |
Author: Prasun Ratn (Prasun Ratn) |
Date: 2011-01-23 11:49 |
What is the status of this bug?
I tried to build the svn trunk with patches provided by zhirsch but I had problems applying the patches. I went ahead and made a new patch which is pretty similar to the earlier patch (mentioned above). The one change is that I implemented mkstemp() so putwin() and getwin() work.
|
|
msg128191 - (view) |
Author: Christoph Gohlke (cgohlke) |
Date: 2011-02-08 21:47 |
Curses binaries for Python 2.5, 2.6, 2.7, 3.1 and 3.2, win32 and win-amd64, are available at <http://www.lfd.uci.edu/~gohlke/pythonlibs/#curses>.
|
|
msg185746 - (view) |
Author: Mark Lawrence (BreamoreBoy) |
Date: 2013-04-01 17:21 |
@Christoph Gohlke any chance of providing a build for 3.3?
|
|
| Date |
User |
Action |
Args |
| 2013-04-01 17:21:39 | BreamoreBoy | set | messages:
+ msg185746 |
| 2011-02-08 21:47:32 | cgohlke | set | nosy:
loewis, akuchling, pmoore, techtonik, tim.golden, rpetrov, zhirsch, Trundle, cgohlke, jmb, ipatrol, BreamoreBoy, Prasun Ratn messages:
+ msg128191 |
| 2011-01-23 11:50:57 | Prasun Ratn | set | files:
+ pdcurses.patch nosy:
loewis, akuchling, pmoore, techtonik, tim.golden, rpetrov, zhirsch, Trundle, cgohlke, jmb, ipatrol, BreamoreBoy, Prasun Ratn |
| 2011-01-23 11:49:11 | Prasun Ratn | set | files:
+ pdcurses-changes.patch nosy:
+ Prasun Ratn messages:
+ msg126887
|
| 2010-12-30 22:40:27 | georg.brandl | set | nosy:
loewis, akuchling, pmoore, techtonik, tim.golden, rpetrov, zhirsch, Trundle, cgohlke, jmb, ipatrol, BreamoreBoy versions:
+ Python 3.3, - Python 3.2 |
| 2010-10-09 06:58:35 | cgohlke | set | nosy:
+ cgohlke
|
| 2010-09-12 22:02:27 | brian.curtin | set | nosy:
- brian.curtin
|
| 2010-09-12 18:43:42 | techtonik | set | messages:
+ msg116224 |
| 2010-08-24 11:42:15 | rpetrov | set | messages:
+ msg114778 |
| 2010-08-24 07:27:29 | tim.golden | set | messages:
+ msg114770 |
| 2010-08-24 01:13:38 | Trundle | set | nosy:
+ Trundle
|
| 2010-08-23 21:48:31 | rpetrov | set | nosy:
+ rpetrov messages:
+ msg114740
|
| 2010-08-19 18:46:23 | tim.golden | set | assignee: tim.golden messages:
+ msg114399 |
| 2010-08-19 15:54:37 | BreamoreBoy | set | nosy:
+ tim.golden, brian.curtin, BreamoreBoy
messages:
+ msg114370 stage: patch review |
| 2010-08-15 21:30:57 | loewis | set | messages:
+ msg114013 versions:
+ Python 3.2, - Python 2.6, Python 2.7 |
| 2010-08-15 21:26:59 | ipatrol | set | versions:
+ Python 2.7 nosy:
+ ipatrol
messages:
+ msg114011
components:
+ Windows type: enhancement |
| 2009-10-21 07:24:18 | jmb | set | files:
+ python-pdcurses-3.patch
messages:
+ msg94309 |
| 2009-10-19 13:02:36 | jmb | set | nosy:
+ jmb
|
| 2009-03-23 20:55:30 | pmoore | set | nosy:
+ pmoore
|
| 2009-03-09 09:56:53 | zhirsch | set | files:
+ python-pdcurses-2.patch
messages:
+ msg83365 |
| 2009-02-26 22:23:00 | akuchling | set | messages:
+ msg82781 |
| 2009-02-26 22:12:14 | akuchling | set | nosy:
+ akuchling |
| 2009-01-26 00:49:37 | zhirsch | set | files:
+ python-pdcurses.patch nosy:
+ zhirsch messages:
+ msg80554 keywords:
+ patch |
| 2008-05-24 09:51:38 | loewis | set | nosy:
+ loewis messages:
+ msg67288 |
| 2008-05-16 06:39:47 | techtonik | set | files:
+ curses_win_compile.bat |
| 2008-05-16 06:38:26 | techtonik | create | |