Esempio n. 1
0
def convert(command, output):
    """ Package the executable passing the arguments the user requested """
    # Initially clean the workspace
    eel.addOutput("Cleaning workspace\n")
    try:
        clean()
    except:
        eel.addOutput(
            "Warning: could not clean the workspace before starting\n")

    # Run PyInstaller
    pyinstaller_fail = True
    cs.start()  # Capture stderr so PyInstaller output can be send to UI
    sys.argv = shlex.split(command)  # Put command into sys.argv
    try:
        pyi.run()  # Execute PyInstaller
        pyinstaller_fail = False
    except:
        eel.addOutput("An error occurred, traceback follows:\n")
        eel.addOutput(traceback.format_exc())
    cs.stop()  # Stop stderr capture

    # Move Project
    if pyinstaller_fail:
        eel.addOutput("\n")
        eel.addOutput("Project output will not be moved to output folder\n")
    else:
        eel.addOutput("Moving project to: " + output + "\n")
        try:
            moveProject(output)
        except:
            eel.addOutput("Failed to move project, traceback follows:\n")
            eel.addOutput(traceback.format_exc())

    # Clean the workspace
    eel.addOutput("Cleaning workspace\n")
    try:
        clean()
    except:
        eel.addOutput(
            "Warning: could not clean the workspace; some build files will still exist\n"
        )

    eel.addOutput("Complete.\n")
    eel.outputComplete()
Esempio n. 2
0
def convert(command, output):
    eel.addOutput("Cleaning file structure\n")
    clean()

    cs.start()  # Capture stderr so PyInstaller output can be send to UI
    sys.argv = shlex.split(command)  # Put command into sys.argv
    pyi.run()  # Execute PyInstaller
    cs.stop()  # Stop stderr capture

    eel.addOutput("Moving project to: " + output + "\n")
    try:
        moveProject(output)
    except:
        eel.addOutput("Failed to move project. Did an error occur?\n")
    eel.addOutput("Cleaning file structure\n")
    clean()
    eel.addOutput("Complete.\n")
    eel.outputComplete()