Example #1
0
def n():
    "Next element in the MENU"
    PAST_MENU.append(MENU.pop(0))
    return PAST_MENU[-1]()


def p():
    """Previous element in the menu"""
    MENU.insert(0, PAST_MENU.pop())
    return MENU[0]()


def r():
    shell.magic("%clear")
    shell.magic("%rep")


for k in pystemd.systemd1.unit_signatures.KNOWN_UNIT_SIGNATURES:
    k = k.decode()
    exec(f'{k}="{k}"')

if __name__ == '__main__':

    shell = InteractiveShellEmbed()
    clean_unit()
    shell.show_banner(display_banner)
    shell.magic("%autocall 2")
    shell.magic("%clear")
    shell.mainloop()