mirror of
https://github.com/powerline/powerline.git
synced 2025-07-27 07:44:36 +02:00
Do not force MutableDimensions inherit from Dimensions
This commit is contained in:
parent
a2bc59c020
commit
afb6b0995d
@ -12,11 +12,9 @@ import pexpect
|
|||||||
from tests.lib.vterm import VTerm, Dimensions
|
from tests.lib.vterm import VTerm, Dimensions
|
||||||
|
|
||||||
|
|
||||||
class MutableDimensions(Dimensions):
|
class MutableDimensions(object):
|
||||||
def __new__(cls, rows, cols):
|
|
||||||
return Dimensions.__new__(cls, rows, cols)
|
|
||||||
|
|
||||||
def __init__(self, rows, cols):
|
def __init__(self, rows, cols):
|
||||||
|
super(MutableDimensions, self).__init__()
|
||||||
self._list = [rows, cols]
|
self._list = [rows, cols]
|
||||||
|
|
||||||
def __getitem__(self, idx):
|
def __getitem__(self, idx):
|
||||||
@ -51,7 +49,7 @@ class ExpectProcess(threading.Thread):
|
|||||||
super(ExpectProcess, self).__init__()
|
super(ExpectProcess, self).__init__()
|
||||||
self.vterm = VTerm(lib, dim)
|
self.vterm = VTerm(lib, dim)
|
||||||
self.lock = threading.Lock()
|
self.lock = threading.Lock()
|
||||||
self.dim = Dimensions(dim[0], dim[1])
|
self.dim = Dimensions(*dim)
|
||||||
self.cmd = cmd
|
self.cmd = cmd
|
||||||
self.args = args
|
self.args = args
|
||||||
self.cwd = cwd
|
self.cwd = cwd
|
||||||
@ -89,7 +87,7 @@ class ExpectProcess(threading.Thread):
|
|||||||
|
|
||||||
def resize(self, dim):
|
def resize(self, dim):
|
||||||
with self.child_lock:
|
with self.child_lock:
|
||||||
self.dim = Dimensions(dim[0], dim[1])
|
self.dim = Dimensions(*dim)
|
||||||
self.child.setwinsize(self.dim.rows, self.dim.cols)
|
self.child.setwinsize(self.dim.rows, self.dim.cols)
|
||||||
self.vterm.resize(self.dim)
|
self.vterm.resize(self.dim)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user