system ('convert -depth 8 -crop %dx%d+0+0 %s %s/crop1.png' % (dims + (old, dir)))
system ('convert -depth 8 -crop %dx%d+0+0 %s %s/crop2.png' % (dims + (new, dir)))
- system ('compare -depth 8 -dissimilarity-threshold 1 %(dir)s/crop1.png %(dir)s/crop2.png %(dir)s/diff.png' % locals ())
+ system1 ('compare -depth 8 -dissimilarity-threshold 1 %(dir)s/crop1.png %(dir)s/crop2.png %(dir)s/diff.png' % locals ())
system ("convert -depth 8 %(dir)s/diff.png -blur 0x3 -negate -channel alpha,blue -type TrueColorMatte -fx 'intensity' %(dir)s/matte.png" % locals ())
stat = os.system (x)
assert stat == 0
+def system1 (x):
+# Allow exit status 0 and 1
+ print 'invoking', x
+ stat = os.system (x)
+ assert (stat == 0) or (stat == 256) # This return value convention is sick.
+
def test_paired_files ():
print paired_files (os.environ["HOME"] + "/src/lilypond/scripts/",