Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion testing/checkimage.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import vtk
import os
import os.path
import re
import sys
import logging

Expand Down Expand Up @@ -40,13 +41,15 @@ def image_from_file(fname):
print "Problem opening file '%s': %s"%(fname,err)
return None

# find alternate baselines for fname of the form basename_d.ext
# where fname = basename.ext and d is a digit between 1 and 9
def find_alternates(fname):
dirname = os.path.dirname(fname)
prefix, ext = os.path.splitext(os.path.split(fname)[1])
files = os.listdir(dirname)
results = [fname]
for i in files:
if i.startswith(prefix) and i.endswith(ext) and i != prefix+ext:
if (re.match(prefix + '_[1-9]' + ext, i)):
results.append(os.path.join(dirname, i))
return results

Expand Down