当前位置: 首页>>代码示例>>Python>>正文


Python Window.showSuccess方法代码示例

本文整理汇总了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()
开发者ID:acadet,项目名称:groopster,代码行数:54,代码来源:boot.py


注:本文中的window.Window.showSuccess方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。