~martijnbraam/almobootstrap

071dc99f685c7472993af0e3ea8e3ad304c20993 — Luca Weiss 9 months ago 6d0aa12
pmb.flasher.frontend: Use elif instead of repeated if

Only one action can be provided through the args, so there's no point in
checking subsequent actions if a previous one has matched.

Reviewed-by: Oliver Smith <ollieparanoid@postmarketos.org>
Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230513120625.1259793-2-luca@z3ntu.xyz%3E
1 files changed, 7 insertions(+), 7 deletions(-)

M pmb/flasher/frontend.py
M pmb/flasher/frontend.py => pmb/flasher/frontend.py +7 -7
@@ 137,17 137,17 @@ def frontend(args):

    if action in ["boot", "flash_kernel"]:
        kernel(args)
    if action == "flash_rootfs":
    elif action == "flash_rootfs":
        rootfs(args)
    if action == "flash_vbmeta":
    elif action == "flash_vbmeta":
        flash_vbmeta(args)
    if action == "flash_dtbo":
    elif action == "flash_dtbo":
        flash_dtbo(args)
    if action == "list_flavors":
    elif action == "list_flavors":
        list_flavors(args)
    if action == "list_devices":
    elif action == "list_devices":
        list_devices(args)
    if action == "sideload":
    elif action == "sideload":
        sideload(args)
    if action in ["flash_lk2nd"]:
    elif action in ["flash_lk2nd"]:
        flash_lk2nd(args)