コード例 #1
0
def close_beacon(emulator: Emulator):
    logger.info("exiting applid")
    try:
        emulator.display(key=keys.HOME)
        emulator.display('=x', key=keys.ENTER, timeout=1000)
    finally:
        emulator.disconnect()
        emulator.close()
        logger.info("emulator was closed successfully")
コード例 #2
0
def logon_beacon(host: str,
                 applid: str,
                 username: str,
                 password: str,
                 oversize: Tuple[int, int] = (62, 160)):
    emulator = Emulator(host, model=2, oversize=oversize)
    welcome = emulator.display.find('===> Ex.: LOGON <userid>, TSO <userid>')
    if welcome:
        logger.info(f"Logging to E3270UI applid {applid}")
        welcome.shift((1, 0))(f'L {applid}', keys.ENTER, 30)
    emulator.display(username, keys.TAB, 10)
    emulator.display(password, keys.ENTER, 100)
    if emulator.display.find("OMEGAMON e3270UI What's New"):
        emulator.display(key=keys.PF3)
    return emulator