Skip to content
Myr

Removed some proper pointless textwrap code which did not work anyways.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Armin Ronacher · committed by Armin Ronacher · parent 6ec3e65 · Browse files · 1 file+3 added−10 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+3 added−10 removed

  • other:+3 added−10 removed

1 file+3 added−10 removed

modified:click/_textwrap.py+3 added-10 removed
1import textwrap2from contextlib import contextmanager3from ._compat import term_len345class TextWrapper(textwrap.TextWrapper):68 def _cutdown(self, ucstr, space_left):9 l = 010 for i in xrange(len(ucstr)):11 l += term_len(ucstr[i])12 if space_left < l:13 return (ucstr[:i], ucstr[i:])14 return ucstr, ''157 def _handle_long_word(self, reversed_chunks, cur_line, cur_len, width):8 space_left = max(width - cur_len, 1)910 if self.break_long_words:20 cut, res = self._cutdown(reversed_chunks[-1], space_left)11 last = reversed_chunks[-1]12 cut = last[:space_left]13 res = last[space_left:]14 cur_line.append(cut)15 reversed_chunks[-1] = res16 elif not cur_line:17 cur_line.append(reversed_chunks.pop())
21 unmodified lines