Ejemplo n.º 1
0
 def __init__(
     self,
     name: str = None,
     *,
     direction: typing.Union[str, enums.VerticalAlignment] = None,
     tweaks: LilyPondTweakManager = None,
 ) -> None:
     if isinstance(name, type(self)):
         argument = name
         name = argument.name
         direction = direction or argument.direction
     name = str(name)
     if "\\" in name:
         message = "articulation names need no backslash:\n"
         message += f"   {repr(name)}"
         raise Exception(message)
     self._name = name
     direction_ = String.to_tridirectional_ordinal_constant(direction)
     if direction_ is not None:
         assert isinstance(direction_,
                           enums.VerticalAlignment), repr(direction_)
         assert direction_ in (enums.Up, enums.Down,
                               enums.Center), repr(direction_)
     self._direction = direction_
     self._format_slot = "after"
     if tweaks is not None:
         assert isinstance(tweaks, LilyPondTweakManager), repr(tweaks)
     self._tweaks = LilyPondTweakManager.set_tweaks(self, tweaks)
Ejemplo n.º 2
0
 def __init__(
     self,
     name: str = None,
     *,
     direction: typing.Union[str, enums.VerticalAlignment] = None,
     tweaks: LilyPondTweakManager = None,
     ) -> None:
     if isinstance(name, type(self)):
         argument = name
         name = argument.name
         direction = direction or argument.direction
     name = str(name)
     if '\\' in name:
         raise Exception('DEPRECATED?')
         direction, name = name.split('\\')
         direction = direction.strip()
         name = name.strip()
     self._name = name
     direction_ = String.to_tridirectional_ordinal_constant(direction)
     if direction_ is not None:
         assert isinstance(direction_, enums.VerticalAlignment), repr(direction_)
         assert direction_ in (enums.Up, enums.Down, enums.Center), repr(direction_)
     self._direction = direction_
     self._format_slot = 'after'
     if tweaks is not None:
         assert isinstance(tweaks, LilyPondTweakManager), repr(tweaks)
     self._tweaks = LilyPondTweakManager.set_tweaks(self, tweaks)
Ejemplo n.º 3
0
 def __init__(
     self,
     name: str = None,
     *,
     direction: typing.Union[str, enums.VerticalAlignment] = None,
     tweaks: LilyPondTweakManager = None,
 ) -> None:
     if isinstance(name, type(self)):
         argument = name
         name = argument.name
         direction = direction or argument.direction
     name = str(name)
     if "\\" in name:
         raise Exception("DEPRECATED?")
         direction, name = name.split("\\")
         direction = direction.strip()
         name = name.strip()
     self._name = name
     direction_ = String.to_tridirectional_ordinal_constant(direction)
     if direction_ is not None:
         assert isinstance(direction_, enums.VerticalAlignment), repr(
             direction_
         )
         assert direction_ in (enums.Up, enums.Down, enums.Center), repr(
             direction_
         )
     self._direction = direction_
     self._format_slot = "after"
     if tweaks is not None:
         assert isinstance(tweaks, LilyPondTweakManager), repr(tweaks)
     self._tweaks = LilyPondTweakManager.set_tweaks(self, tweaks)
Ejemplo n.º 4
0
 def __init__(
     self,
     *,
     direction: enums.VerticalAlignment = None,
     tweaks: LilyPondTweakManager = None,
 ) -> None:
     direction_ = String.to_tridirectional_ordinal_constant(direction)
     if direction_ is not None:
         assert isinstance(direction_, enums.VerticalAlignment), repr(direction_)
         directions = (enums.Up, enums.Down, enums.Center, None)
         assert direction_ in directions, repr(direction_)
     self._direction = direction_
     if tweaks is not None:
         assert isinstance(tweaks, LilyPondTweakManager), repr(tweaks)
     self._tweaks = LilyPondTweakManager.set_tweaks(self, tweaks)
Ejemplo n.º 5
0
 def __init__(
     self,
     *,
     direction: enums.VerticalAlignment = None,
     tweaks: LilyPondTweakManager = None,
 ) -> None:
     direction_ = String.to_tridirectional_ordinal_constant(direction)
     if direction_ is not None:
         assert isinstance(direction_, enums.VerticalAlignment), repr(
             direction_
         )
         directions = (enums.Up, enums.Down, enums.Center, None)
         assert direction_ in directions, repr(direction_)
     self._direction = direction_
     if tweaks is not None:
         assert isinstance(tweaks, LilyPondTweakManager), repr(tweaks)
     self._tweaks = LilyPondTweakManager.set_tweaks(self, tweaks)