# HG changeset patch # User Jeff Hammel # Date 1477699744 25200 # Node ID 26786fae0703d05bcb6d115cafa4cb7c515925f5 # Parent 5364185dcb9b79cff1324ae537dceb8758d91ad5 this relies on a requirement that is not part of my (2.7.12) stdlib; i almost deleted it. instead, i will keep for fun and note the requirement for further research diff -r 5364185dcb9b -r 26786fae0703 python/example/ymldiff.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/python/example/ymldiff.py Fri Oct 28 17:09:04 2016 -0700 @@ -0,0 +1,22 @@ +#!/usr/bin/env python + +import datadiff +import optparse +import sys +import yaml + +def main(args=sys.argv[1:]): + usage = '%prog [options] from.yml to.yml' + parser = optparse.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() diff -r 5364185dcb9b -r 26786fae0703 python/ymldiff.py --- a/python/ymldiff.py Fri Oct 28 17:07:24 2016 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ -#!/usr/bin/env python - -import datadiff -import optparse -import sys -import yaml - -def main(args=sys.argv[1:]): - usage = '%prog [options] from.yml to.yml' - parser = optparse.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()