Esempio n. 1
0
 def add_task_args(self, task):
     for t in ids_to_tasks(task).split(','):
         agent = get_task_module(t)
         try:
             if hasattr(agent, 'add_cmdline_args'):
                 agent.add_cmdline_args(self)
         except argparse.ArgumentError:
             # already added
             pass
Esempio n. 2
0
 def add_task_args(self, args=None):
     # Find which task specified, and add its specific arguments.
     args = sys.argv if args is None else args
     task = None
     for index, item in enumerate(args):
         if item == '-t' or item == '--task':
             task = args[index + 1]
     if task:
         for t in ids_to_tasks(task).split(','):
             agent = get_task_module(t)
             if hasattr(agent, 'add_cmdline_args'):
                 agent.add_cmdline_args(self)
Esempio n. 3
0
 def add_task_args(self, args):
     # Find which task specified, and add its specific arguments.
     args = sys.argv if args is None else args
     task = None
     for index, item in enumerate(args):
         if item == '-t' or item == '--task':
             task = args[index + 1]
     if task:
         for t in ids_to_tasks(task).split(','):
             agent = get_task_module(t)
             if hasattr(agent, 'add_cmdline_args'):
                 agent.add_cmdline_args(self)