From 17a07c3d1a850178976215713e132cc38e5e1a88 Mon Sep 17 00:00:00 2001 From: grdddj Date: Thu, 4 May 2023 14:32:35 +0200 Subject: [PATCH] chore(core): refactor UI code in SSonscripts --- core/SConscript.firmware | 25 ++++++++++++------------- core/SConscript.unix | 25 ++++++++++++------------- 2 files changed, 24 insertions(+), 26 deletions(-) diff --git a/core/SConscript.firmware b/core/SConscript.firmware index df8f906b18..2010228b58 100644 --- a/core/SConscript.firmware +++ b/core/SConscript.firmware @@ -576,20 +576,19 @@ if FROZEN: SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/ui/*.py')) SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/ui/components/*.py')) SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/ui/components/common/*.py')) - SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/ui/layouts/__init__.py')) - SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/ui/layouts/common.py')) - SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/ui/layouts/homescreen.py')) - SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/ui/layouts/reset.py')) - SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/ui/layouts/recovery.py')) - if EVERYTHING: - SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/ui/layouts/fido.py')) + + # UI layouts - common files and then model-specific. Exclude FIDO when BTC-only. + SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/ui/layouts/*.py', + exclude=[ + SOURCE_PY_DIR + 'trezor/ui/layouts/fido.py', + ] if not EVERYTHING else [] + )) if TREZOR_MODEL in ('T',): - SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/ui/layouts/tt_v2/__init__.py')) - SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/ui/layouts/tt_v2/homescreen.py')) - SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/ui/layouts/tt_v2/reset.py')) - SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/ui/layouts/tt_v2/recovery.py')) - if EVERYTHING: - SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/ui/layouts/tt_v2/fido.py')) + SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/ui/layouts/tt_v2/*.py', + exclude=[ + SOURCE_PY_DIR + 'trezor/ui/layouts/tt_v2/fido.py', + ] if not EVERYTHING else [] + )) elif TREZOR_MODEL in ('1', 'R'): SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/ui/layouts/tr/__init__.py')) else: diff --git a/core/SConscript.unix b/core/SConscript.unix index 1722576620..2d9e02a12e 100644 --- a/core/SConscript.unix +++ b/core/SConscript.unix @@ -547,20 +547,19 @@ if FROZEN: SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/ui/*.py')) SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/ui/components/*.py')) SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/ui/components/common/*.py')) - SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/ui/layouts/__init__.py')) - SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/ui/layouts/common.py')) - SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/ui/layouts/homescreen.py')) - SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/ui/layouts/reset.py')) - SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/ui/layouts/recovery.py')) - if EVERYTHING: - SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/ui/layouts/fido.py')) + + # UI layouts - common files and then model-specific. Exclude FIDO when BTC-only. + SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/ui/layouts/*.py', + exclude=[ + SOURCE_PY_DIR + 'trezor/ui/layouts/fido.py', + ] if not EVERYTHING else [] + )) if TREZOR_MODEL in ('T',): - SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/ui/layouts/tt_v2/__init__.py')) - SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/ui/layouts/tt_v2/homescreen.py')) - SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/ui/layouts/tt_v2/reset.py')) - SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/ui/layouts/tt_v2/recovery.py')) - if EVERYTHING: - SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/ui/layouts/tt_v2/fido.py')) + SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/ui/layouts/tt_v2/*.py', + exclude=[ + SOURCE_PY_DIR + 'trezor/ui/layouts/tt_v2/fido.py', + ] if not EVERYTHING else [] + )) elif TREZOR_MODEL in ('1', 'R'): SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/ui/layouts/tr/__init__.py')) else: