@@ -65,6 +65,7 @@ def json_delta_to_csv(json_input, csv_output):
6565 delta_results = load_deltas (json_input )
6666
6767 headers = OrderedDict ([
68+ ('Status' , []),
6869 ('Score' , []),
6970 ('Factors' , []),
7071 ('Path' , []),
@@ -86,6 +87,7 @@ def json_delta_to_csv(json_input, csv_output):
8687def flatten_deltas (deltas , headers ):
8788 if len (deltas ) < 1 :
8889 yield OrderedDict ([
90+ ('Status' , '' ),
8991 ('Score' , '' ),
9092 ('Factors' , '' ),
9193 ('Path' , '' ),
@@ -103,14 +105,15 @@ def flatten_deltas(deltas, headers):
103105 old = {}
104106
105107 yield OrderedDict ([
108+ ('Status' , delta .get ('status' )),
106109 ('Score' , delta .get ('score' )),
107110 ('Factors' , ' ' .join (delta .get ('factors' ))),
108- ('Path' , new .get ('path ' , old .get ('path ' ))),
111+ ('Path' , new .get ('original_path ' , old .get ('original_path ' ))),
109112 ('Name' , new .get ('name' , old .get ('name' ))),
110113 ('Type' , new .get ('type' , old .get ('type' ))),
111114 ('Size' , new .get ('size' , old .get ('size' ))),
112115 # TODO: Need better way to ID 'moved' deltas.
113- ('Old Path' , old .get ('path ' ) if 'moved' in delta .get ('factors ' ) else '' ),
116+ ('Old Path' , old .get ('original_path ' ) if 'moved' == delta .get ('status ' ) else '' ),
114117 ])
115118
116119
0 commit comments