Wrap text to fit within width
(self, text, width)
| 264 | pass |
| 265 | |
| 266 | def _wrap_text(self, text, width): |
| 267 | """Wrap text to fit within width""" |
| 268 | words = text.split() |
| 269 | lines = [] |
| 270 | current_line = "" |
| 271 | |
| 272 | for word in words: |
| 273 | if len(current_line) + len(word) + 1 <= width: |
| 274 | current_line += word + " " |
| 275 | else: |
| 276 | if current_line: |
| 277 | lines.append(current_line.strip()) |
| 278 | current_line = word + " " |
| 279 | |
| 280 | if current_line: |
| 281 | lines.append(current_line.strip()) |
| 282 | |
| 283 | return lines |
| 284 | |
| 285 | def _edit_field(self): |
| 286 | """Edit the current field""" |
no test coverage detected