_munge_whitespace(text : string) -> string Munge whitespace in text: expand tabs and convert all other whitespace characters to spaces. Eg. " foo\\tbar\\n\\nbaz" becomes " foo bar baz".
(self, text)
| 141 | # (possibly useful for subclasses to override) |
| 142 | |
| 143 | def _munge_whitespace(self, text): |
| 144 | """_munge_whitespace(text : string) -> string |
| 145 | |
| 146 | Munge whitespace in text: expand tabs and convert all other |
| 147 | whitespace characters to spaces. Eg. " foo\\tbar\\n\\nbaz" |
| 148 | becomes " foo bar baz". |
| 149 | """ |
| 150 | if self.expand_tabs: |
| 151 | text = text.expandtabs(self.tabsize) |
| 152 | if self.replace_whitespace: |
| 153 | text = text.translate(self.unicode_whitespace_trans) |
| 154 | return text |
| 155 | |
| 156 | |
| 157 | def _split(self, text): |
no test coverage detected