def __init__(self, symbol=None): if symbol is None: symbol = 'cross' symbol = str(symbol) Scheme.__init__( self, symbol, quoting="'", )
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': "'"})
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)
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)
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)
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="'")
def __init__(self, *args): Scheme.__init__(self, *args, quoting="'")
def __init__(self, *args): Scheme.__init__(self, *args, **{'quoting': "'"})
def __init__(self, value=[]): Scheme.__init__(self, value, quoting="'#")
def __init__(self, symbol='cross'): symbol = str(symbol) Scheme.__init__(self, value=symbol, quoting="'")
def __init__(self, value=(None, None)): assert isinstance(value, tuple), repr(value) assert len(value) == 2, repr(value) Scheme.__init__(self, value=value)