~bdrung/apport/cleanup

« back to all changes in this revision

Viewing changes to apport/ui.py

  • Committer: Benjamin Drung
  • Date: 2020-08-20 16:18:28 UTC
  • Revision ID: bdrung@ubuntu.com-20200820161828-0buhuyin92f43pqa
Resolve pycodestyle issues

Import changes from apport 2.20.11-0ubuntu7 (from Brian Murray).

Show diffs side-by-side

added added

removed removed

Lines of Context:
711
711
                self.ui_error_message(_('Invalid problem report'), excstr(e))
712
712
            return True
713
713
        elif self.options.window:
714
 
                self.ui_info_message('', _('After closing this message '
715
 
                                           'please click on an application window to report a problem about it.'))
716
 
                xprop = subprocess.Popen(['xprop', '_NET_WM_PID'],
717
 
                                         stdout=subprocess.PIPE, stderr=subprocess.PIPE)
718
 
                (out, err) = xprop.communicate()
719
 
                if xprop.returncode == 0:
720
 
                    try:
721
 
                        self.options.pid = int(out.split()[-1])
722
 
                    except ValueError:
723
 
                        self.ui_error_message(_('Cannot create report'),
724
 
                                              _('xprop failed to determine process ID of the window'))
725
 
                        return True
726
 
                    return self.run_report_bug()
727
 
                else:
 
714
            self.ui_info_message('', _('After closing this message '
 
715
                                       'please click on an application window to report a problem about it.'))
 
716
            xprop = subprocess.Popen(['xprop', '_NET_WM_PID'],
 
717
                                     stdout=subprocess.PIPE, stderr=subprocess.PIPE)
 
718
            (out, err) = xprop.communicate()
 
719
            if xprop.returncode == 0:
 
720
                try:
 
721
                    self.options.pid = int(out.split()[-1])
 
722
                except ValueError:
728
723
                    self.ui_error_message(_('Cannot create report'),
729
 
                                          _('xprop failed to determine process ID of the window') + '\n\n' + err)
 
724
                                          _('xprop failed to determine process ID of the window'))
730
725
                    return True
 
726
                return self.run_report_bug()
 
727
            else:
 
728
                self.ui_error_message(_('Cannot create report'),
 
729
                                      _('xprop failed to determine process ID of the window') + '\n\n' + err)
 
730
                return True
731
731
        else:
732
732
            return self.run_crashes()
733
733