Conditions | 7 |
Total Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 1 | Features | 0 |
1 | from intelligine.core.exceptions import NearNothingFound |
||
13 | def map(self, context, parameters, stop_at_first=False, filter=lambda near_object_id, context: True): |
||
14 | parameters[self._near_name] = [] |
||
15 | for near_object_id in parameters['objects_ids_near']: |
||
16 | if self._near_map(near_object_id, context) and filter(near_object_id, context): |
||
17 | parameters[self._near_name].append(near_object_id) |
||
18 | if stop_at_first: |
||
19 | return |
||
20 | if not parameters[self._near_name]: |
||
21 | raise NearNothingFound() |
||
22 |