本文整理汇总了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)
示例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)
示例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
示例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'
示例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
示例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)