예제 #1
0
 def __init__(self, target_context=None):
     Mark.__init__(self)
     self._effective_context = None
     if target_context is not None:
         if not isinstance(target_context, type):
             message = 'target context {!r} must be context class.'
             message = message.format(target_context)
             raise TypeError(message)
     self._target_context = target_context
예제 #2
0
 def __init__(self, *args):
     Mark.__init__(self)
     self._format_slot = 'right'
     if len(args) == 1 and isinstance(args[0], type(self)):
         self.bend_amount = args[0].bend_amount
     elif len(args) == 1 and not isinstance(args[0], type(self)):
         self.bend_amount = args[0]
     else:
         message = 'can not initialize stem tremolo.'
         raise ValueError(message)
예제 #3
0
 def __init__(self, *args):
     Mark.__init__(self)
     self._format_slot = "right"
     if len(args) == 1 and isinstance(args[0], type(self)):
         self.tremolo_flags = args[0].tremolo_flags
     elif len(args) == 1 and not isinstance(args[0], type(self)):
         self.tremolo_flags = args[0]
     else:
         message = "can not initialize stem tremolo."
         raise ValueError(message)
예제 #4
0
 def __init__(self, *args):
     Mark.__init__(self)
     if len(args) == 1 and isinstance(args[0], type(self)):
         self._name = copy.copy(args[0].name)
         self._value = copy.copy(args[0].value)
     elif len(args) == 1 and not isinstance(args[0], type(self)):
         self._name = copy.copy(args[0])
         self._value = None
     elif len(args) == 2:
         self._name = copy.copy(args[0])
         self._value = copy.copy(args[1])
     else:
         message = 'unknown annotation initialization signature.'
         raise ValueError(message)
     self._format_slot = None
예제 #5
0
 def __init__(self,  *args):
     Mark.__init__(self)
     if len(args) == 1 and isinstance(args[0], type(self)):
         self.command_name = copy.copy(args[0].command_name)
         self.format_slot = copy.copy(args[0].format_slot)
     elif len(args) == 1 and not isinstance(args[0], type(self)):
         self.command_name = copy.copy(args[0])
         self.format_slot = None
     elif len(args) == 2 and isinstance(args[0], type(self)):
         self.command_name = copy.copy(args[0].command_name)
         self.format_slot = args[1]
     elif len(args) == 2 and not isinstance(args[0], type(self)):
         self.command_name = args[0]
         self.format_slot = args[1]
     else:
         message = 'can not initialize LilyPond command mark.'
         raise ValueError(message)
예제 #6
0
 def __init__(self, *args, **kwargs):
     Mark.__init__(self, *args)
     if 'direction' in kwargs:
         self.direction = kwargs['direction']
     else:
         self.direction = None