changeset 682:3fe1024377ca

STUB: python/unroll_deps.py
author Jeff Hammel <k0scist@gmail.com>
date Tue, 13 May 2014 13:02:45 -0700
parents bc1f4762027b
children ce95c61cb435
files python/unroll_deps.py
diffstat 1 files changed, 14 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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()