本文整理汇总了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"