def wand(delay=0): def on_finish(automagica_id): print(f"Automagica ID: {automagica_id}") os._exit(0) app = WandApp(delay=delay, on_finish=on_finish) app.run()
def wand(delay=0): """ `automagica wand` launches the Automagica Wand """ def on_finish(automagica_id): """ Callback function when Automagica Wand is closed """ print(f"Automagica ID: {automagica_id}") os._exit(0) app = WandApp(delay=delay, on_finish=on_finish) app.run()
def wand_app(): """ Testing fixture for the Flow app """ app = WandApp() yield app app.destroy() app.quit()
def wand(delay=0): """ `automagica wand` launches the Automagica Wand """ def on_finish(automagica_id): """ Callback function when Automagica Wand is closed """ print(f"Automagica ID: {automagica_id}") os._exit(0) root = AutomagicaTk() _ = WandApp(root, delay=delay, on_finish=on_finish) root.mainloop()
def wand_app(): """Testing fixture for the Flow app""" app = WandApp(pytest.automagica_tk) app.update() yield app app.destroy()
# Automagica Flow (automagica://flow/new) if parts[0] == "flow": if parts[1] == "new": app = FlowApp() app.run() # Automagica Lab (automagica://lab/new) if parts[0] == "lab": if parts[1] == "new": app = LabApp() app.new() # Automagica Wand (automagica://wand) if parts[0] == "wand": app = WandApp() app.run() # Automagica Bot (automagica://bot/bot_secret/ABCD12345) if parts[0] == "bot": config = Config() if parts[1] == "bot_secret": bot_secret = parts[2] config.values["bot_secret"] = bot_secret config.save() app = BotApp(config=config) app.run()
if parts[0] == "flow": if parts[1] == "new": root = AutomagicaTk() _ = FlowApp(root) root.mainloop() # Automagica Lab (automagica://lab/new) if parts[0] == "lab": if parts[1] == "new": app = LabApp() app.new() # Automagica Wand (automagica://wand) if parts[0] == "wand": root = AutomagicaTk() _ = WandApp(root) root.mainloop() # Automagica Bot (automagica://bot/bot_secret/ABCD12345) if parts[0] == "bot": config = Config() # Bot secret specified if parts[1] == "bot_secret": bot_secret = parts[2] config.values["bot_secret"] = bot_secret config.save() root = AutomagicaTk(config=config) app = BotApp(root)