Only update TN3270 dirty cells

This commit is contained in:
Andrew Kay
2019-09-13 21:28:09 -05:00
parent e9821ed39e
commit d583273571
3 changed files with 10 additions and 2 deletions

View File

@@ -142,7 +142,9 @@ class TN3270Session(Session):
self.telnet = None
def _apply(self):
for (address, cell) in enumerate(self.emulator.cells):
for address in self.emulator.dirty:
cell = self.emulator.cells[address]
byte = 0x00
if isinstance(cell, AttributeCell):
@@ -152,6 +154,8 @@ class TN3270Session(Session):
self.terminal.display.buffered_write(byte, index=address)
self.emulator.dirty.clear()
# Update the message area.
self.message_area = self._format_message_area()

View File

@@ -2,7 +2,7 @@ ptyprocess==0.6.0
pycoax==0.1.2
pyserial==3.4
pyte==0.8.0
pytn3270==0.1.0
pytn3270==0.2.0
sliplib==0.3.0
sortedcontainers==2.1.0
wcwidth==0.1.7

View File

@@ -49,6 +49,8 @@ class SessionHandleHostTestCase(unittest.TestCase):
_set_attribute(cells, 104, MockAttribute(protected=True))
self.session.emulator.cells = cells
self.session.emulator.dirty = set(range(105))
self.session.emulator.cursor_address = 8
# Act and assert
@@ -76,6 +78,7 @@ class SessionHandleHostTestCase(unittest.TestCase):
self.session.emulator.update = Mock(return_value=True)
self.session.emulator.cells = _create_screen_cells(24, 80)
self.session.emulator.dirty = set()
# Act
self.session.handle_host()
@@ -92,6 +95,7 @@ class SessionHandleKeyTestCase(unittest.TestCase):
self.session.emulator = Mock()
self.session.emulator.cells = []
self.session.emulator.dirty = set()
def test_enter(self):
# Act