本文整理汇总了Python中gui.Gui.displayWarning方法的典型用法代码示例。如果您正苦于以下问题:Python Gui.displayWarning方法的具体用法?Python Gui.displayWarning怎么用?Python Gui.displayWarning使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gui.Gui
的用法示例。
在下文中一共展示了Gui.displayWarning方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from gui import Gui [as 别名]
# 或者: from gui.Gui import displayWarning [as 别名]
def main(argv=argv, cfg_file=cfg_file, update=1):
"""
The function is the client entry point.
"""
start_dir = os.getcwd()
os.chdir(join(start_dir, dirname(argv[0]), dirname(cfg_file)))
cfg_file = join(os.getcwd(), os.path.basename(cfg_file))
loadConfiguration(cfg_file)
os.chdir(start_dir)
path.append(config['servers']['path'])
path.append(config['configobj']['path'])
# this import must stay here, after the appending of configobj path to path
import storage
storage.init(config['storage']['path'])
# this import must stay here, after the appending of configobj path to path
from gui import Gui
try:
app = QApplication([])
app.setStyle(QStyleFactory.create("Cleanlooks"))
gui = Gui(cfg_file)
if not update:
gui.displayWarning(PROJECT_NAME, gui._text['UpdateFail'])
gui.show()
exit(app.exec_())
except Exception, e:
print 'Fatal Exception:', e
info = getExceptionInfo()
fd = open(join(config['exceptions']['save_path'], 'exception.txt'), 'a+')
fd.write(info)
fd.close()
if config['exceptions']['send_email']:
try:
sendMail("DevClient fatal exception: %s" % e, info)
except Exception, e:
print 'Error while sending email:', e