コード例 #1
0
                sys.exit(1)

            else:
                filename = parser.filename[0]

                fname, extension = os.path.splitext(filename)
                if (extension != ".pde") and (extension != ".hex"):
                    printb(
                        "ERROR: bad file extension, it should be .pde or .hex",
                        bcolors.Red)
                    sys.exit()
                del fname

                if (extension == ".pde"):

                    pinguino.compile_file(filename)

                    if not pinguino.compiled():
                        printb("\nERROR: no compiled\n", bcolors.Red)

                        errors_proprocess = pinguino.get_errors_preprocess()
                        if errors_proprocess:
                            for error in errors_proprocess["preprocess"]:
                                printb(error, bcolors.Red)

                        errors_c = pinguino.get_errors_compiling_c()
                        if errors_c:
                            printb(errors_c["complete_message"], bcolors.Red)

                        errors_asm = pinguino.get_errors_compiling_asm()
                        if errors_asm:
コード例 #2
0
ファイル: pinguino.py プロジェクト: Robotonics/pinguino-ide
            print("using %s bootloader" % pinguino.get_board().bldr)

            if not parser.filename:
                print("ERROR: missing filename")
                sys.exit(1)

            else:
                filename = parser.filename[0]

                fname, extension = os.path.splitext(filename)
                if extension != ".pde":
                    print("ERROR: bad file extension, it should be .pde")
                    sys.exit()
                del fname, extension

                pinguino.compile_file(filename)

                if not pinguino.compiled():
                    print("\nERROR: no compiled\n")

                    errors_proprocess = pinguino.get_errors_preprocess()
                    if errors_proprocess:
                        for error in errors_proprocess["preprocess"]: print(error)

                    errors_c = pinguino.get_errors_compiling_c()
                    if errors_c:
                        print(errors_c["complete_message"])

                    errors_asm = pinguino.get_errors_compiling_asm()
                    if errors_asm:
                        for error in errors_asm["error_symbols"]: print(error)