Skip to content

Commit

Permalink
Cleaned up abjad.TremoloContainer open brace formatting. (#1585)
Browse files Browse the repository at this point in the history
Example:

    container = abjad.TremoloContainer(2, "c'16 e'")
    string = abjad.lilypond(container)
    print(string)

OLD:

    \repeat tremolo 2 {
        c'16
        e'16
    }

NEW:

    \repeat tremolo 2
    {
        c'16
        e'16
    }
  • Loading branch information
trevorbaca authored Apr 30, 2024
1 parent d1f222b commit 00838c7
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 28 deletions.
72 changes: 48 additions & 24 deletions abjad/get.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,12 +488,14 @@ def contents(argument) -> list[_score.Component]:
>>> print(string)
\new Staff
{
\repeat tremolo 2 {
\repeat tremolo 2
{
c'16
e'16
}
cs'4
\repeat tremolo 2 {
\repeat tremolo 2
{
d'16
f'16
}
Expand Down Expand Up @@ -856,12 +858,14 @@ def duration(
>>> print(string)
\new Staff
{
\repeat tremolo 2 {
\repeat tremolo 2
{
c'16
e'16
}
cs'4
\repeat tremolo 2 {
\repeat tremolo 2
{
d'16
f'16
}
Expand Down Expand Up @@ -1107,12 +1111,14 @@ def effective(
>>> print(string)
\new Staff
{
\repeat tremolo 2 {
\repeat tremolo 2
{
c'16
e'16
}
cs'4
\repeat tremolo 2 {
\repeat tremolo 2
{
\clef "alto"
d'16
f'16
Expand Down Expand Up @@ -2047,12 +2053,14 @@ def has_effective_indicator(
>>> print(string)
\new Staff
{
\repeat tremolo 2 {
\repeat tremolo 2
{
c'16
e'16
}
cs'4
\repeat tremolo 2 {
\repeat tremolo 2
{
\clef "alto"
d'16
f'16
Expand Down Expand Up @@ -2241,12 +2249,14 @@ def has_indicator(
>>> print(string)
\new Staff
{
\repeat tremolo 2 {
\repeat tremolo 2
{
c'16
e'16
}
cs'4
\repeat tremolo 2 {
\repeat tremolo 2
{
\clef "alto"
d'16
f'16
Expand Down Expand Up @@ -2438,12 +2448,14 @@ def indicator(
>>> print(string)
\new Staff
{
\repeat tremolo 2 {
\repeat tremolo 2
{
c'16
e'16
}
cs'4
\repeat tremolo 2 {
\repeat tremolo 2
{
\clef "alto"
d'16
f'16
Expand Down Expand Up @@ -2620,15 +2632,17 @@ def indicators(
>>> print(string)
\new Staff
{
\repeat tremolo 2 {
\repeat tremolo 2
{
c'16
- \staccato
e'16
- \staccato
}
cs'4
- \staccato
\repeat tremolo 2 {
\repeat tremolo 2
{
\clef "alto"
d'16
- \staccato
Expand Down Expand Up @@ -2919,12 +2933,14 @@ def leaf(argument, n: int = 0) -> typing.Optional["_score.Leaf"]:
>>> print(string)
\new Staff
{
\repeat tremolo 2 {
\repeat tremolo 2
{
c'16
e'16
}
cs'4
\repeat tremolo 2 {
\repeat tremolo 2
{
d'16
f'16
}
Expand Down Expand Up @@ -3270,12 +3286,14 @@ def logical_tie(argument) -> "_select.LogicalTie":
>>> print(string)
\new Staff
{
\repeat tremolo 2 {
\repeat tremolo 2
{
c'16
e'16
}
cs'4
\repeat tremolo 2 {
\repeat tremolo 2
{
d'16
f'16
}
Expand Down Expand Up @@ -3544,12 +3562,14 @@ def measure_number(argument) -> int:
>>> print(string)
\new Staff
{
\repeat tremolo 2 {
\repeat tremolo 2
{
c'16
e'16
}
cs'4
\repeat tremolo 2 {
\repeat tremolo 2
{
d'16
f'16
}
Expand Down Expand Up @@ -3811,12 +3831,14 @@ def parentage(argument) -> "_parentage.Parentage":
>>> print(string)
\new Staff
{
\repeat tremolo 2 {
\repeat tremolo 2
{
c'16
e'16
}
cs'4
\repeat tremolo 2 {
\repeat tremolo 2
{
d'16
f'16
}
Expand Down Expand Up @@ -4286,12 +4308,14 @@ def timespan(argument, in_seconds: bool = False) -> _timespan.Timespan:
>>> print(string)
\new Staff
{
\repeat tremolo 2 {
\repeat tremolo 2
{
c'16
e'16
}
cs'4
\repeat tremolo 2 {
\repeat tremolo 2
{
d'16
f'16
}
Expand Down
10 changes: 6 additions & 4 deletions abjad/score.py
Original file line number Diff line number Diff line change
Expand Up @@ -4939,12 +4939,14 @@ class TremoloContainer(Container):
>>> print(string)
\new Staff
{
\repeat tremolo 2 {
\repeat tremolo 2
{
c'16
e'16
}
cs'4
\repeat tremolo 2 {
\repeat tremolo 2
{
d'16
f'16
}
Expand Down Expand Up @@ -4989,8 +4991,8 @@ def __getnewargs__(self) -> tuple:

def _format_open_brackets_site(self, contributions):
result = []
string = rf"\repeat tremolo {self.count} {{"
result.append(string)
result.append(rf"\repeat tremolo {self.count}")
result.append("{")
return result

def _get_preprolated_duration(self):
Expand Down

0 comments on commit 00838c7

Please sign in to comment.