[Zope3-checkins] CVS: Zope3 - test.py:1.72

Marius Gedminas marius at pov.lt
Thu Sep 18 14:59:26 EDT 2003


Update of /cvs-repository/Zope3
In directory cvs.zope.org:/tmp/cvs-serv21737

Modified Files:
	test.py 
Log Message:
Better terminal width detection method (one that does not change tty mode and
does not print random escapes to the screen).



=== Zope3/test.py 1.71 => 1.72 ===
--- Zope3/test.py:1.71	Fri Sep 12 10:45:22 2003
+++ Zope3/test.py	Thu Sep 18 14:59:25 2003
@@ -193,13 +193,8 @@
             except ImportError:
                 pass
             else:
-                import curses.wrapper
-                def get_max_width(scr, self=self):
-                    self._maxWidth = scr.getmaxyx()[1]
-                try:
-                    curses.wrapper(get_max_width)
-                except curses.error:
-                    pass
+                curses.setupterm()
+                self._maxWidth = curses.tigetnum('cols')
             self._maxWidth -= len("xxxx/xxxx (xxx.x%): ") + 1
 
     def stopTest(self, test):




More information about the Zope3-Checkins mailing list