Esempio n. 1
0
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()
Esempio n. 2
0
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()
Esempio n. 3
0
def flow_designer_window():
    """Testing fixture for the FLow Designer window"""
    from automagica.gui.apps import FlowApp

    app = FlowApp()

    # 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.quit()
    app.destroy()
Esempio n. 4
0
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()
Esempio n. 5
0
def flow_new():
    """
    `automagica flow new` creates a new Automagica Flow
    """
    root = AutomagicaTk()
    _ = FlowApp(root)
    root.mainloop()
Esempio n. 6
0
def test_flow_app():
    """
    Testing scenario to test Automagica Flow application
    """
    app = FlowApp()
    app.destroy()
    app.quit()
Esempio n. 7
0
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()
Esempio n. 8
0
def flow_edit(file_path):
    app = FlowApp(file_path=file_path)
    app.run()
Esempio n. 9
0
def flow_new():
    app = FlowApp()
    app.run()
Esempio n. 10
0
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":
Esempio n. 11
0
def flow_edit(file_path):
    """
    `automagica flow edit <filename>` opens an existing Automagica Flow for editing
    """
    app = FlowApp(file_path=file_path)
    app.run()
Esempio n. 12
0
def flow_new():
    """
    `automagica flow new` creates a new Automagica Flow
    """
    app = FlowApp()
    app.run()
Esempio n. 13
0
    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)