'Implements the various backlash sequences in s such as
turning backslash t into a tab.
This function is needed because shlex does not do it for us.'

def fixup_backslashes(self, s):

    if ('\\' not in s):
        return s
    res = []
    i = 0
    while (i < len(s)):
        if (s[i] != '\\'):
            res.append(s[i])
            i += 1
            continue
        i += 1
        if (i >= len(s)):
            raise self.Error('Backslash    with    nothing    following')
        c = s[i]
        res.append({'\\': '\\', 'r': '\r', 'n': '\n', 't': ' DCTB '}.get(c, None))
        i += 1
        if (res[(-1)] is None):
            raise self.Error(('Unknown    backslash    sequence    \\' + c))
    return ''.join(res)
