(self, s)
return "".join(res)
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.
Implements the various backlash sequences in s such as
        turning backslash t into a tab.
Implements the various backlash sequences in s such as turning backslash t into a tab .
def fixup_backslashes(self, s):
        """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.
        """
        if "\\" not in s: return s
        # See the resolve_backslashes function in SQLite shell source
        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": "\t"}.get(c, None))
            i += 1  # advance again
            if res[-1] is None:
                raise self.Error("Unknown backslash sequence \\" + c)
        return "".join(res)
def fixup_backslashes ( self , s ) : if "\\" not in s : return s # See the resolve_backslashes function in SQLite shell source 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" : "\t" } . get ( c , None ) ) i += 1 # advance again if res [ - 1 ] is None : raise self . Error ( "Unknown backslash sequence \\" + c ) return "" . join ( res )