~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/utextwrap.py

  • Committer: INADA Naoki
  • Date: 2011-05-14 12:24:36 UTC
  • mto: This revision was merged to the branch mainline in revision 5874.
  • Revision ID: songofacandy@gmail.com-20110514122436-0xeiw3861mgbmw3x
Cleanup. Remove spaces in empty line and shorten line having 80 characters.

Show diffs side-by-side

added added

removed removed

Lines of Context:
87
87
 
88
88
    def _width(self, s):
89
89
        """Returns width for s.
90
 
        
 
90
 
91
91
        When s is unicode, take care of east asian width.
92
92
        When s is bytes, treat all byte is single width character.
93
93
        """
186
186
                self._handle_long_word(chunks, cur_line, cur_len, width)
187
187
 
188
188
            # If the last chunk on this line is all whitespace, drop it.
189
 
            if self.drop_whitespace and cur_line and cur_line[-1].strip() == '':
 
189
            if self.drop_whitespace and cur_line and not cur_line[-1].strip():
190
190
                del cur_line[-1]
191
191
 
192
192
            # Convert current line back to a string and store it in list