mirror of
https://github.com/svpcom/wfb-ng.git
synced 2025-02-22 08:23:47 -04:00
Fix issue with termios and python < 3.11
This commit is contained in:
parent
0a5282c25a
commit
5b51172ec7
@ -24,6 +24,8 @@ import msgpack
|
|||||||
import tempfile
|
import tempfile
|
||||||
import signal
|
import signal
|
||||||
import termios
|
import termios
|
||||||
|
import struct
|
||||||
|
import fcntl
|
||||||
|
|
||||||
from twisted.python import log
|
from twisted.python import log
|
||||||
from twisted.internet import reactor, defer
|
from twisted.internet import reactor, defer
|
||||||
@ -165,7 +167,8 @@ class AntennaStatClientFactory(ReconnectingClientFactory):
|
|||||||
|
|
||||||
def init_windows(self):
|
def init_windows(self):
|
||||||
self.windows.clear()
|
self.windows.clear()
|
||||||
height, width = termios.tcgetwinsize(1)
|
# python < 3.11 doesn't have termios.tcgetwinsize
|
||||||
|
height, width = struct.unpack('hh', fcntl.ioctl(1, termios.TIOCGWINSZ, b' ' * 4))
|
||||||
curses.resize_term(height, width)
|
curses.resize_term(height, width)
|
||||||
self.stdscr.clear()
|
self.stdscr.clear()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user