Changeset 15 for formatflowed
- Timestamp:
- 09/07/05 08:23:50 (7 years ago)
- Files:
-
- 1 modified
-
formatflowed/trunk/formatflowed.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
formatflowed/trunk/formatflowed.py
r14 r15 672 672 return encoder.encode(chunks) 673 673 674 def convertToWrapped(flowed, width=78, quote='>', newline='\n', 675 encoding='ascii', wrap_fixed=True, **kwargs): 674 def convertToWrapped(flowed, width=78, quote=u'>', wrap_fixed=True, **kwargs): 676 675 """Covert flowed text to encoded and wrapped text 677 676 … … 682 681 width (default: 78) 683 682 The maximum line length at which to wrap paragraphs. 684 quote (default: '>')683 quote (default: u'>') 685 684 Character sequence to use to mark quote depths; it is multiplied with 686 685 the quotedepth to quote a line. If this sequence does not end in a 687 686 space a space is added between the quotemars and the line. 688 newline (default: '\n')689 Lines are joined with the newline character sequence.690 encoding (default: ascii)691 Text chunks from the decoded flowed text are encoded to this encoding692 687 wrap_fixed (default: True) 693 688 If true, fixed text chunks are wrapped to the given width as well, … … 730 725 type = info['type'] 731 726 quotedepth = info['quotedepth'] 732 chunk = chunk.encode(encoding) 733 quotemarker = quotedepth and quote * quotedepth or '' 734 if quotemarker and quote[-1] != ' ': 735 quotemarker += ' ' 727 quotemarker = quotedepth and quote * quotedepth or u'' 728 if quotemarker and quote[-1] != u' ': 729 quotemarker += u' ' 736 730 if type == FIXED and not wrap_fixed: 737 731 result.append(quotemarker + chunk) … … 743 737 initial_indent=quotemarker, 744 738 subsequent_indent=quotemarker)) 745 return newline.join(result)739 return u'\n'.join(result) 746 740 747 741
