def _list_format_contributions(self, directed=True): result = [] for attribute_tuple in self._get_attribute_tuples(): if len(attribute_tuple) == 2: grob = None attribute = attribute_tuple[0] value = attribute_tuple[1] elif len(attribute_tuple) == 3: grob = attribute_tuple[0] attribute = attribute_tuple[1] value = attribute_tuple[2] else: message = f"invalid attribute tuple: {attribute_tuple!r}." raise ValueError(message) deactivate = False if isinstance(value, tuple) and value[0] == "TAGGED": if len(value) == 4: deactivate = value[3] tag = value[2] value = value[1] else: tag = None string = LilyPondFormatManager.make_lilypond_tweak_string( attribute, value, directed=directed, grob=grob ) if tag is not None: strings = [string] strings = LilyPondFormatManager.tag( strings, deactivate=deactivate, tag=tag ) string = strings[0] result.append(string) result.sort() return result
def _list_format_contributions(self, directed=True): result = [] for attribute_tuple in self._get_attribute_tuples(): if len(attribute_tuple) == 2: grob = None attribute = attribute_tuple[0] value = attribute_tuple[1] elif len(attribute_tuple) == 3: grob = attribute_tuple[0] attribute = attribute_tuple[1] value = attribute_tuple[2] else: message = f"invalid attribute tuple: {attribute_tuple!r}." raise ValueError(message) deactivate = False if isinstance(value, tuple) and value[0] == "TAGGED": if len(value) == 4: deactivate = value[3] tag = value[2] value = value[1] else: tag = None string = LilyPondFormatManager.make_lilypond_tweak_string( attribute, value, directed=directed, grob=grob) if tag is not None: strings = [string] strings = LilyPondFormatManager.tag(strings, deactivate=deactivate, tag=tag) string = strings[0] result.append(string) result.sort() return result
def _list_format_contributions(self, directed=True): result = [] for attribute_tuple in self._get_attribute_tuples(): if len(attribute_tuple) == 2: grob = None attribute = attribute_tuple[0] value = attribute_tuple[1] elif len(attribute_tuple) == 3: grob = attribute_tuple[0] attribute = attribute_tuple[1] value = attribute_tuple[2] else: message = 'invalid attribute tuple: {attribute_tuple!r}.' raise ValueError(message) string = LilyPondFormatManager.make_lilypond_tweak_string( attribute, value, directed=directed, grob=grob, ) result.append(string) result.sort() return result