当前位置: 首页>>代码示例>>Python>>正文


Python msgbox.information函数代码示例

本文整理汇总了Python中qutebrowser.misc.msgbox.information函数的典型用法代码示例。如果您正苦于以下问题:Python information函数的具体用法?Python information怎么用?Python information使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了information函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: on_version_error

    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)
开发者ID:The-Compiler,项目名称:qutebrowser,代码行数:14,代码来源:crashdialog.py

示例2: on_version_success

    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)
开发者ID:The-Compiler,项目名称:qutebrowser,代码行数:16,代码来源:crashdialog.py

示例3: test_information

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
开发者ID:michaelbeaumont,项目名称:qutebrowser,代码行数:7,代码来源:test_msgbox.py

示例4: test_no_err_windows

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'
开发者ID:Harrison97,项目名称:qutebrowser,代码行数:7,代码来源:test_msgbox.py

示例5: test_information

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
开发者ID:Harrison97,项目名称:qutebrowser,代码行数:7,代码来源:test_msgbox.py

示例6: on_version_success

    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)
开发者ID:xetch,项目名称:qutebrowser,代码行数:19,代码来源:crashdialog.py


注:本文中的qutebrowser.misc.msgbox.information函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。