Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions planet/scripts/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,16 @@ class _BaseOutput(object):

refresh_rate = 1

def _report_complete(self, item, asset, path=None):
msg = {
'item': item['id'],
'asset': asset['type'],
'location': path or asset['location']
}
# cancel() allows report log to persist for both ANSI & regular output
self.cancel()
click.echo(json.dumps(msg))

def __init__(self, thread, dl):
self._thread = thread
self._timer = None
Expand Down Expand Up @@ -228,14 +238,6 @@ def cancel(self):

class Output(_BaseOutput):

def _report_complete(self, item, asset, path=None):
msg = {
'item': item['id'],
'asset': asset['type'],
'location': path or asset['location']
}
click.echo(json.dumps(msg))

def _output(self, stats):
logging.info('%s', stats)

Expand Down Expand Up @@ -273,9 +275,6 @@ def _output(self, stats):
self._stats.update(stats)
self._do_output()

def _report_complete(self, item, asset, path=None):
pass

def _do_output(self):
# renders a terminal like:
# highlighted status rows
Expand Down