Move get_keymap

This commit is contained in:
Andrew Kay
2019-12-01 15:27:24 -06:00
parent d5dadbc38c
commit c4f45b6ea9
3 changed files with 18 additions and 16 deletions

View File

@@ -7,9 +7,19 @@ from coax import Interface1
from .controller import Controller
from .tn3270 import TN3270Session
from .vt100 import VT100Session
from .keymap_3278_2 import KEYMAP as KEYMAP_3278_2
from .keymap_3483 import KEYMAP as KEYMAP_3483
logging.basicConfig(level=logging.INFO)
def _get_keymap(terminal_id, extended_id):
keymap = KEYMAP_3278_2
if extended_id == 'c1348300':
keymap = KEYMAP_3483
return keymap
def _create_session(args, terminal):
if args.emulator == 'tn3270':
return TN3270Session(terminal, args.host, args.port)
@@ -62,7 +72,7 @@ def main():
# Initialize and start the controller.
create_session = lambda terminal: _create_session(args, terminal)
controller = Controller(interface, create_session)
controller = Controller(interface, _get_keymap, create_session)
print('Starting controller...')