def flow_new(): """ `automagica flow new` creates a new Automagica Flow """ root = AutomagicaTk() _ = FlowApp(root) root.mainloop()
def flow_edit(file_path): """ `automagica flow edit <filename>` opens an existing Automagica Flow for editing """ root = AutomagicaTk() _ = FlowApp(root, file_path=file_path) root.mainloop()
def flow_designer_window(): """Testing fixture for the FLow Designer window""" from automagica.gui.apps import FlowApp pytest.automagica_tk.update() app = FlowApp(pytest.automagica_tk) # Let application render app.update() # Get children of app windows = app.winfo_children() # First child is the Flow designer window flow_designer_window = windows[0] # Render the window flow_designer_window.update() yield flow_designer_window # Clean-up for window in windows: window.destroy() app.destroy()
def test_flow_app(): """ Testing scenario to test Automagica Flow application """ app = FlowApp() app.destroy() app.quit()
def flow_run(filename, headless, step_by_step): # Run FLow app = FlowApp( file_path=filename, run=True, headless=headless, step_by_step=step_by_step, ) app.run()
def flow_run(filename, headless, step_by_step): """ `automagica flow run <filename>` opens an existing Automagica Flow and executes it """ # Run FLow app = FlowApp( file_path=filename, run=True, headless=headless, step_by_step=step_by_step, ) app.run()
def flow_run(filename, headless, step_by_step): """ `automagica flow run <filename>` opens an existing Automagica Flow and executes it """ root = AutomagicaTk() # Run FLow app = FlowApp( root, file_path=filename, run=True, headless=headless, step_by_step=step_by_step, ) root.mainloop()
def flow_edit(file_path): app = FlowApp(file_path=file_path) app.run()
def flow_new(): app = FlowApp() app.run()
if __name__ == "__main__": """ Protocol handler for automagica:// """ url = sys.argv[1] url = url.replace("automagica://", "") parts = url.split("/") os.chdir(os.path.expanduser("~")) # 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":
def flow_edit(file_path): """ `automagica flow edit <filename>` opens an existing Automagica Flow for editing """ app = FlowApp(file_path=file_path) app.run()
def flow_new(): """ `automagica flow new` creates a new Automagica Flow """ app = FlowApp() app.run()
Protocol handler for URLS with the automagica://-protocol This allows to immediate launch Automagica Flow for example from a website URL """ url = sys.argv[1] url = url.replace("automagica://", "") parts = url.split("/") os.chdir(os.path.expanduser("~")) # Automagica Flow (automagica://flow/new) 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)