'Formats correctly the string ouput from the invoke() method,
replacing line breaks and tabs when necessary.'

def format_invoke_command(self, string):

    string = string.replace(u'\\n', u'\n')
    formated_response = u''
    for line in string.splitlines():
        if line.startswith(u'REPORT'):
            line = line.replace(u' DCTB ', u'\n')
        if line.startswith(u'[DEBUG]'):
            line = line.replace(u' DCTB ', u'    ')
        formated_response += (line + u'\n')
    formated_response = formated_response.replace(u'\n\n', u'\n')
    return formated_response
