From edb87359eb1a7f0f9c834acd5f6a96bf87a77383 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Fri, 18 Feb 2022 11:34:28 +0100 Subject: [PATCH] feat(core): headless emulator implies disabled animations [no changelog] --- core/emu.py | 2 +- python/src/trezorlib/_internal/emulator.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/emu.py b/core/emu.py index 85b89507a..98fec2594 100755 --- a/core/emu.py +++ b/core/emu.py @@ -96,7 +96,7 @@ def _from_env(name): @click.option("--executable", type=click.Path(exists=True, dir_okay=False), default=os.environ.get("MICROPYTHON"), help="Alternate emulator executable") @click.option("-g", "--profiling/--no-profiling", default=_from_env("TREZOR_PROFILING"), help="Run with profiler wrapper") @click.option("-G", "--alloc-profiling/--no-alloc-profiling", default=_from_env("TREZOR_MEMPERF"), help="Profile memory allocation (requires special micropython build)") -@click.option("-h", "--headless", is_flag=True, help="Headless mode (no display)") +@click.option("-h", "--headless", is_flag=True, help="Headless mode (no display, disables animation)") @click.option("--heap-size", metavar="SIZE", default="20M", help="Configure heap size") @click.option("--main", help="Path to python main file") @click.option("--mnemonic", "mnemonics", multiple=True, help="Initialize device with given mnemonic. Specify multiple times for Shamir shares.") diff --git a/python/src/trezorlib/_internal/emulator.py b/python/src/trezorlib/_internal/emulator.py index 1643d44d8..e35c64f59 100644 --- a/python/src/trezorlib/_internal/emulator.py +++ b/python/src/trezorlib/_internal/emulator.py @@ -236,7 +236,7 @@ class CoreEmulator(Emulator): ) if self.headless: env["SDL_VIDEODRIVER"] = "dummy" - if self.disable_animation: + if self.headless or self.disable_animation: env["TREZOR_DISABLE_FADE"] = "1" env["TREZOR_DISABLE_ANIMATION"] = "1"