'Start a print, gcode is an array of gcode commands.
returns True on success, False if already printing.
The print queue will be replaced with the contents of the data array,
the next line will be set to 0 and the firmware notified. Printing
will then start in a parallel thread.'

def startprint(self, gcode, startindex=0):

    if (self.printing or (not self.online) or (not self.printer)):
        return False
    self.queueindex = startindex
    self.mainqueue = gcode
    self.printing = True
    self.lineno = 0
    self.resendfrom = (-1)
    self._send('M110', (-1), True)
    if ((not gcode) or (not gcode.lines)):
        return True
    self.clear = False
    resuming = (startindex != 0)
    self.print_thread = threading.Thread(target=self._print, kwargs={'resuming': resuming})
    self.print_thread.start()
    return True
