Commit 53f38d38 authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

if not running inside a terminal, it's not possible to get the terminal geometry


git-svn-id: https://svn.forked.de/graph-tool/trunk@31 d4600afd-f417-0410-95de-beed9576f240
parent 1bc70be5
......@@ -47,7 +47,11 @@ version_string = "%s %s\nWritten by %s\n\n%s" % (prog_info.name, prog_info.versi
prog_info.author,prog_info.copyright)
def getheightwidth():
height, width = struct.unpack("hhhh", fcntl.ioctl(0, termios.TIOCGWINSZ ,"\000"*8))[0:2]
height, width = 20, 80
try:
height, width = struct.unpack("hhhh", fcntl.ioctl(0, termios.TIOCGWINSZ ,"\000"*8))[0:2]
except IOError:
pass
return height, width
option_list = list()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment