IndicatorWrapper

class systemtools.IndicatorWrapper(component=None, indicator=None, is_annotation=None, is_piecewise=None, name=None, piecewise_spanner=None, scope=None, synthetic_offset=None)

Indicator wrapper.

>>> component = abjad.Note("c'4")
>>> articulation = abjad.Articulation('accent', Up)
>>> abjad.annotate(component, 'foo', articulation)
>>> agent = abjad.inspect(component)
>>> wrapper = agent.get_indicators(unwrap=False)[0]
>>> f(wrapper)
systemtools.IndicatorWrapper(
    component=abjad.Note("c'4"),
    indicator=abjad.Articulation('accent', Up),
    is_annotation=True,
    name='foo',
    )

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.AbjadValueObject.AbjadValueObject" [color=1, group=0, label=AbjadValueObject, shape=box]; "abjad.tools.abctools.AbjadObject.AbjadObject" -> "abjad.tools.abctools.AbjadValueObject.AbjadValueObject"; "abjad.tools.abctools.AbjadObject.AbstractBase" -> "abjad.tools.abctools.AbjadObject.AbjadObject"; } subgraph cluster_systemtools { graph [label=systemtools]; "abjad.tools.systemtools.IndicatorWrapper.IndicatorWrapper" [color=black, fontcolor=white, group=2, label=<<B>IndicatorWrapper</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.AbjadValueObject.AbjadValueObject" -> "abjad.tools.systemtools.IndicatorWrapper.IndicatorWrapper"; "builtins.object" -> "abjad.tools.abctools.AbjadObject.AbstractBase"; }

Bases

Attribute summary

component Gets start component of indicator wrapper.
indicator Gets indicator of indicator wrapper.
is_annotation Is true if indicator wrapper is annotation.
is_piecewise Is true if indicator wrapper is piecewise.
name Gets name of indicator wrapper.
piecewise_spanner Gets piecewise spanner of indicator wrapper.
scope Gets scope of indicator wrapper.
start_offset Gets start offset of indicator wrapper.
synthetic_offset Gets synthetic offset of indicator wrapper.
__copy__() Copies indicator wrapper.
__eq__(argument) Is true when all initialization values of Abjad value object equal the initialization values of argument.
__format__([format_specification]) Formats Abjad object.
__hash__() Hashes Abjad value object.
__ne__(argument) Is true when Abjad object does not equal argument.
__repr__() Gets interpreter representation of Abjad object.

Read-only properties

IndicatorWrapper.component

Gets start component of indicator wrapper.

Returns component.

IndicatorWrapper.indicator

Gets indicator of indicator wrapper.

Returns indicator.

IndicatorWrapper.is_annotation

Is true if indicator wrapper is annotation.

Returns true or false.

IndicatorWrapper.is_piecewise

Is true if indicator wrapper is piecewise.

Returns true or false.

IndicatorWrapper.name

Gets name of indicator wrapper.

>>> component = abjad.Note("c'4")
>>> articulation = abjad.Articulation('accent', Up)
>>> abjad.attach(articulation, component)
>>> wrapper = abjad.inspect(component).get_indicators(unwrap=False)[0]
>>> wrapper.name is None
True
>>> component = abjad.Note("c'4")
>>> articulation = abjad.Articulation('accent', Up)
>>> abjad.annotate(component, 'foo', articulation)
>>> wrapper = abjad.inspect(component).get_indicators(unwrap=False)[0]
>>> wrapper.name
'foo'
>>> leaf_a = abjad.Note("c'4")
>>> articulation = abjad.Articulation('accent', Up)
>>> abjad.attach(articulation, leaf_a)
>>> wrapper_a = abjad.inspect(leaf_a).get_indicators(unwrap=False)[0]
>>> wrapper_a.name is None
True
>>> leaf_b = abjad.Note("g'4")
>>> abjad.attach(wrapper_a, leaf_b)
>>> wrapper_b = abjad.inspect(leaf_b).get_indicators(unwrap=False)[0]
>>> wrapper_a is not wrapper_b
True
>>> wrapper_b.name is None
True
>>> leaf_a = abjad.Note("c'4")
>>> articulation = abjad.Articulation('accent', Up)
>>> abjad.annotate(leaf_a, 'foo', articulation)
>>> wrapper_a = abjad.inspect(leaf_a).get_indicators(unwrap=False)[0]
>>> wrapper_a.name == 'foo'
True
>>> leaf_b = abjad.Note("g'4")
>>> abjad.attach(wrapper_a, leaf_b)
>>> wrapper_b = abjad.inspect(leaf_b).get_indicators(unwrap=False)[0]
>>> wrapper_a is not wrapper_b
True
>>> wrapper_b.name
'foo'
>>> leaf_a = abjad.Note("c'4")
>>> articulation = abjad.Articulation('accent', Up)
>>> abjad.annotate(leaf_a, 'foo', articulation)
>>> wrapper_a = abjad.inspect(leaf_a).get_indicators(unwrap=False)[0]
>>> wrapper_a.name
'foo'
>>> leaf_b = abjad.Note("g'4")
>>> abjad.annotate(leaf_b, 'bar', articulation)
>>> wrapper_b = abjad.inspect(leaf_b).get_indicators(unwrap=False)[0]
>>> wrapper_a is not wrapper_b
True
>>> wrapper_b.name
'bar'

Returns string or none.

IndicatorWrapper.piecewise_spanner

Gets piecewise spanner of indicator wrapper.

Returns spanner or none.

IndicatorWrapper.scope

Gets scope of indicator wrapper.

Returns context.

IndicatorWrapper.start_offset

Gets start offset of indicator wrapper.

This is either the wrapper’s synthetic offset or the start offset of the wrapper’s component.

Returns offset.

IndicatorWrapper.synthetic_offset

Gets synthetic offset of indicator wrapper.

Synthetic offset is optional.

Returns offset or none.

Special methods

IndicatorWrapper.__copy__()

Copies indicator wrapper.

Preserves annotation flag:

>>> old_staff = abjad.Staff("c'4 d'4 e'4 f'4")
>>> abjad.annotate(old_staff[0], 'bow_direction', Down)
>>> f(old_staff)
\new Staff {
    c'4
    d'4
    e'4
    f'4
}
>>> leaf = old_staff[0]
>>> abjad.inspect(leaf).get_annotation('bow_direction')
Down
>>> new_staff = abjad.mutate(old_staff).copy()
>>> f(new_staff)
\new Staff {
    c'4
    d'4
    e'4
    f'4
}
>>> leaf = new_staff[0]
>>> abjad.inspect(leaf).get_annotation('bow_direction')
Down

Preserves piecewise flag:

>>> old_staff = abjad.Staff("c'4 d'4 e'4 f'4")
>>> spanner = abjad.TextSpanner()
>>> abjad.attach(spanner, old_staff[:])
>>> spanner.attach(abjad.Markup('pont.'), old_staff[0])
>>> f(old_staff)
\new Staff {
    c'4 ^ \markup { pont. }
    d'4
    e'4
    f'4
}
>>> leaf = old_staff[0]
>>> wrapper = abjad.inspect(leaf).get_indicator(unwrap=False)
>>> f(wrapper)
systemtools.IndicatorWrapper(
    component=abjad.Note("c'4 ^ \\markup { pont. }"),
    indicator=abjad.Markup(
        contents=['pont.'],
        ),
    is_piecewise=True,
    piecewise_spanner=spannertools.TextSpanner(),
    )
>>> new_staff = abjad.mutate(old_staff).copy()
>>> f(new_staff)
\new Staff {
    c'4 ^ \markup { pont. }
    d'4
    e'4
    f'4
}
>>> leaf = new_staff[0]
>>> wrapper = abjad.inspect(leaf).get_indicator(unwrap=False)
>>> f(wrapper)
systemtools.IndicatorWrapper(
    component=abjad.Note("c'4 ^ \\markup { pont. }"),
    indicator=abjad.Markup(
        contents=['pont.'],
        ),
    is_piecewise=True,
    )

Copies indicator and scope.

Does not copy start component.

Does not copy piecewise spanner.

This is to avoid reference problems.

Returns new indicator wrapper.

(AbjadValueObject).__eq__(argument)

Is true when all initialization values of Abjad value object equal the initialization values of argument.

Returns true or false.

(AbjadObject).__format__(format_specification='')

Formats Abjad object.

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

Returns string.

(AbjadValueObject).__hash__()

Hashes Abjad value object.

Returns integer.

(AbjadObject).__ne__(argument)

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

Returns true or false.

(AbjadObject).__repr__()

Gets interpreter representation of Abjad object.

Returns string.