Hello community, here is the log from the commit of package python-espeak for openSUSE:Factory checked in at 2014-01-27 11:43:39 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-espeak (Old) and /work/SRC/openSUSE:Factory/.python-espeak.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-espeak" Changes: -------- --- /work/SRC/openSUSE:Factory/python-espeak/python-espeak.changes 2012-03-20 11:32:46.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.python-espeak.new/python-espeak.changes 2014-01-27 11:43:42.000000000 +0100 @@ -1,0 +2,8 @@ +Sat Jan 25 02:24:58 UTC 2014 - [email protected] + +- Update to 0.5: + * Added support for Python 3. + * Minor fixes (eg. compiler warnings). +- Added CFLAGS to build step since it compiles a C++ file. + +------------------------------------------------------------------- Old: ---- python-espeak-0.4.tar.gz New: ---- python-espeak-0.5.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-espeak.spec ++++++ --- /var/tmp/diff_new_pack.sKrF85/_old 2014-01-27 11:43:43.000000000 +0100 +++ /var/tmp/diff_new_pack.sKrF85/_new 2014-01-27 11:43:43.000000000 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-espeak # -# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. # Copyright (c) 2012 Malcolm J Lewis <[email protected]> # # All modifications and additions to the file contributed by third parties @@ -16,14 +16,15 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # + Name: python-espeak -Version: 0.4 +Version: 0.5 Release: 0 -License: GPL-3.0+ Summary: Python bindings for espeak -Url: https://launchpad.net/python-espeak +License: GPL-3.0+ Group: Development/Languages/Python -Source0: http://launchpad.net/python-espeak/trunk/0.4/+download/python-espeak-0.4.tar.gz +Url: https://launchpad.net/python-espeak +Source0: https://launchpad.net/python-espeak/trunk/0.5/+download/python-espeak-0.5.tar.gz BuildRequires: espeak-devel BuildRequires: fdupes BuildRequires: gcc-c++ @@ -39,7 +40,7 @@ %setup -q %build -python setup.py build +CFLAGS="%{optflags}" python setup.py build %install python setup.py install -O1 --skip-build --prefix=%{_prefix} --root=%{buildroot} ++++++ python-espeak-0.4.tar.gz -> python-espeak-0.5.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-espeak-0.4/NEWS new/python-espeak-0.5/NEWS --- old/python-espeak-0.4/NEWS 2012-01-01 18:22:52.000000000 +0100 +++ new/python-espeak-0.5/NEWS 2013-12-28 20:27:01.000000000 +0100 @@ -1,3 +1,9 @@ +2013-12-28: Version 0.5 +----------------------- + + - Added support for Python 3. + - Minor fixes (eg. compiler warnings). + 2012-01-01: Version 0.4 ----------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-espeak-0.4/PKG-INFO new/python-espeak-0.5/PKG-INFO --- old/python-espeak-0.4/PKG-INFO 2012-01-01 18:23:46.000000000 +0100 +++ new/python-espeak-0.5/PKG-INFO 2013-12-28 20:32:14.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.0 Name: python-espeak -Version: 0.4 +Version: 0.5 Summary: Python bindings for the eSpeak speech synthesizer Home-page: https://launchpad.net/python-espeak Author: Siegfried-A. Gevatter Pujals diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-espeak-0.4/espeak/_repr.py new/python-espeak-0.5/espeak/_repr.py --- old/python-espeak-0.4/espeak/_repr.py 2009-06-04 16:24:21.000000000 +0200 +++ new/python-espeak-0.5/espeak/_repr.py 2013-12-28 19:17:32.000000000 +0100 @@ -24,7 +24,7 @@ """This is an empty class to store data in it.""" def __init__(self, dict={}): - for name, value in dict.iteritems(): + for name, value in dict.items(): setattr(self, name, value) def __repr__(self): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-espeak-0.4/espeak/espeak.py new/python-espeak-0.5/espeak/espeak.py --- old/python-espeak-0.4/espeak/espeak.py 2011-01-23 20:05:05.000000000 +0100 +++ new/python-espeak-0.5/espeak/espeak.py 2013-12-28 19:44:36.000000000 +0100 @@ -18,8 +18,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. -import core -import _repr +from . import core +from . import _repr # Functions which are already pythonic enough set_parameter = core.set_parameter diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-espeak-0.4/espeak/espeakmodulecore.cpp new/python-espeak-0.5/espeak/espeakmodulecore.cpp --- old/python-espeak-0.4/espeak/espeakmodulecore.cpp 2012-01-01 18:21:37.000000000 +0100 +++ new/python-espeak-0.5/espeak/espeakmodulecore.cpp 2013-12-28 20:16:03.000000000 +0100 @@ -25,6 +25,11 @@ static PyObject *BufferFullError; static PyObject *CallBack = NULL; static volatile int Stopping = 0; +static volatile int AsyncPython = 0; + +#if PY_MAJOR_VERSION >= 3 + #define PyInt_FromLong PyLong_FromLong +#endif static int DoCallback(espeak_EVENT_TYPE event, int pos, int len) @@ -48,6 +53,7 @@ { if (CallBack != NULL && event != NULL && Stopping == 0) { + AsyncPython = 1; while (event->type != espeakEVENT_LIST_TERMINATED && Stopping == 0) { int isTrue = 1; @@ -56,12 +62,16 @@ event->type, event->text_position, event->length); PyGILState_Release(gs); if (!isTrue) + { + AsyncPython = 0; return 1; //abort + } ++event; } + AsyncPython = 0; } - return 0; + return Stopping; } static bool @@ -95,9 +105,10 @@ PyObject* enable_endpause = NULL; PyObject* user_data = NULL; - static char *kwlist[] = {"text", "ssml", "phonemes", "endpause", "user_data", NULL}; - if(!PyArg_ParseTupleAndKeywords(args, kwdict, "s|OOOO", kwlist, - &text, &enable_ssml, &enable_phonemes, &enable_endpause, &user_data)) + static const char *kwlist[] = {"text", "ssml", "phonemes", "endpause", "user_data", NULL}; + if(!PyArg_ParseTupleAndKeywords(args, kwdict, "s|OOOO", + const_cast<char **>(kwlist), &text, + &enable_ssml, &enable_phonemes, &enable_endpause, &user_data)) return NULL; int flags = 0; @@ -184,7 +195,10 @@ pyespeak_cancel(PyObject *self, PyObject *args) { Stopping = 1; - PyThreadState* ts = PyEval_SaveThread(); //We need to release the GIL to avoid deadlock with PyGILState_Ensure + // We need to release the GIL to avoid a deadlock with PyGILState_Ensure. + PyThreadState* ts = PyEval_SaveThread(); + while (AsyncPython) + usleep(100); espeak_Cancel(); PyEval_RestoreThread(ts); Stopping = 0; @@ -202,11 +216,11 @@ voice.age = 0; voice.variant = 0; - static char *kwlist[] = {"name", "language", "gender", "age", + static const char *kwlist[] = {"name", "language", "gender", "age", "variant", NULL}; - if(!PyArg_ParseTupleAndKeywords(args, kwdict, "|ssiii", kwlist, - &voice.name, &voice.languages, &voice.gender, &voice.age, - &voice.variant)) + if(!PyArg_ParseTupleAndKeywords(args, kwdict, "|ssiii", + const_cast<char **>(kwlist), &voice.name, &voice.languages, + &voice.gender, &voice.age, &voice.variant)) return NULL; espeak_SetVoiceByProperties(&voice); @@ -223,9 +237,9 @@ int relative; int r; - static char *kwlist[] = {"parameter", "value", "relative", NULL}; - if(!PyArg_ParseTupleAndKeywords(args, kwdict, "ii|O", kwlist, - ¶meter, &value, &isRelative)) + static const char *kwlist[] = {"parameter", "value", "relative", NULL}; + if(!PyArg_ParseTupleAndKeywords(args, kwdict, "ii|O", + const_cast<char **>(kwlist), ¶meter, &value, &isRelative)) return NULL; relative = (isRelative == NULL) ? 0 : PyObject_IsTrue(isRelative); @@ -304,17 +318,33 @@ {NULL, NULL, 0, NULL} }; -PyMODINIT_FUNC -initcore(void) { +// http://python3porting.com/cextensions.html +#if PY_MAJOR_VERSION >= 3 + #define MOD_ERROR_VAL NULL + #define MOD_SUCCESS_VAL(val) val + #define MOD_INIT(name) PyMODINIT_FUNC PyInit_##name(void) + #define MOD_DEF(ob, name, doc, methods) \ + static struct PyModuleDef moduledef = { \ + PyModuleDef_HEAD_INIT, name, doc, -1, methods, }; \ + ob = PyModule_Create(&moduledef); +#else + #define MOD_ERROR_VAL + #define MOD_SUCCESS_VAL(val) + #define MOD_INIT(name) PyMODINIT_FUNC init##name(void) + #define MOD_DEF(ob, name, doc, methods) \ + ob = Py_InitModule(name, methods); +#endif + +MOD_INIT(core) { // Initialize the Python module PyObject *module; PyEval_InitThreads(); - module = Py_InitModule("core", EspeakMethods); + MOD_DEF(module, "core", NULL, EspeakMethods); if(module == NULL) - return; + return MOD_ERROR_VAL; // Add parameters PyModule_AddIntConstant(module, "parameter_RATE", espeakRATE); @@ -348,9 +378,11 @@ // Initialize eSpeak if(pyespeak_initialize() == -1) { PyErr_SetString(PyExc_SystemError, "could not initialize espeak"); - return; + return MOD_ERROR_VAL; } // Setup destructor atexit(pyespeak_finalize); + + return MOD_SUCCESS_VAL(module); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-espeak-0.4/setup.py new/python-espeak-0.5/setup.py --- old/python-espeak-0.4/setup.py 2012-01-01 18:20:48.000000000 +0100 +++ new/python-espeak-0.5/setup.py 2013-12-28 20:27:16.000000000 +0100 @@ -8,7 +8,7 @@ setup( name = 'python-espeak', - version = '0.4', + version = '0.5', description = 'Python bindings for the eSpeak speech synthesizer', author = 'Siegfried-A. Gevatter Pujals', author_email = '[email protected]', -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
