LilyPondFormatManager

class systemtools.LilyPondFormatManager

Manages LilyPond formatting logic.

Lineage

digraph InheritanceGraph { graph [background=transparent, bgcolor=transparent, color=lightslategrey, fontname=Arial, outputorder=edgesfirst, overlap=prism, penwidth=2, rankdir=LR, root="__builtin__.object", splines=spline, style="dotted, rounded", truecolor=true]; node [colorscheme=pastel19, fontname=Arial, fontsize=12, penwidth=2, style="filled, rounded"]; edge [color=lightsteelblue2, penwidth=2]; subgraph cluster_abctools { graph [label=abctools]; "abjad.tools.abctools.AbjadObject.AbjadObject" [color=1, group=0, label=AbjadObject, shape=box]; "abjad.tools.abctools.AbjadObject.AbstractBase" [color=1, group=0, label=AbstractBase, shape=box]; "abjad.tools.abctools.AbjadObject.AbstractBase" -> "abjad.tools.abctools.AbjadObject.AbjadObject"; } subgraph cluster_systemtools { graph [label=systemtools]; "abjad.tools.systemtools.LilyPondFormatManager.LilyPondFormatManager" [color=black, fontcolor=white, group=2, label=<<B>LilyPondFormatManager</B>>, shape=box, style="filled, rounded"]; } subgraph cluster_builtins { graph [label=builtins]; "builtins.object" [color=2, group=1, label=object, shape=box]; } "abjad.tools.abctools.AbjadObject.AbjadObject" -> "abjad.tools.systemtools.LilyPondFormatManager.LilyPondFormatManager"; "builtins.object" -> "abjad.tools.abctools.AbjadObject.AbstractBase"; }

Bases

Attribute summary

bundle_format_contributions(component) Gets all format contributions for component.
format_lilypond_attribute(attribute) Formats LilyPond attribute according to Scheme formatting conventions.
format_lilypond_context_setting_in_with_block(...) Formats LilyPond context setting name with value in LilyPond with-block.
format_lilypond_context_setting_inline(name, ...) Formats LilyPond context setting name with value in context.
format_lilypond_value(expr) Formats LilyPond expr according to Scheme formatting conventions.
make_lilypond_override_string(grob_name, ...) Makes Lilypond override string.
make_lilypond_revert_string(grob_name, ...) Makes LilyPond revert string.
report_component_format_contributions(component) Reports component format contributions.
report_spanner_format_contributions(spanner) Reports spanner format contributions for every leaf to which spanner attaches.
__eq__(expr) Is true when ID of expr equals ID of Abjad object.
__format__([format_specification]) Formats Abjad object.
__hash__() Hashes Abjad object.
__ne__(expr) Is true when Abjad object does not equal expr.
__repr__() Gets interpreter representation of Abjad object.

Class & static methods

static LilyPondFormatManager.bundle_format_contributions(component)

Gets all format contributions for component.

Returns LilyPond format bundle.

static LilyPondFormatManager.format_lilypond_attribute(attribute)

Formats LilyPond attribute according to Scheme formatting conventions.

Returns string.

static LilyPondFormatManager.format_lilypond_context_setting_in_with_block(name, value)

Formats LilyPond context setting name with value in LilyPond with-block.

Returns string.

static LilyPondFormatManager.format_lilypond_context_setting_inline(name, value, context=None)

Formats LilyPond context setting name with value in context.

Returns string.

static LilyPondFormatManager.format_lilypond_value(expr)

Formats LilyPond expr according to Scheme formatting conventions.

Returns string.

static LilyPondFormatManager.make_lilypond_override_string(grob_name, grob_attribute, grob_value, context_name=None, is_once=False)

Makes Lilypond override string.

Does not include ‘once’.

Returns string.

static LilyPondFormatManager.make_lilypond_revert_string(grob_name, grob_attribute, context_name=None)

Makes LilyPond revert string.

Returns string.

static LilyPondFormatManager.report_component_format_contributions(component, verbose=False)

Reports component format contributions.

>>> staff = Staff("c'4 [ ( d'4 e'4 f'4 ] )")
>>> override(staff[0]).note_head.color = 'red'
>>> manager = systemtools.LilyPondFormatManager
>>> print(manager.report_component_format_contributions(staff[0]))
slot 1:
    grob overrides:
        \once \override NoteHead.color = #red
slot 3:
slot 4:
    leaf body:
        c'4 [ (
slot 5:
slot 7:

Returns string.

static LilyPondFormatManager.report_spanner_format_contributions(spanner)

Reports spanner format contributions for every leaf to which spanner attaches.

>>> staff = Staff("c8 d e f")
>>> spanner = spannertools.Beam()
>>> attach(spanner, staff[:])
>>> manager = systemtools.LilyPondFormatManager
>>> print(manager.report_spanner_format_contributions(spanner))
c8  systemtools.LilyPondFormatBundle(
        right=LilyPondFormatBundle.SlotContributions(
            spanner_starts=['['],
            ),
        )
d8  systemtools.LilyPondFormatBundle()
e8  systemtools.LilyPondFormatBundle()
f8  systemtools.LilyPondFormatBundle(
        right=LilyPondFormatBundle.SlotContributions(
            spanner_stops=[']'],
            ),
        )

Returns none or return string.

Special methods

(AbjadObject).__eq__(expr)

Is true when ID of expr equals ID of Abjad object. Otherwise false.

Returns true or false.

(AbjadObject).__format__(format_specification='')

Formats Abjad object.

Set format_specification to ‘’ or ‘storage’. Interprets ‘’ equal to ‘storage’.

Returns string.

(AbjadObject).__hash__()

Hashes Abjad object.

Required to be explicitly redefined on Python 3 if __eq__ changes.

Returns integer.

(AbjadObject).__ne__(expr)

Is true when Abjad object does not equal expr. Otherwise false.

Returns true or false.

(AbjadObject).__repr__()

Gets interpreter representation of Abjad object.

Returns string.