Returns the next task that meets the iteration conditions, starting from the root by default. Parameters: first_task (`Task`): search beginning from this task Notes: Other keyword args are passed directly into `get_tasks_iterator` Returns:
(self, first_task=None, **kwargs)
| 106 | return [t for t in self.get_tasks_iterator(first_task, **kwargs)] |
| 107 | |
| 108 | def get_next_task(self, first_task=None, **kwargs): |
| 109 | """Returns the next task that meets the iteration conditions, starting from the root by default. |
| 110 | |
| 111 | Parameters: |
| 112 | first_task (`Task`): search beginning from this task |
| 113 | |
| 114 | Notes: |
| 115 | Other keyword args are passed directly into `get_tasks_iterator` |
| 116 | |
| 117 | Returns: |
| 118 | `Task` or None: the first task that meets the conditions or None if no tasks match |
| 119 | """ |
| 120 | iter = self.get_tasks_iterator(first_task, **kwargs) |
| 121 | try: |
| 122 | return next(iter) |
| 123 | except StopIteration: |
| 124 | return None |
| 125 | |
| 126 | def get_tasks_iterator(self, first_task=None, **kwargs): |
| 127 | """Returns an iterator of Tasks that meet the conditions specified `kwargs`, starting from the root by default. |