Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-alsa for openSUSE:Factory checked in at 2022-06-01 17:34:59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-alsa (Old) and /work/SRC/openSUSE:Factory/.python-alsa.new.1548 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-alsa" Wed Jun 1 17:34:59 2022 rev:5 rq:980236 version:1.2.7 Changes: -------- --- /work/SRC/openSUSE:Factory/python-alsa/python-alsa.changes 2021-12-07 00:01:57.904016334 +0100 +++ /work/SRC/openSUSE:Factory/.python-alsa.new.1548/python-alsa.changes 2022-06-01 17:35:22.342791162 +0200 @@ -1,0 +2,7 @@ +Wed Jun 1 06:03:41 UTC 2022 - Takashi Iwai <ti...@suse.com> + +- Update to version 1.2.7: + * alsaseq: fix 'ext' buffer fill + * various python3 fixes + +------------------------------------------------------------------- Old: ---- pyalsa-1.2.6.tar.bz2 pyalsa-1.2.6.tar.bz2.sig New: ---- pyalsa-1.2.7.tar.bz2 pyalsa-1.2.7.tar.bz2.sig ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-alsa.spec ++++++ --- /var/tmp/diff_new_pack.gtTHSP/_old 2022-06-01 17:35:22.786791687 +0200 +++ /var/tmp/diff_new_pack.gtTHSP/_new 2022-06-01 17:35:22.790791692 +0200 @@ -1,7 +1,7 @@ # # spec file for package python-alsa # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,10 +18,10 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-alsa -Version: 1.2.6 +Version: 1.2.7 Release: 0 Summary: Python ALSA binding -License: LGPL-2.1-or-later AND GPL-2.0-only +License: GPL-2.0-only AND LGPL-2.1-or-later Group: Development/Libraries/Python URL: https://www.alsa-project.org Source: %{url}/files/pub/pyalsa/pyalsa-%{version}.tar.bz2 ++++++ pyalsa-1.2.6.tar.bz2 -> pyalsa-1.2.7.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyalsa-1.2.6/PKG-INFO new/pyalsa-1.2.7/PKG-INFO --- old/pyalsa-1.2.6/PKG-INFO 2021-12-06 12:47:04.973220000 +0100 +++ new/pyalsa-1.2.7/PKG-INFO 2022-05-31 16:54:02.412001800 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: pyalsa -Version: 1.2.6 +Version: 1.2.7 Summary: Python binding for the ALSA library. Home-page: http://www.alsa-project.org Author: The ALSA Team diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyalsa-1.2.6/pyalsa/alsahcontrol.c new/pyalsa-1.2.7/pyalsa/alsahcontrol.c --- old/pyalsa-1.2.6/pyalsa/alsahcontrol.c 2021-12-06 11:12:31.000000000 +0100 +++ new/pyalsa-1.2.7/pyalsa/alsahcontrol.c 2022-05-31 16:25:37.000000000 +0200 @@ -621,7 +621,7 @@ pyalsahcontrolelement_dealloc(struct pyalsahcontrolelement *self) { if (self->elem) { - Py_DECREF(self->callback); + Py_XDECREF(self->callback); snd_hctl_elem_set_callback(self->elem, NULL); } Py_XDECREF(self->pyhandle); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyalsa-1.2.6/pyalsa/alsaseq.c new/pyalsa-1.2.7/pyalsa/alsaseq.c --- old/pyalsa-1.2.6/pyalsa/alsaseq.c 2021-12-06 11:12:31.000000000 +0100 +++ new/pyalsa-1.2.7/pyalsa/alsaseq.c 2022-05-31 16:25:37.000000000 +0200 @@ -251,6 +251,13 @@ int len = PyList_Size(list); \ self->event->data.ext.len = len; \ if (len > 0) { \ + self->buff = malloc(len); \ + if (self->buff == NULL) { \ + PyErr_SetString(PyExc_TypeError, \ + name " no memory"); \ + self->event->data.ext.len = 0; \ + return NULL; \ + } \ int i; \ long val; \ for (i = 0; i < len; i++) { \ @@ -259,18 +266,12 @@ PyErr_SetString(PyExc_TypeError, \ name " must be a list of integers"); \ self->event->data.ext.len = 0; \ - return NULL; \ + free(self->buff); \ + self->buff = NULL; \ + return NULL; \ } \ - } \ - self->buff = malloc(len); \ - if (self->buff == NULL) { \ - PyErr_SetString(PyExc_TypeError, \ - name " no memory"); \ - self->event->data.ext.len = 0; \ - return NULL; \ - } \ - for (i = 0; i < len; i++) \ self->buff[i] = val; \ + } \ self->event->data.ext.ptr = self->buff; \ } \ } \ @@ -1677,16 +1678,11 @@ static PyObject * SeqEvent_repr(SeqEventObject *self) { PyObject *key = PyInt_FromLong(self->event->type); - ConstantObject *constObject = (ConstantObject *) - PyDict_GetItem(TDICT(EVENT_TYPE), key); - const char *typestr = "UNKNOWN"; + ConstantObject *typeObject = (ConstantObject *)PyDict_GetItem(TDICT(EVENT_TYPE), key); const char *timemode = ""; unsigned int dtime = 0; unsigned int ntime = 0; Py_DECREF(key); - if (constObject != NULL) { - typestr = constObject->extra.name; - } if (snd_seq_ev_is_real(self->event)) { timemode = "real"; @@ -1697,17 +1693,18 @@ dtime = self->event->time.tick; } - return PyUnicode_FromFormat("<alsaseq.SeqEvent type=%s(%d) flags=%d tag=%d " + return PyUnicode_FromFormat("<alsaseq.SeqEvent type=%S(%d) flags=%d tag=%d " "queue=%d time=%s(%u.%u) from=%d:%d to=%d:%d " "at %p>", - typestr, + typeObject, self->event->type, self->event->flags, self->event->tag, self->event->queue, timemode, dtime, ntime, (self->event->source).client, (self->event->source).port, (self->event->dest).client, - (self->event->dest).port, self); + (self->event->dest).port, + self); } /** alsaseq.SeqEvent get_data() method: __doc__ */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyalsa-1.2.6/pyalsa/common.h new/pyalsa-1.2.7/pyalsa/common.h --- old/pyalsa-1.2.6/pyalsa/common.h 2021-12-06 11:12:31.000000000 +0100 +++ new/pyalsa-1.2.7/pyalsa/common.h 2022-05-31 16:25:37.000000000 +0200 @@ -22,6 +22,8 @@ #ifndef __PYALSA_COMMON_H #define __PYALSA_COMMON_H +#define PY_SSIZE_T_CLEAN + #include "Python.h" #include "structmember.h" #include "frameobject.h" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyalsa-1.2.6/pyalsa.egg-info/PKG-INFO new/pyalsa-1.2.7/pyalsa.egg-info/PKG-INFO --- old/pyalsa-1.2.6/pyalsa.egg-info/PKG-INFO 2021-12-06 12:47:04.000000000 +0100 +++ new/pyalsa-1.2.7/pyalsa.egg-info/PKG-INFO 2022-05-31 16:54:02.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: pyalsa -Version: 1.2.6 +Version: 1.2.7 Summary: Python binding for the ALSA library. Home-page: http://www.alsa-project.org Author: The ALSA Team diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyalsa-1.2.6/setup.py new/pyalsa-1.2.7/setup.py --- old/pyalsa-1.2.6/setup.py 2021-12-06 11:12:31.000000000 +0100 +++ new/pyalsa-1.2.7/setup.py 2022-05-31 16:25:37.000000000 +0200 @@ -9,7 +9,7 @@ except ImportError: from distutils.core import setup, Extension -VERSION='1.2.6' +VERSION='1.2.7' if os.path.exists("version"): fp = open("version", "r") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyalsa-1.2.6/test/cardtest1.py new/pyalsa-1.2.7/test/cardtest1.py --- old/pyalsa-1.2.6/test/cardtest1.py 2021-12-06 11:12:31.000000000 +0100 +++ new/pyalsa-1.2.7/test/cardtest1.py 2022-05-31 16:25:37.000000000 +0200 @@ -2,9 +2,9 @@ # -*- Python -*- import sys -sys.path.insert(0, '../pyalsa') +sys.path.insert(0, '..') del sys -import alsacard +from pyalsa import alsacard print('asoundlibVersion:', alsacard.asoundlib_version()) print('cardLoad:', alsacard.card_load(0)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyalsa-1.2.6/test/ctltest1.py new/pyalsa-1.2.7/test/ctltest1.py --- old/pyalsa-1.2.6/test/ctltest1.py 2021-12-06 11:12:31.000000000 +0100 +++ new/pyalsa-1.2.7/test/ctltest1.py 2022-05-31 16:25:37.000000000 +0200 @@ -2,9 +2,9 @@ # -*- Python -*- import sys -sys.path.insert(0, '../pyalsa') +sys.path.insert(0, '..') del sys -import alsacontrol +from pyalsa import alsacontrol ctl = alsacontrol.Control() print('Card info:', ctl.card_info()) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyalsa-1.2.6/test/hctltest1.py new/pyalsa-1.2.7/test/hctltest1.py --- old/pyalsa-1.2.6/test/hctltest1.py 2021-12-06 11:12:31.000000000 +0100 +++ new/pyalsa-1.2.7/test/hctltest1.py 2022-05-31 16:25:37.000000000 +0200 @@ -2,9 +2,9 @@ # -*- Python -*- import sys -sys.path.insert(0, '../pyalsa') +sys.path.insert(0, '..') del sys -import alsahcontrol +from pyalsa import alsahcontrol def info(element): info = alsahcontrol.Info(element) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyalsa-1.2.6/test/hctltest2.py new/pyalsa-1.2.7/test/hctltest2.py --- old/pyalsa-1.2.6/test/hctltest2.py 2021-12-06 11:12:31.000000000 +0100 +++ new/pyalsa-1.2.7/test/hctltest2.py 2022-05-31 16:25:37.000000000 +0200 @@ -2,10 +2,10 @@ # -*- Python -*- import sys -sys.path.insert(0, '../pyalsa') +sys.path.insert(0, '..') del sys import select -import alsahcontrol +from pyalsa import alsahcontrol def parse_event_mask(events): if events == 0: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyalsa-1.2.6/test/mixertest1.py new/pyalsa-1.2.7/test/mixertest1.py --- old/pyalsa-1.2.6/test/mixertest1.py 2021-12-06 11:12:31.000000000 +0100 +++ new/pyalsa-1.2.7/test/mixertest1.py 2022-05-31 16:25:37.000000000 +0200 @@ -2,10 +2,10 @@ # -*- Python -*- import sys -sys.path.insert(0, '../pyalsa') +sys.path.insert(0, '..') del sys from alsamemdebug import debuginit, debug, debugdone -import alsamixer +from pyalsa import alsamixer def print_elem(e): direction = ["playback", "capture"] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyalsa-1.2.6/test/mixertest2.py new/pyalsa-1.2.7/test/mixertest2.py --- old/pyalsa-1.2.6/test/mixertest2.py 2021-12-06 11:12:31.000000000 +0100 +++ new/pyalsa-1.2.7/test/mixertest2.py 2022-05-31 16:25:37.000000000 +0200 @@ -4,7 +4,7 @@ import sys sys.path.insert(0, '../pyalsa') del sys -import alsamixer +from pyalsa import alsamixer import select def parse_event_mask(events): @@ -20,15 +20,15 @@ def event_callback(element, events): - print 'CALLBACK (DEF)! [%s] %s:%i' % (parse_event_mask(events), element.name, element.index) - print ' ', element.get_volume_tuple(), element.get_switch_tuple() + print('CALLBACK (DEF)! [%s] %s:%i' % (parse_event_mask(events), element.name, element.index)) + print(' ', element.get_volume_tuple(), element.get_switch_tuple()) class MyElementEvent: def callback(self, element, events): - print 'CALLBACK (CLASS)! [%s] %s:%i' % (parse_event_mask(events), element.name, element.index) - print ' ', element.get_volume_tuple(), element.get_switch_tuple() + print('CALLBACK (CLASS)! [%s] %s:%i' % (parse_event_mask(events), element.name, element.index)) + print(' ', element.get_volume_tuple(), element.get_switch_tuple()) mixer = alsamixer.Mixer() @@ -44,5 +44,5 @@ mixer.register_poll(poller) while True: poller.poll() - print 'Poll OK!' + print('Poll OK!') mixer.handle_events() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyalsa-1.2.6/test/seqtest1.py new/pyalsa-1.2.7/test/seqtest1.py --- old/pyalsa-1.2.6/test/seqtest1.py 2021-12-06 11:12:31.000000000 +0100 +++ new/pyalsa-1.2.7/test/seqtest1.py 2022-05-31 16:25:37.000000000 +0200 @@ -8,20 +8,20 @@ # sequencer application. import sys -sys.path.insert(0, '../pyalsa') +sys.path.insert(0, '..') del sys from alsamemdebug import debuginit, debug, debugdone -import alsaseq +from pyalsa import alsaseq def dump_portinfo(dict): def dl(dict, key): - if dict.has_key(key): + if key in dict: return "'" + str(dict[key]) + "'" return "N/A" def da(dict, key, search): tmp = None - if dict.has_key(key): + if key in dict: for k in search: if k & dict[key]: if tmp == None: @@ -39,151 +39,155 @@ def dump_list(connections, simple=True): for clientports in connections: clientname, clientid, portlist = clientports - print " client: %3d %s" % (clientid, clientname), + print(" client: %3d %s" % (clientid, clientname)) if not simple: clientinfo = sequencer.get_client_info(clientid) - print "\t[%s]" % clientinfo + print("\t[%s]" % clientinfo) else: - print + print() for port in portlist: portname, portid, connections = port - print " port: %3d:%-2d +-%s" % (clientid, portid, portname), + print(" port: %3d:%-2d +-%s" % (clientid, portid, portname)) if not simple: portinfo = sequencer.get_port_info(portid, clientid) - print "\t[%s]" % (dump_portinfo(portinfo)) + print("\t[%s]" % (dump_portinfo(portinfo))) else: - print + print() readconn, writeconn = connections for c,p,i in readconn: if not simple: - print " connection to: %d:%d %s" % (c,p, i) + print(" connection to: %d:%d %s" % (c,p, i)) else: - print " connection to: %d:%d" % (c,p) + print(" connection to: %d:%d" % (c,p)) for c,p,i in writeconn: if not simple: - print " connection to: %d:%d %s" % (c,p, i) + print(" connection to: %d:%d %s" % (c,p, i)) else: - print " connection to: %d:%d" % (c,p) + print(" connection to: %d:%d" % (c,p)) debuginit() -print "01:Creating Sequencer ==============================" +print("01:Creating Sequencer ==============================") sequencer = alsaseq.Sequencer() # other examples: # sequencer = alsaseq.Sequencer("hw", "myfancyapplication", alsaseq.SEQ_OPEN_INPUT, alsaseq.SEQ_BLOCK) # sequencer = alsaseq.Sequencer(clientname='python-test', streams=alsaseq.SEQ_OPEN_OUTPUT) -print " sequencer: %s" % sequencer -print " name: %s" % sequencer.name -print " clientname: %s" % sequencer.clientname -print " streams: %d (%s)" % (sequencer.streams, str(sequencer.streams)) -print " mode: %d (%s)" % (sequencer.mode, str(sequencer.mode)) -print " client_id: %s" % sequencer.client_id -print +print(" sequencer: %s" % sequencer) +print(" name: %s" % sequencer.name) +print(" clientname: %s" % sequencer.clientname) +print(" streams: %d (%s)" % (sequencer.streams, str(sequencer.streams))) +print(" mode: %d (%s)" % (sequencer.mode, str(sequencer.mode))) +print(" client_id: %s" % sequencer.client_id) +print() -print "02:Changing some parameters ========================" +print("02:Changing some parameters ========================") sequencer.clientname = 'pepito' sequencer.mode = alsaseq.SEQ_BLOCK -print " clientname: %s" % sequencer.clientname -print " mode: %d (%s)" % (sequencer.mode, str(sequencer.mode)) -print +print(" clientname: %s" % sequencer.clientname) +print(" mode: %d (%s)" % (sequencer.mode, str(sequencer.mode))) +print() -print "03:Creating simple port ============================" +print("03:Creating simple port ============================") port_id = sequencer.create_simple_port("myport", alsaseq.SEQ_PORT_TYPE_APPLICATION,alsaseq.SEQ_PORT_CAP_WRITE | alsaseq.SEQ_PORT_CAP_SUBS_WRITE) -print " port_id: %s" % port_id -print +print(" port_id: %s" % port_id) +print() -print "04:Getting port info ===============================" +print("04:Getting port info ===============================") port_info = sequencer.get_port_info(port_id) -print " --> %s" % dump_portinfo(port_info) -print " --> %s" % port_info -print +print(" --> %s" % dump_portinfo(port_info)) +print(" --> %s" % port_info) +print() -print "05:Retrieving clients and connections (as list) ====" +print("05:Retrieving clients and connections (as list) ====") connections = sequencer.connection_list() -print " %s" % (connections) -print +print(" %s" % (connections)) +print() -print "06:Retrieving clients and connections (detailed) ===" +print("06:Retrieving clients and connections (detailed) ===") connections = sequencer.connection_list() dump_list(connections, False) -print +print() -print "07:Connecting 'arbitrary' ports... =================" +print("07:Connecting 'arbitrary' ports... =================") source = (alsaseq.SEQ_CLIENT_SYSTEM, alsaseq.SEQ_PORT_SYSTEM_ANNOUNCE) dest = (sequencer.client_id, port_id) -print "%s ---> %s" % (str(source), str(dest)) +print("%s ---> %s" % (str(source), str(dest))) sequencer.connect_ports(source, dest) -print +print() -print "08:Retrieving clients and connections (simple) =====" +print("08:Retrieving clients and connections (simple) =====") connections = sequencer.connection_list() dump_list(connections) -print +print() -print "09:Disconnecting previous 'arbitrary' port =========" -print "%s -X-> %s" % (str(source), str(dest)) +print("09:Disconnecting previous 'arbitrary' port =========") +print("%s -X-> %s" % (str(source), str(dest))) sequencer.disconnect_ports(source, dest) -print +print() -print "10:Retrieving clients and connections (simple) =====" +print("10:Retrieving clients and connections (simple) =====") connections = sequencer.connection_list() dump_list(connections) -print +print() -print "11:Listing known streams constants =================" -print "%s" % alsaseq._dstreams.values() -print +print("11:Listing known streams constants =================") +print("%s" % alsaseq._dstreams.values()) +print() -print "12:Listing known mode constants ====================" -print "%s" % alsaseq._dmode.values() -print +print("12:Listing known mode constants ====================") +print("%s" % alsaseq._dmode.values()) +print() -print "13:Listing known queue constants ===================" -print "%s" % alsaseq._dqueue.values() -print +print("13:Listing known queue constants ===================") +print("%s" % alsaseq._dqueue.values()) +print() -print "14:Listing known client type constants =============" -print "%s" % alsaseq._dclienttype.values() -print +print("14:Listing known client type constants =============") +print("%s" % alsaseq._dclienttype.values()) +print() -print "15:Listing known port caps constants ===============" -print "%s" % alsaseq._dportcap.values() -print +print("15:Listing known port caps constants ===============") +print("%s" % alsaseq._dportcap.values()) +print() -print "16:Listing known port types constants ==============" -print "%s" % alsaseq._dporttype.values() -print +print("16:Listing known port types constants ==============") +print("%s" % alsaseq._dporttype.values()) +print() -print "17:Listing known event type constants ==============" -print "%s" % alsaseq._deventtype.values() -print +print("17:Listing known event type constants ==============") +print("%s" % alsaseq._deventtype.values()) +print() -print "18:Listing known event timestamp constants =========" -print "%s" % alsaseq._deventtimestamp.values() -print +print("18:Listing known event timestamp constants =========") +print("%s" % alsaseq._deventtimestamp.values()) +print() -print "19:Listing known event timemode constants ==========" -print "%s" % alsaseq._deventtimemode.values() -print +print("19:Listing known event timemode constants ==========") +print("%s" % alsaseq._deventtimemode.values()) +print() -print "20:Listing known client addresses constants ========" -print "%s" % alsaseq._dclient.values() -print +print("20:Listing known client addresses constants ========") +print("%s" % alsaseq._dclient.values()) +print() -print "21:Listing known port addresses constants ==========" -print "%s" % alsaseq._dport.values() -print +print("21:Listing known port addresses constants ==========") +print("%s" % alsaseq._dport.values()) +print() +print("22:SeqEvent repr ===================================") +print("%s" % alsaseq.SeqEvent(alsaseq.SEQ_EVENT_NOTEON)) +print() -print "98:Removing sequencer ==============================" + +print("98:Removing sequencer ==============================") debug([sequencer]) del sequencer -print +print() -print "99:Listing sequencer (using new one) ===============" +print("99:Listing sequencer (using new one) ===============") dump_list(alsaseq.Sequencer().connection_list()) -print +print() debugdone() -print "seqtest1.py done." +print("seqtest1.py done.") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyalsa-1.2.6/test/seqtest2.py new/pyalsa-1.2.7/test/seqtest2.py --- old/pyalsa-1.2.6/test/seqtest2.py 2021-12-06 11:12:31.000000000 +0100 +++ new/pyalsa-1.2.7/test/seqtest2.py 2022-05-31 16:25:37.000000000 +0200 @@ -8,9 +8,9 @@ # sequencer application. import sys -sys.path.insert(0, '../pyalsa') +sys.path.insert(0, '..') -import alsaseq +from pyalsa import alsaseq import time from alsamemdebug import debuginit, debug, debugdone @@ -19,24 +19,24 @@ seq = alsaseq.Sequencer() def dump(event): - print "event: %s" % event - print " ", + print("event: %s" % event) + print(" ") for attr in alsaseq.SeqEvent.__dict__: if attr.startswith('is_'): t = event.__getattribute__(attr) if t: - print "%s" % attr, - print + print("%s" % attr) + print() data = event.get_data() - print " data=%s" % data + print(" data=%s" % data) -print "sequencer: %s" % seq +print("sequencer: %s" % seq) port_id = seq.create_simple_port('hola', alsaseq.SEQ_PORT_TYPE_APPLICATION, alsaseq.SEQ_PORT_CAP_SUBS_READ | alsaseq.SEQ_PORT_CAP_READ | alsaseq.SEQ_PORT_CAP_WRITE | alsaseq.SEQ_PORT_CAP_SUBS_WRITE ) -print "portid: %d" % port_id +print("portid: %d" % port_id) c=-2 wait = 5000 @@ -45,11 +45,11 @@ if c == -1: src = (alsaseq.SEQ_CLIENT_SYSTEM,alsaseq.SEQ_PORT_SYSTEM_ANNOUNCE) dest = (seq.client_id, port_id) - print 'connecting %s -> %s' % (src, dest) + print('connecting %s -> %s' % (src, dest)) seq.connect_ports(src, dest) if c == 5: break - print 'waiting %s...' % wait + print('waiting %s...' % wait) events = seq.receive_events(wait) for event in events: c = 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyalsa-1.2.6/test/seqtest3.py new/pyalsa-1.2.7/test/seqtest3.py --- old/pyalsa-1.2.6/test/seqtest3.py 2021-12-06 11:12:31.000000000 +0100 +++ new/pyalsa-1.2.7/test/seqtest3.py 2022-05-31 16:25:37.000000000 +0200 @@ -8,9 +8,9 @@ # sequencer application. import sys -sys.path.insert(0, '../pyalsa') +sys.path.insert(0, '..') -from alsaseq import * +from pyalsa.alsaseq import * import time from alsamemdebug import debuginit, debug, debugdone @@ -28,9 +28,9 @@ type = pinfo['type'] caps = pinfo['capability'] if type & SEQ_PORT_TYPE_MIDI_GENERIC and caps & (SEQ_PORT_CAP_WRITE): - print "Using port: %s:%s" % (cname, pname) + print("Using port: %s:%s" % (cname, pname)) return (cid, pid) - print "No midi port found -- install timidity or other software synth for testing!" + print("No midi port found -- install timidity or other software synth for testing!") sys.exit(0) # create sequencer @@ -43,7 +43,7 @@ queue = seq.create_queue() seq.start_queue(queue) tempo, ppq = seq.queue_tempo(queue) -print "tempo: %d ppq: %d" % (tempo, ppq) +print("tempo: %d ppq: %d" % (tempo, ppq)) # play notes: DO RE MI FA SOL LA notes = [0x40, 0x42, 0x44, 0x45, 0x47, 0x49] @@ -53,7 +53,7 @@ event.queue = queue event.time += ppq event.set_data({'note.note' : note, 'note.velocity' : 64, 'note.duration' : ppq , 'note.off_velocity' : 64}) - print 'event: %s %s' % (event, event.get_data()) + print('event: %s %s' % (event, event.get_data())) seq.output_event(event) seq.drain_output() seq.sync_output_queue()