WIP: feature/cleanup_programming_interface #40

Draft
Hazel wants to merge 35 commits from feature/cleanup_programming_interface into experimental
Showing only changes of commit 413d422e2f - Show all commits

View File

@ -254,13 +254,13 @@ class DataObjectSelect(Select):
def __iter__(self):
source_types = list(sorted(self._source_type_to_data_objects.keys(), key=lambda x: x.name))
has_limit = len(source_types) > 1
single_source = len(source_types) > 1
for st in source_types:
if has_limit:
if single_source:
yield self._source_type_to_option[st]
limit = min(15, len(self._source_type_to_data_objects[st])) if has_limit else len(self._source_type_to_data_objects[st])
limit = min(15, len(self._source_type_to_data_objects[st])) if single_source else len(self._source_type_to_data_objects[st])
for i in range(limit):
yield self._source_type_to_data_objects[st][i]