本文整理汇总了Python中pyface.gui.GUI.set_trait_later方法的典型用法代码示例。如果您正苦于以下问题:Python GUI.set_trait_later方法的具体用法?Python GUI.set_trait_later怎么用?Python GUI.set_trait_later使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyface.gui.GUI
的用法示例。
在下文中一共展示了GUI.set_trait_later方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: progress
# 需要导入模块: from pyface.gui import GUI [as 别名]
# 或者: from pyface.gui.GUI import set_trait_later [as 别名]
def progress(self, value):
""" Set the progress of the operation (0 <= value <= 1). """
if self.dispatch == 'ui':
from pyface.gui import GUI
GUI.set_trait_later(self.promise, '_progress', value)
else:
with self.promise._lock:
self.promise._progress = value
示例2: error
# 需要导入模块: from pyface.gui import GUI [as 别名]
# 或者: from pyface.gui.GUI import set_trait_later [as 别名]
def error(self, value):
""" Complete the deferred with failure and specified result. """
if self.dispatch == 'ui':
from pyface.gui import GUI
promise = self.promise
GUI.set_trait_later(promise, '_error', value)
GUI.set_trait_later(promise, '_status', 'error')
else:
with self.promise._lock:
self.promise._error = value
self.promise._status = 'error'
示例3: done
# 需要导入模块: from pyface.gui import GUI [as 别名]
# 或者: from pyface.gui.GUI import set_trait_later [as 别名]
def done(self, value):
""" Complete the deferred with success and specified result.
and set the progress to 1.0
"""
if self.dispatch == 'ui':
from pyface.gui import GUI
promise = self.promise
GUI.set_trait_later(promise, '_result', value)
GUI.set_trait_later(promise, '_progress', 1.0)
GUI.set_trait_later(promise, '_status', 'done')
else:
with self.promise._lock:
self.promise._result = value
self.promise._progress = 1.0
self.promise._status = 'done'