Changeset 304 for pyyaml/trunk/lib
- Timestamp:
- 12/04/08 06:32:12 (3 years ago)
- Files:
-
- 1 modified
-
pyyaml/trunk/lib/yaml/emitter.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
pyyaml/trunk/lib/yaml/emitter.py
r300 r304 1010 1010 def determine_block_hints(self, text): 1011 1011 hints = u'' 1012 if text and text[0] in u' \n\x85\u2028\u2029': 1013 hints += unicode(self.best_indent) 1014 tail = text[-2:] 1015 while len(tail) < 2: 1016 tail = u' '+tail 1017 if tail[-1] in u'\n\x85\u2028\u2029': 1018 if tail[-2] in u'\n\x85\u2028\u2029': 1012 if text: 1013 if text[0] in u' \n\x85\u2028\u2029': 1014 hints += unicode(self.best_indent) 1015 if text[-1] not in u'\n\x85\u2028\u2029': 1016 hints += u'-' 1017 elif len(text) == 1 or text[-2] in u'\n\x85\u2028\u2029': 1019 1018 hints += u'+' 1020 else:1021 hints += u'-'1022 1019 return hints 1023 1020 … … 1025 1022 hints = self.determine_block_hints(text) 1026 1023 self.write_indicator(u'>'+hints, True) 1027 self.write_ indent()1028 leading_space = False1024 self.write_line_break() 1025 leading_space = True 1029 1026 spaces = False 1030 breaks = False1027 breaks = True 1031 1028 start = end = 0 1032 1029 while end <= len(text): … … 1076 1073 chomp = self.determine_block_hints(text) 1077 1074 self.write_indicator(u'|'+chomp, True) 1078 self.write_ indent()1079 breaks = False1075 self.write_line_break() 1076 breaks = True 1080 1077 start = end = 0 1081 1078 while end <= len(text):
