Commits

Ryan Wilcox committed 4a8b0f0

setup_app now has same filter abilities as setup_project

Comments (0)

Files changed (1)

     projectname = options["args"][0]
     selector = (options["args"][1] if len( options["args"] ) > 1  else None)
     
-    task_list, return_now = _filter_steps(projectname, selector, setups.project_setup_task_list)
-    
+    task_list, return_now = _filter_steps("paver setup_project " +projectname, selector, setups.project_setup_task_list)
     if return_now: return
     
     for info, our_callable, options in task_list:
 @task
 @consume_args
 def setup_app(options, info):
-    """Run the APPLICATION setup declared, or use the second parameter to specify exactly which one"""
+    """Run the APPLICATION setup declared. Must also specify the app name to run the command on.
+    Suppling a third parameter will limit the setup to a single step: --help to see a description of steps available
+    """
+    
     projectname = options["args"][0]
     appname = options["args"][1]
+    selector = (options["args"][1] if len( options["args"] ) > 1  else None)
     
-    for info, our_callable, options in setups.app_setup_task_list:
+    task_list, return_now = _filter_steps("paver setup_app %s %s" % (projectname, appname),
+            selector, setups.app_setup_task_list)
+    if return_now: return
+    
+    for info, our_callable, options in task_list:
         call_it = True
         if options.get("optional", False):
             answer = raw_input(info + " [yes] no: ")
     for task in task_list: 
         print task.shortname
 
-def _filter_steps(projectname, selector, tasks):
+def _filter_steps(command_prefix, selector, tasks):
     if selector == "--help":
         print "The following subcommands are available:"
         print
         
-        for info, our_callable, options in setups.project_setup_task_list:
-            print "paver setup_project %(projectname)s %(optionname)s" % dict(
-                    projectname=projectname, optionname=our_callable.__name__)
+        for info, our_callable, options in tasks:
+            print "%(command)s %(optionname)s" % dict(
+                    command=command_prefix, optionname=our_callable.__name__)
             print "    * " + info
         return [], True