'%type)
+ if s1!=None and s1!="":
+ sys.stdout.write('%d | '%line1)
+ sys.stdout.write('')
+ sys.stdout.write(convert(s1, linesize=LINESIZE, ponct=1))
+ sys.stdout.write(' | ')
+ else:
+ s1=""
+ sys.stdout.write(' | ')
+
+ if s2!=None and s2!="":
+ sys.stdout.write('%d | '%line2)
+ sys.stdout.write('')
+ sys.stdout.write(convert(s2, linesize=LINESIZE, ponct=1))
+ sys.stdout.write(' | ')
+ else:
+ s2=""
+ sys.stdout.write(' | ')
+
+ sys.stdout.write('
\n')
+
+ if s1!="":
+ line1 += 1
+ if s2!="":
+ line2 += 1
+
+
+def empty_buffer():
+ global buffer
+ global add_cpt
+ global del_cpt
+
+ if del_cpt == 0 or add_cpt == 0:
+ for l in buffer:
+ add_line(l[0], l[1])
+
+ elif del_cpt != 0 and add_cpt != 0:
+ l0, l1 = [], []
+ for l in buffer:
+ if l[0] != None:
+ l0.append(l[0])
+ if l[1] != None:
+ l1.append(l[1])
+ max = (len(l0) > len(l1)) and len(l0) or len(l1)
+ for i in range(max):
+ s0, s1 = "", ""
+ if i