def load(self) -> Iterator[CSFSlider]: """load() Loads all Sliders. :return: An iterable of Sliders. :rtype: Iterator[CSFSlider] """ snippet_names: Tuple[str] = self.snippet_names for snippet_package in CommonResourceUtils.load_instances_with_any_tags( Types.SNIPPET, snippet_names): try: sliders: Tuple[CSFSlider] = tuple(self._load(snippet_package)) for slider in sliders: slider: CSFSlider = slider if slider is None: continue (is_valid_result, is_valid_reason) = slider.is_valid() if is_valid_result: yield slider except Exception as ex: self.log.format_error( 'Error while parsing sliders from \'{}\''.format( snippet_package), exception=ex)
def _load_outfit_parts_from_packages_gen(self) -> Iterator[OCOutfitPart]: self.log.debug('Loading outfit parts from packages.') outfit_part_collections = CommonResourceUtils.load_instances_with_any_tags( Types.SNIPPET, ('outfit_parts_list', )) for outfit_part_collection in outfit_part_collections: for package_outfit_part in outfit_part_collection.outfit_parts_list: outfit_part = OCOutfitPart.load_from_package( package_outfit_part, self.log) if outfit_part is None: continue yield outfit_part