Prepare string to be used in a quoted string. Turns backslash and double quote characters into quoted pairs. These are the only characters that need to be quoted inside a quoted string. Does not add the surrounding double quotes.
(str)
| 203 | |
| 204 | |
| 205 | def quote(str): |
| 206 | """Prepare string to be used in a quoted string. |
| 207 | |
| 208 | Turns backslash and double quote characters into quoted pairs. These |
| 209 | are the only characters that need to be quoted inside a quoted string. |
| 210 | Does not add the surrounding double quotes. |
| 211 | """ |
| 212 | return str.replace('\\', '\\\\').replace('"', '\\"') |
| 213 | |
| 214 | |
| 215 | class AddrlistClass: |
no test coverage detected
searching dependent graphs…