Ticket #98: minor.patch
| File minor.patch, 1.7 KB (added by anonymous, 5 years ago) |
|---|
-
C:/projects/workspace_python/pyyaml-trunk/lib/yaml/error.py
14 14 def get_snippet(self, indent=4, max_length=75): 15 15 if self.buffer is None: 16 16 return None 17 half = max_length/2-1 17 18 head = '' 18 19 start = self.pointer 19 20 while start > 0 and self.buffer[start-1] not in u'\0\r\n\x85\u2028\u2029': 20 21 start -= 1 21 if self.pointer-start > max_length/2-1:22 if self.pointer-start > half: 22 23 head = ' ... ' 23 24 start += 5 24 25 break … … 26 27 end = self.pointer 27 28 while end < len(self.buffer) and self.buffer[end] not in u'\0\r\n\x85\u2028\u2029': 28 29 end += 1 29 if end-self.pointer > max_length/2-1:30 if end-self.pointer > half: 30 31 tail = ' ... ' 31 32 end -= 5 32 33 break -
C:/projects/workspace_python/pyyaml-trunk/lib/yaml/nodes.py
1 1 2 2 class Node(object): 3 def __init__(self, tag, value, start_mark, end_mark):4 self.tag = tag5 self.value = value6 self.start_mark = start_mark7 self.end_mark = end_mark8 3 def __repr__(self): 9 4 value = self.value 10 5 #if isinstance(value, list):
