diff options
-rw-r--r-- | plugin/launcher.py | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/plugin/launcher.py b/plugin/launcher.py index ee93728..d55117e 100644 --- a/plugin/launcher.py +++ b/plugin/launcher.py @@ -119,12 +119,12 @@ class Launcher(object): window = self._launches.pop(activity_id) window.destroy() - def _failure_report(self, props): - kwargs = {'context': props.get('context')} - if 'implementation' in props: - kwargs['implementation'] = props['implementation'] - if 'log_path' in props: - kwargs['filename'] = props['log_path'] + def _failure_report(self, event): + kwargs = {'context': event.get('context')} + if 'implementation' in event: + kwargs['implementation'] = event['implementation'] + if 'log_path' in event: + kwargs['filename'] = event['log_path'] get_browser().open_report(**kwargs) def __window_opened_cb(self, screen, window): @@ -155,17 +155,14 @@ class Launcher(object): def __progress_cb(self, source, cb_condition, pipe, activity_id): event = pipe.read() - _logger.debug('Execution progress for %r: %r', - activity_id, event or 'exit') if event is None: - self._stop_launcher(activity_id) return False - phase, props = event + _logger.debug('Execution progress for %r: %r', activity_id, event) try: - if phase == 'failure': + if event['state'] == 'failure': _logger.warning('Activity %r failed', activity_id) - self._failure_report(props) + self._stop_launcher(activity_id) + self._failure_report(event) except Exception: _logger.exception('Failed to process event') - return True |