本文整理汇总了Python中winpython.qt.QtGui.QMessageBox.warning方法的典型用法代码示例。如果您正苦于以下问题:Python QMessageBox.warning方法的具体用法?Python QMessageBox.warning怎么用?Python QMessageBox.warning使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类winpython.qt.QtGui.QMessageBox
的用法示例。
在下文中一共展示了QMessageBox.warning方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: add_packages
# 需要导入模块: from winpython.qt.QtGui import QMessageBox [as 别名]
# 或者: from winpython.qt.QtGui.QMessageBox import warning [as 别名]
def add_packages(self, fnames):
"""Add packages"""
notsupported = []
notcompatible = []
dist = self.distribution
for fname in fnames:
bname = osp.basename(fname)
try:
package = wppm.Package(fname)
if package.is_compatible_with(dist):
self.add_package(package)
else:
notcompatible.append(bname)
except NotImplementedError:
notsupported.append(bname)
# PyQt4 old SIGNAL: self.emit(SIGNAL('package_added()'))
self.package_added.emit()
if notsupported:
QMessageBox.warning(
self,
"Warning",
"The following packages filenaming are <b>not "
"recognized</b> by %s:\n\n%s" % (self.winname, "<br>".join(notsupported)),
QMessageBox.Ok,
)
if notcompatible:
QMessageBox.warning(
self,
"Warning",
"The following packages "
"are <b>not compatible</b> with "
"Python <u>%s %dbit</u>:\n\n%s" % (dist.version, dist.architecture, "<br>".join(notcompatible)),
QMessageBox.Ok,
)
示例2: select_directory
# 需要导入模块: from winpython.qt.QtGui import QMessageBox [as 别名]
# 或者: from winpython.qt.QtGui.QMessageBox import warning [as 别名]
def select_directory(self):
"""Select directory"""
basedir = to_text_string(self.line_edit.text())
if not osp.isdir(basedir):
basedir = getcwd()
while True:
directory = getexistingdirectory(self, self.TITLE, basedir)
if not directory:
break
if not utils.is_python_distribution(directory):
QMessageBox.warning(self, self.TITLE,
"The following directory is not a Python distribution.",
QMessageBox.Ok)
basedir = directory
continue
directory = osp.abspath(osp.normpath(directory))
self.set_distribution(directory)
self.emit(SIGNAL('selected_distribution(QString)'), directory)
break
示例3: unregister_distribution
# 需要导入模块: from winpython.qt.QtGui import QMessageBox [as 别名]
# 或者: from winpython.qt.QtGui.QMessageBox import warning [as 别名]
def unregister_distribution(self):
"""Unregister distribution"""
answer = QMessageBox.warning(self, "Unregister distribution",
"This will remove file extensions associations, icons and "
"Windows explorer's context menu entries ('Edit with IDLE', ...) "
"with selected Python distribution in Windows registry. "
"<br>Shortcuts for all WinPython launchers will be removed "
"from <i>WinPython</i> Start menu group."
"<br>If <i>pywin32</i> is installed (it should be on any "
"WinPython distribution), the Python ActiveX Scripting client "
"will also be unregistered."
"<br><br>Do you want to continue?",
QMessageBox.Yes | QMessageBox.No)
if answer == QMessageBox.Yes:
associate.unregister(self.distribution.target)
示例4: register_distribution
# 需要导入模块: from winpython.qt.QtGui import QMessageBox [as 别名]
# 或者: from winpython.qt.QtGui.QMessageBox import warning [as 别名]
def register_distribution(self):
"""Register distribution"""
answer = QMessageBox.warning(self, "Register distribution",
"This will associate file extensions, icons and "
"Windows explorer's context menu entries ('Edit with IDLE', ...) "
"with selected Python distribution in Windows registry. "
"<br>Shortcuts for all WinPython launchers will be installed "
"in <i>WinPython</i> Start menu group (replacing existing "
"shortcuts)."
"<br>If <i>pywin32</i> is installed (it should be on any "
"WinPython distribution), the Python ActiveX Scripting client "
"will also be registered."
"<br><br><u>Warning</u>: the only way to undo this change is to "
"register another Python distribution to Windows registry."
"<br><br><u>Note</u>: these actions are exactly the same as those "
"performed when installing Python with the official installer "
"for Windows.<br><br>Do you want to continue?",
QMessageBox.Yes | QMessageBox.No)
if answer == QMessageBox.Yes:
associate.register(self.distribution.target)