示例#1
0
 def __init__(self, symbol=None):
     if symbol is None:
         symbol = 'cross'
     symbol = str(symbol)
     Scheme.__init__(
         self,
         symbol,
         quoting="'",
         )
示例#2
0
 def __init__(self, *args, **kwargs):
     from abjad.tools import schemetools
     args_as_pairs = []
     for arg in args:
         if not isinstance(arg, (tuple, schemetools.SchemePair)):
             message = 'must be Python pair or Scheme pair: "%s".'
             raise TypeError(message % arg)
         arg_as_pair = schemetools.SchemePair(*arg)
         args_as_pairs.append(arg_as_pair)
     Scheme.__init__(self, *args_as_pairs, **{'quoting': "'"})
示例#3
0
 def __init__(self, *args, **kwargs):
     from abjad.tools import schemetools
     args_as_pairs = []
     for arg in args:
         if not isinstance(arg, (tuple, schemetools.SchemePair)):
             message = 'must be Python pair or Scheme pair: "%s".'
             raise TypeError(message % arg)
         arg_as_pair = schemetools.SchemePair(*arg)
         args_as_pairs.append(arg_as_pair)
     Scheme.__init__(self, *args_as_pairs, **{'quoting': "'"})
示例#4
0
 def __init__(self, *args, **kwargs):
     if len(args) == 1 and durationtools.Duration.is_token(args[0]):
         args = durationtools.Duration(args[0])
     elif len(args) == 1 and isinstance(args[0], type(self)):
         args = args[0].duration
     elif len(args) == 2 and isinstance(args[0], int) and isinstance(args[1], int):
         args = durationtools.Duration(args)
     else:
         message = 'can not intialize scheme moment from "{}".'
         raise TypeError(message.format(args))
     Scheme.__init__(self, args, **kwargs)
示例#5
0
 def __init__(self, *args, **kwargs):
     if len(args) == 1 and isinstance(args[0], SchemePair):
         args = args[0]._value
     elif len(args) == 1 and isinstance(args[0], tuple):
         args = args[0][:]
     elif len(args) == 2:
         args = args
     else:
         message = 'can not initialize Scheme pair from {!r}.'
         raise TypeError(message.format(args))
     Scheme.__init__(self, *args, **kwargs)
示例#6
0
 def __init__(self, *args, **kwargs):
     if len(args) == 1 and isinstance(args[0], SchemePair):
         args = args[0]._value
     elif len(args) == 1 and isinstance(args[0], tuple):
         args = args[0][:]
     elif len(args) == 2:
         args = args
     elif len(args) == 0:
         args = (0, 1)
     else:
         message = 'can not initialize {}: {!r}.'
         message = message.format(type(self).__name__, args)
         raise TypeError(message)
     Scheme.__init__(self, *args, **kwargs)
示例#7
0
 def __init__(self, *args, **kwargs):
     if len(args) == 1 and isinstance(args[0], SchemePair):
         args = args[0]._value
     elif len(args) == 1 and isinstance(args[0], tuple):
         args = args[0][:]
     elif len(args) == 2:
         args = args
     elif len(args) == 0:
         args = (0, 1)
     else:
         message = 'can not initialize {}: {!r}.'
         message = message.format(type(self).__name__, args)
         raise TypeError(message)
     Scheme.__init__(self, *args, **kwargs)
示例#8
0
 def __init__(self, *args, **kwargs):
     if len(args) == 1 and durationtools.Duration.is_token(args[0]):
         args = durationtools.Duration(args[0])
     elif len(args) == 1 and isinstance(args[0], type(self)):
         args = args[0].duration
     elif len(args) == 2 and \
         isinstance(args[0], int) and isinstance(args[1], int):
         args = durationtools.Duration(args)
     elif len(args) == 0:
         args = durationtools.Duration((1, 4))
     else:
         message = 'can not intialize {}: {!r}.'
         message = message.format(type(self).__name__, args)
         raise TypeError(message)
     Scheme.__init__(self, args, **kwargs)
 def __init__(self, value=None):
     from abjad.tools import schemetools
     value = value or []
     pairs = []
     for item in value:
         if isinstance(item, tuple):
             pair = schemetools.SchemePair(item)
         elif isinstance(item, schemetools.SchemePair):
             pair = item
         else:
             message = 'must be Python pair or Scheme pair: {!r}.'
             message = message.format(item)
             raise TypeError(message)
         pairs.append(pair)
     Scheme.__init__(self, value=pairs, quoting="'")
示例#10
0
 def __init__(self, *args, **kwargs):
     if len(args) == 1 and durationtools.Duration.is_token(args[0]):
         args = durationtools.Duration(args[0])
     elif len(args) == 1 and isinstance(args[0], type(self)):
         args = args[0].duration
     elif len(args) == 2 and \
         isinstance(args[0], int) and isinstance(args[1], int):
         args = durationtools.Duration(args)
     elif len(args) == 0:
         args = durationtools.Duration((1, 4))
     else:
         message = 'can not intialize {}: {!r}.'
         message = message.format(type(self).__name__, args)
         raise TypeError(message)
     Scheme.__init__(self, args, **kwargs)
示例#11
0
 def __init__(self, *args):
     Scheme.__init__(self, *args, quoting="'")
示例#12
0
 def __init__(self, *args):
     Scheme.__init__(self, *args, **{'quoting': "'"})
示例#13
0
 def __init__(self, value=[]):
     Scheme.__init__(self, value, quoting="'#")
示例#14
0
 def __init__(self, *args):
     Scheme.__init__(self, *args, quoting="'")
示例#15
0
 def __init__(self, symbol='cross'):
     symbol = str(symbol)
     Scheme.__init__(self, value=symbol, quoting="'")
示例#16
0
 def __init__(self, value=(None, None)):
     assert isinstance(value, tuple), repr(value)
     assert len(value) == 2, repr(value)
     Scheme.__init__(self, value=value)