本文整理汇总了Python中window.Window.showSuccess方法的典型用法代码示例。如果您正苦于以下问题:Python Window.showSuccess方法的具体用法?Python Window.showSuccess怎么用?Python Window.showSuccess使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类window.Window
的用法示例。
在下文中一共展示了Window.showSuccess方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from window import Window [as 别名]
# 或者: from window.Window import showSuccess [as 别名]
class Boot:
def __init__(self):
self.__threads = 0
self.__lock = Lock()
def start(self):
self.__window = Window(self)
self.__window.build()
self.__window.mainloop()
###
# Run when copying thread has encountered an error
###
def onCopyError(self, error):
print(traceback.format_exc(error))
self.__window.showError(error)
###
# Run when copying thread has ended
###
def onCopyEnd(self):
with self.__lock:
self.__threads -= 1
if self.__threads is 0:
# No more thread, copying engine has ended
self.__window.showSuccess()
###
# Called when user has launched system
###
def onRun(self, srcDir, targetDir, method):
# First: build file trees
originalTree = FileTree(srcDir)
targetTree = FileTree(targetDir)
originalTree.build()
targetTree.build()
# Now, launch copying engine
if method is '0':
copyEngine = CopyEngine(self, lambda x, y: True)
else:
copyEngine = CopyEngine(self, lambda x,y: x.getLatestEdition() > y.getLatestEdition())
outcome = copyEngine.run(srcDir, originalTree, targetDir, targetTree)
with self.__lock:
self.__threads += outcome
if self.__threads is 0:
# Copy engine has ended after copying threads, process is over
self.__window.showSuccess()