# HG changeset patch # User Jeff Hammel # Date 1336490815 25200 # Node ID 192015ae3e4c3e21522f6e7450923ce5d7c3ccf6 # Parent 4390ca34912cbca465a3d3fbabc4599edb3a827f add ymldiff.py, requires datadiff and pyyaml to be installed diff -r 4390ca34912c -r 192015ae3e4c python/ymldiff.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/python/ymldiff.py Tue May 08 08:26:55 2012 -0700 @@ -0,0 +1,22 @@ +#!/usr/bin/env python + +import datadiff +imoprt optparse +import sys +import yaml + +def main(args=sys.argv[1:]): + usage = '%prog [options] from.yml to.yml' + parser = OptionParser(usage=usage) + options, args = parser.parse_args() + if len(args) != 2: + parser.error("Please supply two .yml files") + + # compare the output + output0 = yaml.load(file(args[0])) + output1 = yaml.load(file(args[1])) + diff = datadiff.diff(output0, output1, context=1, fromfile=args[0], tofile=args[1]) + print diff + +if __name__ == '__main__': + main()