Modifications to support boobank under win32

Signed-off-by: Romain Bignon <romain@peerfuse.org>
This commit is contained in:
Laurent Dufréchou 2011-03-17 11:55:46 +01:00 committed by Romain Bignon
commit 86937aef95
3 changed files with 28 additions and 9 deletions

View file

@ -21,7 +21,9 @@ from __future__ import with_statement
import os
import sys
import subprocess
if sys.platform == 'win32':
import WConio
try:
import tty, termios
except ImportError:
@ -85,7 +87,10 @@ class IFormatter(object):
# XXX if stdin is not a tty, it seems that the command fails.
if os.isatty(sys.stdout.fileno()) and os.isatty(sys.stdin.fileno()):
self.termrows = int( subprocess.Popen('stty size', shell=True, stdout=subprocess.PIPE).communicate()[0].split()[0])
if sys.platform == 'win32':
self.termrows = WConio.gettextinfo()[8]
else:
self.termrows = int( subprocess.Popen('stty size', shell=True, stdout=subprocess.PIPE).communicate()[0].split()[0])
def after_format(self, formatted):
if self.outfile != sys.stdout: