[demo] For testing purpose, run only the given demo
authorSimon Chabot <simon.chabot@logilab.fr>
Thu, 08 Nov 2012 10:07:56 +0100
changeset 90 8cde0f370180
parent 89 fd1d48044729
child 91 b24c0407d660
[demo] For testing purpose, run only the given demo
demo.py
--- a/demo.py	Thu Nov 08 10:07:21 2012 +0100
+++ b/demo.py	Thu Nov 08 10:07:56 2012 +0100
@@ -115,12 +115,20 @@
                                 #   result file
 
 if __name__ == '__main__':
-    print "Running demo_0"
-    demo_0()
+    import sys
+    runall = (len(sys.argv) == 1)
+
+    if runall or '0' in sys.argv:
+        print "Running demo_0"
+        demo_0()
 
-    print "Running demo_1"
-    demo_1()
+    if runall or '1' in sys.argv:
+        print "Running demo_1"
+        demo_1()
 
-    print "Running demo_2"
-    ## Same as demo_1, but in a more efficient way, using a KDTree
-    demo_2()
+    if runall or '2' in sys.argv:
+        print "Running demo_2"
+        ## Same as demo_1, but in a more efficient way, using a KDTree
+        demo_2()
+
+    print "Demo terminated"