def METHOD_NAME(self,code,wait=False):
    '''
    issue G-Code as MDI command.
    wait for completion if requested
    '''
    self.c.mdi(code)
    if wait:
        try:
            while self.c.wait_complete(self.timeout) == -1:
                pass
            return True
        except KeyboardInterrupt:
            print("interrupted by keyboard in c.wait_complete(self.timeout)")
            return False
    self.error = self.e.poll()
    if self.error:
        kind, text = self.error
        if kind in (linuxcnc.NML_ERROR, linuxcnc.OPERATOR_ERROR):
            if self.g_raise_except:
                raise LinuxcncError(text)
            else:
                print(("error " + text))
        else:
            print(("info " + text))
    return False