コード例 #1
0
 def _get_height(self):
     if self._tty:
         packed = fcntl.ioctl(self._tty, termios.TIOCGWINSZ, 'xxxx')
         height = struct.unpack('@HH', packed)[0]
     else:
         height = 25
     return height
コード例 #2
0
ファイル: terminal.py プロジェクト: zofuthan/ovirt-engine-cli
 def _get_height(self):
     if self._tty:
         packed = fcntl.ioctl(self._tty, termios.TIOCGWINSZ, 'xxxx')
         height = struct.unpack('@HH', packed)[0]
     else:
         height = 25
     return height
コード例 #3
0
 def _get_width(self):
     if self._tty:
         packed = fcntl.ioctl(self._tty, termios.TIOCGWINSZ, 'xxxx')
         width = struct.unpack('@HH', packed)[1]
     else:
         width = 80
     return width
コード例 #4
0
ファイル: terminal.py プロジェクト: zofuthan/ovirt-engine-cli
 def _get_width(self):
     if self._tty:
         packed = fcntl.ioctl(self._tty, termios.TIOCGWINSZ, 'xxxx')
         width = struct.unpack('@HH', packed)[1]
     else:
         width = 80
     return width