@@ -43,7 +43,7 @@ def compare(previous, current):
4343 return result
4444
4545
46- def human_text (result ):
46+ def human_text (result , key = None ):
4747 title = []
4848 summary = []
4949 show_headers = sum (1 for key in result if result [key ]) > 1
@@ -57,7 +57,7 @@ def human_text(result):
5757 change_blocks = []
5858 for details in result ["changed" ]:
5959 block = []
60- block .append (" Row {}" .format (details ["key" ]))
60+ block .append (" {}: {}" .format (key , details ["key" ]))
6161 for field , (prev_value , current_value ) in details ["changes" ].items ():
6262 block .append (
6363 ' {}: "{}" => "{}"' .format (field , prev_value , current_value )
@@ -72,9 +72,10 @@ def human_text(result):
7272 title .append (fragment )
7373 if show_headers :
7474 summary .append (fragment + "\n " )
75+ rows = []
7576 for row in result ["added" ]:
76- summary .append (human_row (row , prefix = " " ))
77- summary .append ("" )
77+ rows .append (human_row (row , prefix = " " ))
78+ summary .append ("\n \n " . join ( rows ) )
7879 summary .append ("" )
7980 if result ["removed" ]:
8081 fragment = "{} row{} removed" .format (
@@ -83,9 +84,10 @@ def human_text(result):
8384 title .append (fragment )
8485 if show_headers :
8586 summary .append (fragment + "\n " )
87+ rows = []
8688 for row in result ["removed" ]:
87- summary .append (human_row (row , prefix = " " ))
88- summary .append ("" )
89+ rows .append (human_row (row , prefix = " " ))
90+ summary .append ("\n \n " . join ( rows ) )
8991 summary .append ("" )
9092 return (", " .join (title ) + "\n \n " + ("\n " .join (summary ))).strip ()
9193
0 commit comments