def __init__(self, music=None, context_name='Context', name=None): Container.__init__(self, music=music) self.context_name = context_name self._consists_commands = [] self._remove_commands = [] self._name = None self.name = name self.is_nonsemantic = False
def __init__( self, music=None, context_name='Context', is_simultaneous=None, name=None, ): Container.__init__( self, is_simultaneous=is_simultaneous, music=music, name=name, ) self.context_name = context_name self._consists_commands = [] self._remove_commands = [] self.is_nonsemantic = False
def _copy_with_indicators_but_without_children_or_spanners(self): new = Container._copy_with_indicators_but_without_children_or_spanners(self) new._consists_commands = copy.copy(self.consists_commands) new._remove_commands = copy.copy(self.remove_commands) new.context_name = copy.copy(self.context_name) new.name = copy.copy(self.name) new.is_nonsemantic = copy.copy(self.is_nonsemantic) return new
def _copy_with_indicators_but_without_children_or_spanners(self): new = Container._copy_with_indicators_but_without_children_or_spanners( self) new._consists_commands = copy.copy(self.consists_commands) new._remove_commands = copy.copy(self.remove_commands) new.context_name = copy.copy(self.context_name) new.name = copy.copy(self.name) new.is_nonsemantic = copy.copy(self.is_nonsemantic) return new
def __repr__(self): r'''Gets interpreter representation of context. :: >>> context Context() Returns string. ''' from abjad.tools import scoretools if all(isinstance(x, scoretools.Leaf) for x in self): return Container.__repr__(self) return self._get_abbreviated_string_format()
def __repr__(self): r'''Gets interpreter representation of context. :: >>> context = scoretools.Context( ... name='MeterVoice', ... context_name='TimeSignatureContext', ... ) >>> repr(context) 'Context()' Returns string. ''' from abjad.tools import scoretools if all(isinstance(x, scoretools.Leaf) for x in self): return Container.__repr__(self) return self._get_abbreviated_string_format()
def __init__(self, target_duration=None, music=None, **kwargs): Container.__init__(self, music=music, **kwargs) target_duration = target_duration or durationtools.Duration(1, 4) target_duration = durationtools.Duration(target_duration) assert 0 < target_duration self._target_duration = target_duration
def _copy_with_indicators_but_without_children_or_spanners(self): new = Container._copy_with_indicators_but_without_children_or_spanners( self) new.kind = self.kind return new
def __init__(self, music=None): Container.__init__(self, music) self.is_simultaneous = False
def __init__(self, music=None, kind='grace'): # self._carrier is a reference to the leaf carrying grace music self._carrier = None Container.__init__(self, music) self.kind = kind
def _copy_with_indicators_but_without_children_or_spanners(self): new = Container._copy_with_indicators_but_without_children_or_spanners(self) new.kind = self.kind return new