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


Python Recorder.imageFileToPath方法代码示例

本文整理汇总了Python中recorder.Recorder.imageFileToPath方法的典型用法代码示例。如果您正苦于以下问题:Python Recorder.imageFileToPath方法的具体用法?Python Recorder.imageFileToPath怎么用?Python Recorder.imageFileToPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在recorder.Recorder的用法示例。


在下文中一共展示了Recorder.imageFileToPath方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: play

# 需要导入模块: from recorder import Recorder [as 别名]
# 或者: from recorder.Recorder import imageFileToPath [as 别名]
    def play(self):
        from recorder import Recorder
        if len(self.filenames) == 1:
            img = Recorder.imageFileToPath(self.filenames[0])
            if not os.path.exists(img):
                snapshot.snapWindow(self.title, img)
                return "message: " + "check point image file " + img + \
                       " doesn't exist and has been created"

            tempfile = 'snapshots/checkpoint.png'
            snapshot.snapWindow(self.title, tempfile)

            if not snapshot.compareSnapshots(img, tempfile):
                return "error: " + "checkpoint fails: " + tempfile + \
                       " is inconsistent with " + img

            # delete temp file
            os.remove(os.path.realpath(tempfile))
            
        else: # this is a temporary behavior modification
            match = False
            tempfile = 'snapshots/checkpoint.png'
            snapshot.snapWindow(self.title, tempfile)
            
            for i in self.filenames:
                img = Recorder.imageFileToPath(i)
                if not os.path.exists(img):
                    return "message: check point image file " + img + \
                           " doesn't exist"

                if snapshot.compareSnapshots(img, tempfile):
                   match = True
                   break
                
            if not match:
                return "error: checkpoint fails: " + tempfile + \
                       " matches none of the image files"
开发者ID:cottyard,项目名称:Mighty-Test,代码行数:39,代码来源:operations.py


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