本文整理匯總了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'