def arduinoShellPrompt(): """docstring for arduinoShellPrompt""" arduino = ArduinoShell("/dev/tty.usbserial-A80081qe") arduino.promptLoop()
def handleRead(self): """docstring for handleRead""" print "Reading: ", self.board.readLine() def handleWrite(self): """docstring for handleWrite""" sys.stdout.write("Write: ") writeLine = sys.stdin.readline() self.board.writeLine(writeLine) def handleAbort(self): """docstring for handleAbort""" return True def promptLoop(self): """docstring for promptLoop""" abort = False while abort == False: self.getOpts() opt = sys.stdin.readline().rstrip() if self.opIsValid(opt) is True: abort = self.handleOp(opt) else: sys.stderr.write("Error: Option is invalid\n") if __name__ == '__main__': arduino = ArduinoShell("/dev/tty.usbserial-A80081qe") arduino.promptLoop()