# HG changeset patch # User Jeff Hammel # Date 1400011365 25200 # Node ID 3fe1024377ca68e024100e1e3653229a679e84f0 # Parent bc1f4762027bdc68c60b074147b6edd826d67f62 STUB: python/unroll_deps.py diff -r bc1f4762027b -r 3fe1024377ca python/unroll_deps.py --- a/python/unroll_deps.py Tue May 13 13:00:18 2014 -0700 +++ b/python/unroll_deps.py Tue May 13 13:02:45 2014 -0700 @@ -1,5 +1,11 @@ #!/usr/bin/env python +""" +unroll a set of dependencies +""" + +import sys + def cycle_check(order, dependencies): """ensure no cyclic dependencies""" order_dict = dict([(j, i) for i, j in enumerate(order)]) @@ -55,7 +61,10 @@ return order -if __name__ == '__main__': + +### testing and CLI + +def main(args=sys.argv[:1]): # testing set of dependencies deps = {'packageA': set(['packageB', 'packageC', 'packageF']), @@ -77,9 +86,12 @@ raise Exception("Missed a cyclic dependency!") except AssertionError: pass - + try: unroll_dependencies2(deps) raise Exception("Missed a cyclic dependency!") except AssertionError: pass + +if __name__ == '__main__': + main()