Beispiel #1
0
    def _attach(self, start_component):
        r'''Attaches context mark to `start_component`.
        
        Makes sure no context mark of same type is already attached 
        to score component that starts with start component.

        Returns context mark.
        '''
        from abjad.tools import contexttools
        classes = (type(self), )
        effective_context_mark = \
            start_component._get_effective_context_mark(classes)
        if effective_context_mark is not None:
            if effective_context_mark.start_component._get_timespan().start_offset == \
                start_component._get_timespan().start_offset:
                message = 'effective context mark already attached'
                message += ' to component starting at same time.'
                raise ExtraMarkError(message)
        return Mark._attach(self, start_component)