@@ -201,6 +201,16 @@ class _BaseOutput(object):
201201
202202 refresh_rate = 1
203203
204+ def _report_complete (self , item , asset , path = None ):
205+ msg = {
206+ 'item' : item ['id' ],
207+ 'asset' : asset ['type' ],
208+ 'location' : path or asset ['location' ]
209+ }
210+ # cancel() allows report log to persist for both ANSI & regular output
211+ self .cancel ()
212+ click .echo (json .dumps (msg ))
213+
204214 def __init__ (self , thread , dl ):
205215 self ._thread = thread
206216 self ._timer = None
@@ -231,14 +241,6 @@ def cancel(self):
231241
232242class Output (_BaseOutput ):
233243
234- def _report_complete (self , item , asset , path = None ):
235- msg = {
236- 'item' : item ['id' ],
237- 'asset' : asset ['type' ],
238- 'location' : path or asset ['location' ]
239- }
240- click .echo (json .dumps (msg ))
241-
242244 def _output (self , stats ):
243245 logging .info ('%s' , stats )
244246
@@ -276,9 +278,6 @@ def _output(self, stats):
276278 self ._stats .update (stats )
277279 self ._do_output ()
278280
279- def _report_complete (self , item , asset , path = None ):
280- pass
281-
282281 def _do_output (self ):
283282 # renders a terminal like:
284283 # highlighted status rows
0 commit comments