'%type_name)
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(' | ')
+ outputfile.write('%d | '%line1)
+ outputfile.write('')
+ outputfile.write(convert(s1, linesize=linesize, ponct=1))
+ outputfile.write(' | ')
else:
s1=""
- sys.stdout.write(' | ')
+ outputfile.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(' | ')
+ outputfile.write('%d | '%line2)
+ outputfile.write('')
+ outputfile.write(convert(s2, linesize=linesize, ponct=1))
+ outputfile.write(' | ')
else:
s2=""
- sys.stdout.write(' | ')
+ outputfile.write(' | ')
- sys.stdout.write('
\n')
+ outputfile.write('\n')
if s1!="":
line1 += 1
@@ -247,23 +268,23 @@ def add_line(s1, s2):
def empty_buffer():
- global buffer
+ global buf
global add_cpt
global del_cpt
if del_cpt == 0 or add_cpt == 0:
- for l in buffer:
+ for l in buf:
add_line(l[0], l[1])
elif del_cpt != 0 and add_cpt != 0:
l0, l1 = [], []
- for l in buffer:
+ for l in buf:
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):
+ max_len = (len(l0) > len(l1)) and len(l0) or len(l1)
+ for i in range(max_len):
s0, s1 = "", ""
if i