[78562] trunk/dports/python/py26-ipython
macsforever2000 at macports.org
macsforever2000 at macports.org
Thu May 12 10:19:27 PDT 2011
Revision: 78562
http://trac.macports.org/changeset/78562
Author: macsforever2000 at macports.org
Date: 2011-05-12 10:19:26 -0700 (Thu, 12 May 2011)
Log Message:
-----------
curses fix. (#27251)
Modified Paths:
--------------
trunk/dports/python/py26-ipython/Portfile
Added Paths:
-----------
trunk/dports/python/py26-ipython/files/
trunk/dports/python/py26-ipython/files/genutils_curses.patch
Modified: trunk/dports/python/py26-ipython/Portfile
===================================================================
--- trunk/dports/python/py26-ipython/Portfile 2011-05-12 16:25:06 UTC (rev 78561)
+++ trunk/dports/python/py26-ipython/Portfile 2011-05-12 17:19:26 UTC (rev 78562)
@@ -7,7 +7,7 @@
name py26-ipython
set my_name ipython
version 0.10.1
-revision 1
+revision 2
categories python
platforms darwin
maintainers akitada openmaintainer
@@ -31,6 +31,9 @@
test.run no
+patchfiles genutils_curses.patch
+patch.dir ${worksrcpath}/IPython
+
post-destroot {
foreach f {ipython pycolor} {
ln -s ${python.prefix}/share/man/man1/${f}.1.gz ${destroot}${prefix}/share/man/man1/${f}${python.branch}.1.gz
Added: trunk/dports/python/py26-ipython/files/genutils_curses.patch
===================================================================
--- trunk/dports/python/py26-ipython/files/genutils_curses.patch (rev 0)
+++ trunk/dports/python/py26-ipython/files/genutils_curses.patch 2011-05-12 17:19:26 UTC (rev 78562)
@@ -0,0 +1,32 @@
+--- genutils.py~ 2010-07-26 00:33:01.000000000 -0600
++++ genutils.py 2010-11-10 11:54:45.000000000 -0700
+@@ -1668,9 +1668,29 @@
+ # unconditionally reset it every time. It's cheaper than making
+ # the checks.
+ term_flags = termios.tcgetattr(sys.stdout)
++
++ # Curses modifies the stdout buffer size by default, which messes
++ # up Python's normal stdout buffering. This would manifest itself
++ # to IPython users as delayed printing on stdout after having used
++ # the pager.
++ #
++ # We can prevent this by manually setting the NCURSES_NO_SETBUF
++ # environment variable. For more details, see:
++ # http://bugs.python.org/issue10144
++ NCURSES_NO_SETBUF = os.environ.get('NCURSES_NO_SETBUF', None)
++ os.environ['NCURSES_NO_SETBUF'] = ''
++
++ # Proceed with curses initialization
+ scr = curses.initscr()
+ screen_lines_real,screen_cols = scr.getmaxyx()
+ curses.endwin()
++
++ # Restore environment
++ if NCURSES_NO_SETBUF is None:
++ del os.environ['NCURSES_NO_SETBUF']
++ else:
++ os.environ['NCURSES_NO_SETBUF'] = NCURSES_NO_SETBUF
++
+ # Restore terminal state in case endwin() didn't.
+ termios.tcsetattr(sys.stdout,termios.TCSANOW,term_flags)
+ # Now we have what we needed: the screen size in rows/columns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110512/eece646b/attachment.html>
More information about the macports-changes
mailing list