·')
- t = t.replace("spanclass", "span class")
return t
def add_comment(s):
- sys.stdout.write('%s |
\n'%convert(s))
+ sys.stdout.write('%s |
\n'%convert(s))
def add_filename(f1, f2):
sys.stdout.write("%s | "%convert(f1, linesize=LINESIZE))
@@ -191,8 +196,12 @@ def add_hunk():
global hunk_size1
global hunk_off2
global hunk_size2
- sys.stdout.write('
---|
Offset %d, %d lines modified | '%(hunk_off1, hunk_size1))
- sys.stdout.write('Offset %d, %d lines modified |
\n'%(hunk_off2, hunk_size2))
+ # Don't bother displaying, it's redundant with the line numbers.
+ #sys.stdout.write('Offset %d, %d lines modified | '%(hunk_off1, hunk_size1))
+ #sys.stdout.write('Offset %d, %d lines modified |
\n'%(hunk_off2, hunk_size2))
+ # ⋮ - vertical ellipsis
+ sys.stdout.write('⋮ | ⋮ |
');
+
def add_line(s1, s2):
global line1
@@ -200,9 +209,9 @@ def add_line(s1, s2):
if s1==None and s2==None:
type="unmodified"
- elif s1==None:
+ elif s1==None or s1=="":
type="added"
- elif s2==None:
+ elif s2==None or s1=="":
type="deleted"
elif s1==s2:
type="unmodified"
@@ -210,10 +219,10 @@ def add_line(s1, s2):
type="changed"
s1,s2 = linediff(s1, s2)
- sys.stdout.write(''%type)
+ sys.stdout.write('
'%type)
if s1!=None and s1!="":
- sys.stdout.write('%d | '%line1)
- sys.stdout.write('')
+ sys.stdout.write(' | %d | '%line1)
+ sys.stdout.write('')
sys.stdout.write(convert(s1, linesize=LINESIZE, ponct=1))
sys.stdout.write(' | ')
else:
@@ -221,8 +230,8 @@ def add_line(s1, s2):
sys.stdout.write(' | ')
if s2!=None and s2!="":
- sys.stdout.write('%d | '%line2)
- sys.stdout.write('')
+ sys.stdout.write(' | %d | '%line2)
+ sys.stdout.write('')
sys.stdout.write(convert(s2, linesize=LINESIZE, ponct=1))
sys.stdout.write(' | ')
else: