()
return arduino_cmd
Attempt to find or guess the path to the Arduino binary.
Attempt to find or guess the path to the Arduino binary.
Attempt to find or guess the path to the Arduino binary .
def get_arduino_command():
    """Attempt to find or guess the path to the Arduino binary."""
    global arduino_cmd
    if not arduino_cmd:
        if platform.system() == "Darwin":
            arduino_cmd_guesses = ["/Applications/Arduino.app/Contents/MacOS/Arduino"]
        elif platform.system() == "Windows":
            arduino_cmd_guesses = [
                "c:\Program Files\Arduino\Arduino_debug.exe",
                "c:\Program Files\Arduino\Arduino.exe",
                "c:\Program Files (x86)\Arduino\Arduino_debug.exe",
                "c:\Program Files (x86)\Arduino\Arduino.exe"
            ]
        else:
            arduino_cmd_guesses = []

        for guess in arduino_cmd_guesses:
            if os.path.exists(guess):
                logging.info("Found Arduino command at %s", guess)
                arduino_cmd = guess
                break
        else:
            logging.info("Couldn't find Arduino command; hoping it's on the path!")
            arduino_cmd = "arduino"
    return arduino_cmd
def get_arduino_command ( ) : global arduino_cmd if not arduino_cmd : if platform . system ( ) == "Darwin" : arduino_cmd_guesses = [ "/Applications/Arduino.app/Contents/MacOS/Arduino" ] elif platform . system ( ) == "Windows" : arduino_cmd_guesses = [ "c:\Program Files\Arduino\Arduino_debug.exe" , "c:\Program Files\Arduino\Arduino.exe" , "c:\Program Files (x86)\Arduino\Arduino_debug.exe" , "c:\Program Files (x86)\Arduino\Arduino.exe" ] else : arduino_cmd_guesses = [ ] for guess in arduino_cmd_guesses : if os . path . exists ( guess ) : logging . info ( "Found Arduino command at %s" , guess ) arduino_cmd = guess break else : logging . info ( "Couldn't find Arduino command; hoping it's on the path!" ) arduino_cmd = "arduino" return arduino_cmd