コード例 #1
0
ファイル: crashdialog.py プロジェクト: zfenj/qutebrowser
    def on_version_error(self, msg):
        """Called when the version was not obtained from self._pypi_client.

        Args:
            msg: The error message to show.
        """
        lines = ['The report has been sent successfully. Thanks!']
        lines.append("There was an error while getting the newest version: "
                     "{}. Please check for a new version on "
                     "<a href=https://www.qutebrowser.org/>qutebrowser.org</a> "
                     "by yourself.".format(msg))
        text = '<br/><br/>'.join(lines)
        msgbox.information(self, "Report successfully sent!", text,
                           on_finished=self.finish, plain_text=False)
コード例 #2
0
ファイル: test_msgbox.py プロジェクト: xijia37/qutebrowser
def test_information(qtbot):
    box = msgbox.information(parent=None, title='foo', text='bar')
    qtbot.add_widget(box)
    if sys.platform != 'darwin':
        assert box.windowTitle() == 'foo'
    assert box.text() == 'bar'
    assert box.icon() == QMessageBox.Information
コード例 #3
0
ファイル: crashdialog.py プロジェクト: zfenj/qutebrowser
    def on_version_success(self, newest):
        """Called when the version was obtained from self._pypi_client.

        Args:
            newest: The newest version as a string.
        """
        new_version = pkg_resources.parse_version(newest)
        cur_version = pkg_resources.parse_version(qutebrowser.__version__)
        lines = ['The report has been sent successfully. Thanks!']
        if new_version > cur_version:
            lines.append("<b>Note:</b> The newest available version is v{}, "
                         "but you're currently running v{} - please "
                         "update!".format(newest, qutebrowser.__version__))
        text = '<br/><br/>'.join(lines)
        msgbox.information(self, "Report successfully sent!", text,
                           on_finished=self.finish, plain_text=False)
コード例 #4
0
ファイル: test_msgbox.py プロジェクト: mdavis36/qutebrowser
def test_no_err_windows(fake_args, capsys):
    fake_args.no_err_windows = True
    box = msgbox.information(parent=None, title='foo', text='bar')
    box.exec()  # should do nothing
    out, err = capsys.readouterr()
    assert not out
    assert err == 'Message box: foo; bar\n'
コード例 #5
0
ファイル: test_msgbox.py プロジェクト: mdavis36/qutebrowser
def test_information(qtbot):
    box = msgbox.information(parent=None, title='foo', text='bar')
    qtbot.add_widget(box)
    if not utils.is_mac:
        assert box.windowTitle() == 'foo'
    assert box.text() == 'bar'
    assert box.icon() == QMessageBox.Information
コード例 #6
0
ファイル: test_msgbox.py プロジェクト: Harrison97/qutebrowser
def test_no_err_windows(fake_args, capsys):
    fake_args.no_err_windows = True
    box = msgbox.information(parent=None, title='foo', text='bar')
    box.exec_()  # should do nothing
    out, err = capsys.readouterr()
    assert not out
    assert err == 'Message box: foo; bar\n'
コード例 #7
0
ファイル: test_msgbox.py プロジェクト: Harrison97/qutebrowser
def test_information(qtbot):
    box = msgbox.information(parent=None, title='foo', text='bar')
    qtbot.add_widget(box)
    if not utils.is_mac:
        assert box.windowTitle() == 'foo'
    assert box.text() == 'bar'
    assert box.icon() == QMessageBox.Information
コード例 #8
0
ファイル: crashdialog.py プロジェクト: xetch/qutebrowser
    def on_version_success(self, newest):
        """Called when the version was obtained from self._pypi_client.

        Args:
            newest: The newest version as a string.
        """
        # pylint: disable=no-member
        # https://bitbucket.org/logilab/pylint/issue/73/
        new_version = distutils.version.StrictVersion(newest)
        cur_version = distutils.version.StrictVersion(qutebrowser.__version__)
        lines = ['The report has been sent successfully. Thanks!']
        if new_version > cur_version:
            lines.append("<b>Note:</b> The newest available version is v{}, "
                         "but you're currently running v{} - please "
                         "update!".format(newest, qutebrowser.__version__))
        text = '<br/><br/>'.join(lines)
        self.hide()
        msgbox.information(self, "Report successfully sent!", text,
                           on_finished=self.finish, plain_text=False)
コード例 #9
0
ファイル: crashdialog.py プロジェクト: andor44/qutebrowser
    def on_version_success(self, newest):
        """Called when the version was obtained from self._pypi_client.

        Args:
            newest: The newest version as a string.
        """
        # pylint: disable=no-member
        # https://bitbucket.org/logilab/pylint/issue/73/
        new_version = distutils.version.StrictVersion(newest)
        cur_version = distutils.version.StrictVersion(qutebrowser.__version__)
        lines = ['The report has been sent successfully. Thanks!']
        if new_version > cur_version:
            lines.append("<b>Note:</b> The newest available version is v{}, "
                         "but you're currently running v{} - please "
                         "update!".format(newest, qutebrowser.__version__))
        text = '<br/><br/>'.join(lines)
        self.hide()
        msgbox.information(self,
                           "Report successfully sent!",
                           text,
                           on_finished=self.finish,
                           plain_text=False)
コード例 #10
0
def test_no_err_windows(fake_args, caplog):
    fake_args.no_err_windows = True
    box = msgbox.information(parent=None, title='foo', text='bar')
    box.exec()  # should do nothing
    assert caplog.messages == ['foo\n\nbar']