Changes in / [4041a6d:7c785e6]


Ignore:
Location:
python
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • python/VERSION

    r4041a6d r7c785e6  
    22AUBIO_MINOR_VERSION=4
    33AUBIO_PATCH_VERSION=2
    4 AUBIO_VERSION_STATUS='a0'
     4AUBIO_VERSION_STATUS='~alpha'
    55LIBAUBIO_LT_CUR=4
    66LIBAUBIO_LT_REV=1
  • python/ext/aubio-types.h

    r4041a6d r7c785e6  
    4040#endif
    4141
    42 // compat with Python < 2.6
    43 #ifndef Py_TYPE
    44 #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type)
    45 #endif
    46 
    4742// special python type for cvec
    4843typedef struct
  • python/ext/aubiowraphell.h

    r4041a6d r7c785e6  
    1414  self->o = new_aubio_## NAME ( PARAMS ); \
    1515  if (self->o == NULL) { \
    16     PyErr_SetString (PyExc_RuntimeError, "error creating object"); \
     16    PyErr_SetString (PyExc_StandardError, "error creating object"); \
    1717    return -1; \
    1818  } \
     
    2626{ \
    2727  del_aubio_ ## NAME (self->o); \
    28   Py_TYPE(self)->tp_free ((PyObject *) self); \
     28  self->ob_type->tp_free ((PyObject *) self); \
    2929}
    3030
  • python/ext/py-cvec.c

    r4041a6d r7c785e6  
    6060{
    6161  del_cvec (self->o);
    62   Py_TYPE(self)->tp_free ((PyObject *) self);
     62  self->ob_type->tp_free ((PyObject *) self);
    6363}
    6464
  • python/ext/py-filter.c

    r4041a6d r7c785e6  
    5858  del_fvec(self->out);
    5959  del_aubio_filter (self->o);
    60   Py_TYPE(self)->tp_free ((PyObject *) self);
     60  self->ob_type->tp_free ((PyObject *) self);
    6161}
    6262
  • python/ext/py-sink.c

    r4041a6d r7c785e6  
    116116  }
    117117  if (self->o == NULL) {
    118     PyErr_SetString (PyExc_RuntimeError, "error creating sink with this uri");
     118    PyErr_SetString (PyExc_StandardError, "error creating sink with this uri");
    119119    return -1;
    120120  }
  • python/ext/py-source.c

    r4041a6d r7c785e6  
    140140    char_t errstr[30 + strlen(self->uri)];
    141141    sprintf(errstr, "error creating source with %s", self->uri);
    142     PyErr_SetString (PyExc_RuntimeError, errstr);
     142    PyErr_SetString (PyExc_StandardError, errstr);
    143143    return -1;
    144144  }
  • python/lib/aubio/midiconv.py

    r4041a6d r7c785e6  
    77    _valid_octaves = range(-1, 10)
    88    if type(note) not in (str, unicode):
    9         raise TypeError("a string is required, got %s" % note)
     9        raise TypeError, "a string is required, got %s" % note
    1010    if not (1 < len(note) < 5):
    11         raise ValueError(
    12                 "string of 2 to 4 characters expected, got %d (%s)" %
    13                 (len(note), note))
     11        raise ValueError, "string of 2 to 4 characters expected, got %d (%s)" % (len(note), note)
    1412    notename, modifier, octave = [None]*3
    1513
     
    2927
    3028    if notename not in _valid_notenames:
    31         raise ValueError("%s is not a valid note name" % notename)
     29        raise ValueError, "%s is not a valid note name" % notename
    3230    if modifier not in _valid_modifiers:
    33         raise ValueError("%s is not a valid modifier" % modifier)
     31        raise ValueError, "%s is not a valid modifier" % modifier
    3432    if octave not in _valid_octaves:
    35         raise ValueError("%s is not a valid octave" % octave)
     33        raise ValueError, "%s is not a valid octave" % octave
    3634
    3735    midi = 12 + octave * 12 + _valid_notenames[notename] + _valid_modifiers[modifier]
    3836    if midi > 127:
    39         raise ValueError("%s is outside of the range C-2 to G8" % note)
     37        raise ValueError, "%s is outside of the range C-2 to G8" % note
    4038    return midi
    4139
     
    4341    " convert midi note number to note name, e.g. [0, 127] -> [C-1, G9] "
    4442    if type(midi) != int:
    45         raise TypeError("an integer is required, got %s" % midi)
     43        raise TypeError, "an integer is required, got %s" % midi
    4644    if not (-1 < midi < 128):
    47         raise ValueError(
    48                 "an integer between 0 and 127 is excepted, got %d" % midi)
     45        raise ValueError, "an integer between 0 and 127 is excepted, got %d" % midi
    4946    midi = int(midi)
    5047    _valid_notenames = ['C', 'C#', 'D', 'D#', 'E', 'F', 'F#', 'G', 'G#', 'A', 'A#', 'B']
  • python/lib/gen_pyobject.py

    r4041a6d r7c785e6  
    7171    returns: [['int', 'argc'], ['char **','argv']]
    7272    """
    73     return list(map(split_type, get_params(proto)))
     73    return map(split_type, get_params(proto))
    7474
    7575def get_return_type(proto):
  • python/lib/generator.py

    r4041a6d r7c785e6  
    44
    55import os, sys, shutil
    6 from .gen_pyobject import write_msg, gen_new_init, gen_do, gen_members, gen_methods, gen_finish
     6from gen_pyobject import write_msg, gen_new_init, gen_do, gen_members, gen_methods, gen_finish
    77
    88def get_cpp_objects():
     
    1212  cpp_output = filter(lambda y: len(y) > 1, cpp_output)
    1313  cpp_output = filter(lambda y: not y.startswith('#'), cpp_output)
    14   cpp_output = list(cpp_output)
    1514
    1615  i = 1
     
    8786      object_methods = [a.strip() for a in object_methods]
    8887      object_methods = filter(lambda x: not x.startswith('typedef'), object_methods)
    89       object_methods = list(object_methods)
    9088      #for method in object_methods:
    9189      #    write_msg(method)
    92       new_methods = list(filter(
    93           lambda x: 'new_'+object_name in x, object_methods))
     90      new_methods = filter(lambda x: 'new_'+object_name in x, object_methods)
    9491      if len(new_methods) > 1:
    9592          write_msg("-- WARNING: more than one new method for", object_name)
     
    10299              write_msg(method)
    103100
    104       del_methods = list(filter(
    105           lambda x: 'del_'+object_name in x, object_methods))
     101      del_methods = filter(lambda x: 'del_'+object_name in x, object_methods)
    106102      if len(del_methods) > 1:
    107103          write_msg("-- WARNING: more than one del method for", object_name)
     
    111107          write_msg("-- WARNING: no del method for", object_name)
    112108
    113       do_methods = list(filter(
    114           lambda x: object_name+'_do' in x, object_methods))
     109      do_methods = filter(lambda x: object_name+'_do' in x, object_methods)
    115110      if len(do_methods) > 1:
    116111          pass
     
    141136      other_methods = filter(lambda x: x not in get_methods, other_methods)
    142137      other_methods = filter(lambda x: x not in set_methods, other_methods)
    143       other_methods = list(other_methods)
    144138
    145139      if len(other_methods) > 0:
Note: See TracChangeset for help on using the changeset viewer.