pyliblo-0.9.1/0000755000175000017500000000000011521046730011272 5ustar dasdaspyliblo-0.9.1/COPYING0000644000175000017500000006350410641041005012325 0ustar dasdas GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! pyliblo-0.9.1/src/0000755000175000017500000000000011521043452012057 5ustar dasdaspyliblo-0.9.1/src/liblo.c0000644000175000017500000173413411521043452013341 0ustar dasdas/* Generated by Cython 0.14 on Sat Jan 29 17:58:17 2011 */ #define PY_SSIZE_T_CLEAN #include "Python.h" #ifndef Py_PYTHON_H #error Python headers needed to compile C extensions, please install development version of Python. #else #include /* For offsetof */ #ifndef offsetof #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) #endif #if !defined(WIN32) && !defined(MS_WINDOWS) #ifndef __stdcall #define __stdcall #endif #ifndef __cdecl #define __cdecl #endif #ifndef __fastcall #define __fastcall #endif #endif #ifndef DL_IMPORT #define DL_IMPORT(t) t #endif #ifndef DL_EXPORT #define DL_EXPORT(t) t #endif #ifndef PY_LONG_LONG #define PY_LONG_LONG LONG_LONG #endif #if PY_VERSION_HEX < 0x02040000 #define METH_COEXIST 0 #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type) #define PyDict_Contains(d,o) PySequence_Contains(d,o) #endif #if PY_VERSION_HEX < 0x02050000 typedef int Py_ssize_t; #define PY_SSIZE_T_MAX INT_MAX #define PY_SSIZE_T_MIN INT_MIN #define PY_FORMAT_SIZE_T "" #define PyInt_FromSsize_t(z) PyInt_FromLong(z) #define PyInt_AsSsize_t(o) PyInt_AsLong(o) #define PyNumber_Index(o) PyNumber_Int(o) #define PyIndex_Check(o) PyNumber_Check(o) #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) #endif #if PY_VERSION_HEX < 0x02060000 #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) #define PyVarObject_HEAD_INIT(type, size) \ PyObject_HEAD_INIT(type) size, #define PyType_Modified(t) typedef struct { void *buf; PyObject *obj; Py_ssize_t len; Py_ssize_t itemsize; int readonly; int ndim; char *format; Py_ssize_t *shape; Py_ssize_t *strides; Py_ssize_t *suboffsets; void *internal; } Py_buffer; #define PyBUF_SIMPLE 0 #define PyBUF_WRITABLE 0x0001 #define PyBUF_FORMAT 0x0004 #define PyBUF_ND 0x0008 #define PyBUF_STRIDES (0x0010 | PyBUF_ND) #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) #endif #if PY_MAJOR_VERSION < 3 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #else #define __Pyx_BUILTIN_MODULE_NAME "builtins" #endif #if PY_MAJOR_VERSION >= 3 #define Py_TPFLAGS_CHECKTYPES 0 #define Py_TPFLAGS_HAVE_INDEX 0 #endif #if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) #define Py_TPFLAGS_HAVE_NEWBUFFER 0 #endif #if PY_MAJOR_VERSION >= 3 #define PyBaseString_Type PyUnicode_Type #define PyStringObject PyUnicodeObject #define PyString_Type PyUnicode_Type #define PyString_Check PyUnicode_Check #define PyString_CheckExact PyUnicode_CheckExact #endif #if PY_VERSION_HEX < 0x02060000 #define PyBytesObject PyStringObject #define PyBytes_Type PyString_Type #define PyBytes_Check PyString_Check #define PyBytes_CheckExact PyString_CheckExact #define PyBytes_FromString PyString_FromString #define PyBytes_FromStringAndSize PyString_FromStringAndSize #define PyBytes_FromFormat PyString_FromFormat #define PyBytes_DecodeEscape PyString_DecodeEscape #define PyBytes_AsString PyString_AsString #define PyBytes_AsStringAndSize PyString_AsStringAndSize #define PyBytes_Size PyString_Size #define PyBytes_AS_STRING PyString_AS_STRING #define PyBytes_GET_SIZE PyString_GET_SIZE #define PyBytes_Repr PyString_Repr #define PyBytes_Concat PyString_Concat #define PyBytes_ConcatAndDel PyString_ConcatAndDel #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) #endif #ifndef PySet_CheckExact # define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) #endif #if PY_MAJOR_VERSION >= 3 #define PyIntObject PyLongObject #define PyInt_Type PyLong_Type #define PyInt_Check(op) PyLong_Check(op) #define PyInt_CheckExact(op) PyLong_CheckExact(op) #define PyInt_FromString PyLong_FromString #define PyInt_FromUnicode PyLong_FromUnicode #define PyInt_FromLong PyLong_FromLong #define PyInt_FromSize_t PyLong_FromSize_t #define PyInt_FromSsize_t PyLong_FromSsize_t #define PyInt_AsLong PyLong_AsLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_AsSsize_t PyLong_AsSsize_t #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #endif #if PY_MAJOR_VERSION >= 3 #define PyBoolObject PyLongObject #endif #if PY_MAJOR_VERSION >= 3 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) #else #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) #endif #if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) #else #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) #endif #if PY_MAJOR_VERSION >= 3 #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) #endif #if PY_VERSION_HEX < 0x02050000 #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) #else #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) #endif #if PY_VERSION_HEX < 0x02050000 #define __Pyx_NAMESTR(n) ((char *)(n)) #define __Pyx_DOCSTR(n) ((char *)(n)) #else #define __Pyx_NAMESTR(n) (n) #define __Pyx_DOCSTR(n) (n) #endif #ifdef __cplusplus #define __PYX_EXTERN_C extern "C" #else #define __PYX_EXTERN_C extern #endif #if defined(WIN32) || defined(MS_WINDOWS) #define _USE_MATH_DEFINES #endif #include #define __PYX_HAVE_API__liblo #include "stdint.h" #include "stdio.h" #include "lo/lo.h" #include "pythread.h" #include "stdlib.h" #include "math.h" #ifdef PYREX_WITHOUT_ASSERTIONS #define CYTHON_WITHOUT_ASSERTIONS #endif /* inline attribute */ #ifndef CYTHON_INLINE #if defined(__GNUC__) #define CYTHON_INLINE __inline__ #elif defined(_MSC_VER) #define CYTHON_INLINE __inline #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L #define CYTHON_INLINE inline #else #define CYTHON_INLINE #endif #endif /* unused attribute */ #ifndef CYTHON_UNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif # elif defined(__ICC) || defined(__INTEL_COMPILER) # define CYTHON_UNUSED __attribute__ ((__unused__)) # else # define CYTHON_UNUSED # endif #endif typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ /* Type Conversion Predeclarations */ #define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s) #define __Pyx_PyBytes_AsUString(s) ((unsigned char*) PyBytes_AsString(s)) #define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*); #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) #ifdef __GNUC__ /* Test for GCC > 2.95 */ #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #else /* __GNUC__ > 2 ... */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ > 2 ... */ #else /* __GNUC__ */ #define likely(x) (x) #define unlikely(x) (x) #endif /* __GNUC__ */ static PyObject *__pyx_m; static PyObject *__pyx_b; static PyObject *__pyx_empty_tuple; static PyObject *__pyx_empty_bytes; static int __pyx_lineno; static int __pyx_clineno = 0; static const char * __pyx_cfilenm= __FILE__; static const char *__pyx_filename; static const char *__pyx_f[] = { "liblo.pyx", "bool.pxd", "complex.pxd", }; /* Type declarations */ /* "/home/das/src/pyliblo/src/liblo.pyx":68 * cdef class _ServerBase * cdef class Address * cdef class Message # <<<<<<<<<<<<<< * cdef class Bundle * */ struct __pyx_obj_5liblo_Message { PyObject_HEAD struct __pyx_vtabstruct_5liblo_Message *__pyx_vtab; PyObject *_path; lo_message _message; PyObject *_keep_refs; }; /* "/home/das/src/pyliblo/src/liblo.pyx":662 * ################################################################################ * * cdef class _Blob: # <<<<<<<<<<<<<< * cdef lo_blob _blob * */ struct __pyx_obj_5liblo__Blob { PyObject_HEAD lo_blob _blob; }; /* "/home/das/src/pyliblo/src/liblo.pyx":66 * * # forward declarations * cdef class _ServerBase # <<<<<<<<<<<<<< * cdef class Address * cdef class Message */ struct __pyx_obj_5liblo__ServerBase { PyObject_HEAD lo_server _server; PyObject *_keep_refs; }; /* "/home/das/src/pyliblo/src/liblo.pyx":489 * * * cdef class ServerThread(_ServerBase): # <<<<<<<<<<<<<< * """ * ServerThread([port[, proto[, **kwargs]]]) */ struct __pyx_obj_5liblo_ServerThread { struct __pyx_obj_5liblo__ServerBase __pyx_base; lo_server_thread _server_thread; }; /* "/home/das/src/pyliblo/src/liblo.pyx":425 * * * cdef class Server(_ServerBase): # <<<<<<<<<<<<<< * """ * Server([port[, proto[, **kwargs]]]) */ struct __pyx_obj_5liblo_Server { struct __pyx_obj_5liblo__ServerBase __pyx_base; }; /* "/home/das/src/pyliblo/src/liblo.pyx":67 * # forward declarations * cdef class _ServerBase * cdef class Address # <<<<<<<<<<<<<< * cdef class Message * cdef class Bundle */ struct __pyx_obj_5liblo_Address { PyObject_HEAD lo_address _address; }; /* "/home/das/src/pyliblo/src/liblo.pyx":69 * cdef class Address * cdef class Message * cdef class Bundle # <<<<<<<<<<<<<< * * */ struct __pyx_obj_5liblo_Bundle { PyObject_HEAD lo_bundle _bundle; PyObject *_keep_refs; }; /* "/home/das/src/pyliblo/src/liblo.pyx":691 * * * cdef class Message: # <<<<<<<<<<<<<< * """ * Message(path[, arg, ...]) */ struct __pyx_vtabstruct_5liblo_Message { PyObject *(*_add)(struct __pyx_obj_5liblo_Message *, PyObject *, PyObject *); PyObject *(*_add_auto)(struct __pyx_obj_5liblo_Message *, PyObject *); }; static struct __pyx_vtabstruct_5liblo_Message *__pyx_vtabptr_5liblo_Message; #ifndef CYTHON_REFNANNY #define CYTHON_REFNANNY 0 #endif #if CYTHON_REFNANNY typedef struct { void (*INCREF)(void*, PyObject*, int); void (*DECREF)(void*, PyObject*, int); void (*GOTREF)(void*, PyObject*, int); void (*GIVEREF)(void*, PyObject*, int); void* (*SetupContext)(const char*, int, const char*); void (*FinishContext)(void**); } __Pyx_RefNannyAPIStruct; static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; static __Pyx_RefNannyAPIStruct * __Pyx_RefNannyImportAPI(const char *modname) { PyObject *m = NULL, *p = NULL; void *r = NULL; m = PyImport_ImportModule((char *)modname); if (!m) goto end; p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); if (!p) goto end; r = PyLong_AsVoidPtr(p); end: Py_XDECREF(p); Py_XDECREF(m); return (__Pyx_RefNannyAPIStruct *)r; } #define __Pyx_RefNannySetupContext(name) void *__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) #define __Pyx_RefNannyFinishContext() __Pyx_RefNanny->FinishContext(&__pyx_refnanny) #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r);} } while(0) #else #define __Pyx_RefNannySetupContext(name) #define __Pyx_RefNannyFinishContext() #define __Pyx_INCREF(r) Py_INCREF(r) #define __Pyx_DECREF(r) Py_DECREF(r) #define __Pyx_GOTREF(r) #define __Pyx_GIVEREF(r) #define __Pyx_XDECREF(r) Py_XDECREF(r) #endif /* CYTHON_REFNANNY */ #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);} } while(0) #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r);} } while(0) static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name); /*proto*/ static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/ static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name); /*proto*/ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); static PyObject *__Pyx_UnpackItem(PyObject *, Py_ssize_t index); /*proto*/ static int __Pyx_EndUnpack(PyObject *, Py_ssize_t expected); /*proto*/ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { PyObject *r; if (!j) return NULL; r = PyObject_GetItem(o, j); Py_DECREF(j); return r; } #define __Pyx_GetItemInt_List(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \ __Pyx_GetItemInt_List_Fast(o, i) : \ __Pyx_GetItemInt_Generic(o, to_py_func(i))) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i) { if (likely(o != Py_None)) { if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { PyObject *r = PyList_GET_ITEM(o, i); Py_INCREF(r); return r; } else if ((-PyList_GET_SIZE(o) <= i) & (i < 0)) { PyObject *r = PyList_GET_ITEM(o, PyList_GET_SIZE(o) + i); Py_INCREF(r); return r; } } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } #define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \ __Pyx_GetItemInt_Tuple_Fast(o, i) : \ __Pyx_GetItemInt_Generic(o, to_py_func(i))) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i) { if (likely(o != Py_None)) { if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { PyObject *r = PyTuple_GET_ITEM(o, i); Py_INCREF(r); return r; } else if ((-PyTuple_GET_SIZE(o) <= i) & (i < 0)) { PyObject *r = PyTuple_GET_ITEM(o, PyTuple_GET_SIZE(o) + i); Py_INCREF(r); return r; } } return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } #define __Pyx_GetItemInt(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \ __Pyx_GetItemInt_Fast(o, i) : \ __Pyx_GetItemInt_Generic(o, to_py_func(i))) static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i) { PyObject *r; if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) { r = PyList_GET_ITEM(o, i); Py_INCREF(r); } else if (PyTuple_CheckExact(o) && ((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { r = PyTuple_GET_ITEM(o, i); Py_INCREF(r); } else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_item && (likely(i >= 0))) { r = PySequence_GetItem(o, i); } else { r = __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); } return r; } static double __Pyx__PyObject_AsDouble(PyObject* obj); /* proto */ #define __Pyx_PyObject_AsDouble(obj) \ ((likely(PyFloat_CheckExact(obj))) ? \ PyFloat_AS_DOUBLE(obj) : __Pyx__PyObject_AsDouble(obj)) static CYTHON_INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x) { if (likely(PyList_CheckExact(L))) { if (PyList_Append(L, x) < 0) return NULL; Py_INCREF(Py_None); return Py_None; /* this is just to have an accurate signature */ } else { PyObject *r, *m; m = __Pyx_GetAttrString(L, "append"); if (!m) return NULL; r = PyObject_CallFunctionObjArgs(m, x, NULL); Py_DECREF(m); return r; } } static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); /*proto*/ static CYTHON_INLINE long __Pyx_NegateNonNeg(long b) { return unlikely(b < 0) ? b : !b; } static CYTHON_INLINE PyObject* __Pyx_PyBoolOrNull_FromLong(long b) { return unlikely(b < 0) ? NULL : __Pyx_PyBool_FromLong(b); } static CYTHON_INLINE void __Pyx_RaiseNoneIndexingError(void); #if PY_MAJOR_VERSION >= 3 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { PyObject *value; if (unlikely(d == Py_None)) { __Pyx_RaiseNoneIndexingError(); return NULL; } value = PyDict_GetItemWithError(d, key); if (unlikely(!value)) { if (!PyErr_Occurred()) PyErr_SetObject(PyExc_KeyError, key); return NULL; } Py_INCREF(value); return value; } #else #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) #endif static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/ static PyObject *__Pyx_FindPy2Metaclass(PyObject *bases); /*proto*/ static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, PyObject *modname); /*proto*/ #define __pyx_binding_PyCFunctionType_USED 1 typedef struct { PyCFunctionObject func; } __pyx_binding_PyCFunctionType_object; PyTypeObject __pyx_binding_PyCFunctionType_type; PyTypeObject *__pyx_binding_PyCFunctionType = NULL; PyObject *__pyx_binding_PyCFunctionType_NewEx(PyMethodDef *ml, PyObject *self, PyObject *module); /* proto */ #define __pyx_binding_PyCFunctionType_New(ml, self) __pyx_binding_PyCFunctionType_NewEx(ml, self, NULL) int __pyx_binding_PyCFunctionType_init(void); /* proto */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_int32_t(int32_t); static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_int64_t(int64_t); static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_uint8_t(uint8_t); #ifndef __PYX_FORCE_INIT_THREADS #if PY_VERSION_HEX < 0x02040200 #define __PYX_FORCE_INIT_THREADS 1 #else #define __PYX_FORCE_INIT_THREADS 0 #endif #endif static CYTHON_INLINE int32_t __Pyx_PyInt_from_py_int32_t(PyObject *); static CYTHON_INLINE int64_t __Pyx_PyInt_from_py_int64_t(PyObject *); static CYTHON_INLINE uint8_t __Pyx_PyInt_from_py_uint8_t(PyObject *); static CYTHON_INLINE uint32_t __Pyx_PyInt_from_py_uint32_t(PyObject *); static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *); static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *); static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *); static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *); static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *); static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *); static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *); static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *); static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *); static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *); static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *); static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *); static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *); static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *); static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *); static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *); static void __Pyx_WriteUnraisable(const char *name); /*proto*/ static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/ static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, long size, int strict); /*proto*/ static PyObject *__Pyx_ImportModule(const char *name); /*proto*/ static void __Pyx_AddTraceback(const char *funcname); /*proto*/ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ /* Module declarations from libc.stdint */ /* Module declarations from libc.stdio */ /* Module declarations from cpython.version */ /* Module declarations from cpython.ref */ /* Module declarations from cpython.exc */ /* Module declarations from cpython.module */ /* Module declarations from cpython.mem */ /* Module declarations from cpython.tuple */ /* Module declarations from cpython.list */ /* Module declarations from cpython.object */ /* Module declarations from cpython.sequence */ /* Module declarations from cpython.mapping */ /* Module declarations from cpython.iterator */ /* Module declarations from cpython.type */ /* Module declarations from cpython.number */ /* Module declarations from cpython.int */ /* Module declarations from __builtin__ */ /* Module declarations from cpython.bool */ static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0; /* Module declarations from cpython.long */ /* Module declarations from cpython.float */ /* Module declarations from __builtin__ */ /* Module declarations from cpython.complex */ static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0; /* Module declarations from cpython.string */ /* Module declarations from cpython.unicode */ /* Module declarations from cpython.dict */ /* Module declarations from cpython.instance */ /* Module declarations from cpython.function */ /* Module declarations from cpython.method */ /* Module declarations from cpython.weakref */ /* Module declarations from cpython.getargs */ /* Module declarations from cpython.pythread */ /* Module declarations from cpython.cobject */ /* Module declarations from cpython.oldbuffer */ /* Module declarations from cpython.set */ /* Module declarations from cpython.buffer */ /* Module declarations from cpython.bytes */ /* Module declarations from cpython.pycapsule */ /* Module declarations from cpython */ /* Module declarations from libc.stdlib */ /* Module declarations from liblo */ static PyTypeObject *__pyx_ptype_5liblo__ServerBase = 0; static PyTypeObject *__pyx_ptype_5liblo_Address = 0; static PyTypeObject *__pyx_ptype_5liblo_Message = 0; static PyTypeObject *__pyx_ptype_5liblo_Bundle = 0; static PyTypeObject *__pyx_ptype_5liblo_Server = 0; static PyTypeObject *__pyx_ptype_5liblo_ServerThread = 0; static PyTypeObject *__pyx_ptype_5liblo__Blob = 0; static PyObject *__pyx_f_5liblo__decode(PyObject *); /*proto*/ static PyObject *__pyx_f_5liblo__encode(PyObject *); /*proto*/ static lo_timetag __pyx_f_5liblo__double_to_timetag(double); /*proto*/ static double __pyx_f_5liblo__timetag_to_double(lo_timetag); /*proto*/ static PyObject *__pyx_f_5liblo__send(PyObject *, struct __pyx_obj_5liblo__ServerBase *, PyObject *); /*proto*/ static int __pyx_f_5liblo__callback(const char *, const char *, lo_arg **, int, lo_message, void *); /*proto*/ static void __pyx_f_5liblo__err_handler(int, const char *, const char *); /*proto*/ #define __Pyx_MODULE_NAME "liblo" int __pyx_module_is_main_liblo = 0; /* Implementation of liblo */ static PyObject *__pyx_builtin_Exception; static PyObject *__pyx_builtin_IOError; static PyObject *__pyx_builtin_chr; static PyObject *__pyx_builtin_TypeError; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_ord; static char __pyx_k_1[] = "sending failed: %s"; static char __pyx_k_2[] = "server error %d"; static char __pyx_k_3[] = " in %s"; static char __pyx_k_4[] = ": %s"; static char __pyx_k_5[] = "path must be a string or None"; static char __pyx_k_7[] = "typespec must be a string or None"; static char __pyx_k_11[] = "address error: %s"; static char __pyx_k_13[] = "invalid protocol"; static char __pyx_k_15[] = "invalid URL '%s'"; static char __pyx_k_16[] = "blob is empty"; static char __pyx_k_18[] = "unknown OSC data type '%c'"; static char __pyx_k_19[] = "unsupported message argument type"; static char __pyx_k_21[] = "invalid timetag"; static char __pyx_k_23[] = "\n The server's URL.\n "; static char __pyx_k_24[] = "\n The server's port number.\n "; static char __pyx_k_25[] = "\n The server's protocol (one of the constants UDP, TCP, UNIX).\n "; static char __pyx_k_26[] = "\n The address' URL.\n "; static char __pyx_k_27[] = "\n The address' hostname.\n "; static char __pyx_k_28[] = "\n The address' port number.\n "; static char __pyx_k_29[] = "\n The address' protocol (one of the constants UDP, TCP, UNIX).\n "; static char __pyx_k_30[] = "0.9.1"; static char __pyx_k_31[] = "\n Weak reference to a bound method.\n "; static char __pyx_k_32[] = "\n Exception raised when creating a liblo OSC server fails.\n "; static char __pyx_k_33[] = "\n @make_method(path, typespec[, user_data])\n\n Decorator that basically serves the same purpose as add_method(). Note that\n @make_method is defined at module scope, and not a member of class Server.\n "; static char __pyx_k_34[] = "\n Exception raised when trying to create an invalid Address object.\n "; static char __pyx_k__b[] = "b"; static char __pyx_k__c[] = "c"; static char __pyx_k__d[] = "d"; static char __pyx_k__f[] = "f"; static char __pyx_k__h[] = "h"; static char __pyx_k__i[] = "i"; static char __pyx_k__m[] = "m"; static char __pyx_k__s[] = "s"; static char __pyx_k__t[] = "t"; static char __pyx_k__TCP[] = "TCP"; static char __pyx_k__UDP[] = "UDP"; static char __pyx_k__add[] = "add"; static char __pyx_k__arr[] = "arr"; static char __pyx_k__chr[] = "chr"; static char __pyx_k__inf[] = "inf"; static char __pyx_k__key[] = "key"; static char __pyx_k__msg[] = "msg"; static char __pyx_k__num[] = "num"; static char __pyx_k__obj[] = "obj"; static char __pyx_k__ord[] = "ord"; static char __pyx_k__ref[] = "ref"; static char __pyx_k__sec[] = "sec"; static char __pyx_k__UNIX[] = "UNIX"; static char __pyx_k___add[] = "_add"; static char __pyx_k__addr[] = "addr"; static char __pyx_k__frac[] = "frac"; static char __pyx_k__free[] = "free"; static char __pyx_k__func[] = "func"; static char __pyx_k__name[] = "name"; static char __pyx_k__path[] = "path"; static char __pyx_k__port[] = "port"; static char __pyx_k__self[] = "self"; static char __pyx_k__send[] = "send"; static char __pyx_k__sort[] = "sort"; static char __pyx_k__spec[] = "spec"; static char __pyx_k__time[] = "time"; static char __pyx_k___blob[] = "_blob"; static char __pyx_k___path[] = "_path"; static char __pyx_k__addr2[] = "addr2"; static char __pyx_k__items[] = "items"; static char __pyx_k__liblo[] = "liblo"; static char __pyx_k__proto[] = "proto"; static char __pyx_k__types[] = "types"; static char __pyx_k__where[] = "where"; static char __pyx_k__append[] = "append"; static char __pyx_k__decode[] = "decode"; static char __pyx_k__encode[] = "encode"; static char __pyx_k__struct[] = "struct"; static char __pyx_k__target[] = "target"; static char __pyx_k__IOError[] = "IOError"; static char __pyx_k____get__[] = "__get__"; static char __pyx_k____str__[] = "__str__"; static char __pyx_k___bundle[] = "_bundle"; static char __pyx_k___server[] = "_server"; static char __pyx_k__counter[] = "counter"; static char __pyx_k__get_url[] = "get_url"; static char __pyx_k__im_func[] = "im_func"; static char __pyx_k__im_self[] = "im_self"; static char __pyx_k__inspect[] = "inspect"; static char __pyx_k__isdigit[] = "isdigit"; static char __pyx_k__timeout[] = "timeout"; static char __pyx_k__weakref[] = "weakref"; static char __pyx_k____call__[] = "__call__"; static char __pyx_k____func__[] = "__func__"; static char __pyx_k____init__[] = "__init__"; static char __pyx_k____main__[] = "__main__"; static char __pyx_k____self__[] = "__self__"; static char __pyx_k____test__[] = "__test__"; static char __pyx_k___address[] = "_address"; static char __pyx_k___counter[] = "_counter"; static char __pyx_k___inspect[] = "_inspect"; static char __pyx_k___message[] = "_message"; static char __pyx_k___weakref[] = "_weakref"; static char __pyx_k__get_port[] = "get_port"; static char __pyx_k__ismethod[] = "ismethod"; static char __pyx_k__typespec[] = "typespec"; static char __pyx_k__Exception[] = "Exception"; static char __pyx_k__TypeError[] = "TypeError"; static char __pyx_k____class__[] = "__class__"; static char __pyx_k___add_auto[] = "_add_auto"; static char __pyx_k__user_data[] = "user_data"; static char __pyx_k__ValueError[] = "ValueError"; static char __pyx_k___keep_refs[] = "_keep_refs"; static char __pyx_k__add_method[] = "add_method"; static char __pyx_k__getargspec[] = "getargspec"; static char __pyx_k__getmembers[] = "getmembers"; static char __pyx_k__ServerError[] = "ServerError"; static char __pyx_k____exception[] = "__exception"; static char __pyx_k____version__[] = "__version__"; static char __pyx_k__make_method[] = "make_method"; static char __pyx_k__reg_methods[] = "reg_methods"; static char __pyx_k__AddressError[] = "AddressError"; static char __pyx_k___method_spec[] = "_method_spec"; static char __pyx_k__get_hostname[] = "get_hostname"; static char __pyx_k__get_protocol[] = "get_protocol"; static char __pyx_k___server_thread[] = "_server_thread"; static char __pyx_k___weakref_method[] = "_weakref_method"; static char __pyx_k__register_methods[] = "register_methods"; static PyObject *__pyx_kp_s_1; static PyObject *__pyx_kp_s_11; static PyObject *__pyx_kp_s_13; static PyObject *__pyx_kp_s_15; static PyObject *__pyx_kp_s_16; static PyObject *__pyx_kp_s_18; static PyObject *__pyx_kp_s_19; static PyObject *__pyx_kp_s_2; static PyObject *__pyx_kp_s_21; static PyObject *__pyx_kp_s_3; static PyObject *__pyx_kp_s_30; static PyObject *__pyx_kp_s_31; static PyObject *__pyx_kp_s_32; static PyObject *__pyx_kp_s_33; static PyObject *__pyx_kp_s_34; static PyObject *__pyx_kp_s_4; static PyObject *__pyx_kp_s_5; static PyObject *__pyx_kp_s_7; static PyObject *__pyx_n_s__AddressError; static PyObject *__pyx_n_s__Exception; static PyObject *__pyx_n_s__IOError; static PyObject *__pyx_n_s__ServerError; static PyObject *__pyx_n_s__TCP; static PyObject *__pyx_n_s__TypeError; static PyObject *__pyx_n_s__UDP; static PyObject *__pyx_n_s__UNIX; static PyObject *__pyx_n_s__ValueError; static PyObject *__pyx_n_s____call__; static PyObject *__pyx_n_s____class__; static PyObject *__pyx_n_s____exception; static PyObject *__pyx_n_s____func__; static PyObject *__pyx_n_s____get__; static PyObject *__pyx_n_s____init__; static PyObject *__pyx_n_s____main__; static PyObject *__pyx_n_s____self__; static PyObject *__pyx_n_s____str__; static PyObject *__pyx_n_s____test__; static PyObject *__pyx_n_s____version__; static PyObject *__pyx_n_s___add; static PyObject *__pyx_n_s___add_auto; static PyObject *__pyx_n_s___address; static PyObject *__pyx_n_s___blob; static PyObject *__pyx_n_s___bundle; static PyObject *__pyx_n_s___counter; static PyObject *__pyx_n_s___inspect; static PyObject *__pyx_n_s___keep_refs; static PyObject *__pyx_n_s___message; static PyObject *__pyx_n_s___method_spec; static PyObject *__pyx_n_s___path; static PyObject *__pyx_n_s___server; static PyObject *__pyx_n_s___server_thread; static PyObject *__pyx_n_s___weakref; static PyObject *__pyx_n_s___weakref_method; static PyObject *__pyx_n_s__add; static PyObject *__pyx_n_s__add_method; static PyObject *__pyx_n_s__addr; static PyObject *__pyx_n_s__addr2; static PyObject *__pyx_n_s__append; static PyObject *__pyx_n_s__arr; static PyObject *__pyx_n_s__b; static PyObject *__pyx_n_s__c; static PyObject *__pyx_n_s__chr; static PyObject *__pyx_n_s__counter; static PyObject *__pyx_n_s__d; static PyObject *__pyx_n_s__decode; static PyObject *__pyx_n_s__encode; static PyObject *__pyx_n_s__f; static PyObject *__pyx_n_s__frac; static PyObject *__pyx_n_s__free; static PyObject *__pyx_n_s__func; static PyObject *__pyx_n_s__get_hostname; static PyObject *__pyx_n_s__get_port; static PyObject *__pyx_n_s__get_protocol; static PyObject *__pyx_n_s__get_url; static PyObject *__pyx_n_s__getargspec; static PyObject *__pyx_n_s__getmembers; static PyObject *__pyx_n_s__h; static PyObject *__pyx_n_s__i; static PyObject *__pyx_n_s__im_func; static PyObject *__pyx_n_s__im_self; static PyObject *__pyx_n_s__inf; static PyObject *__pyx_n_s__inspect; static PyObject *__pyx_n_s__isdigit; static PyObject *__pyx_n_s__ismethod; static PyObject *__pyx_n_s__items; static PyObject *__pyx_n_s__key; static PyObject *__pyx_n_s__liblo; static PyObject *__pyx_n_s__m; static PyObject *__pyx_n_s__make_method; static PyObject *__pyx_n_s__msg; static PyObject *__pyx_n_s__name; static PyObject *__pyx_n_s__num; static PyObject *__pyx_n_s__obj; static PyObject *__pyx_n_s__ord; static PyObject *__pyx_n_s__path; static PyObject *__pyx_n_s__port; static PyObject *__pyx_n_s__proto; static PyObject *__pyx_n_s__ref; static PyObject *__pyx_n_s__reg_methods; static PyObject *__pyx_n_s__register_methods; static PyObject *__pyx_n_s__s; static PyObject *__pyx_n_s__sec; static PyObject *__pyx_n_s__self; static PyObject *__pyx_n_s__send; static PyObject *__pyx_n_s__sort; static PyObject *__pyx_n_s__spec; static PyObject *__pyx_n_s__struct; static PyObject *__pyx_n_s__t; static PyObject *__pyx_n_s__target; static PyObject *__pyx_n_s__time; static PyObject *__pyx_n_s__timeout; static PyObject *__pyx_n_s__types; static PyObject *__pyx_n_s__typespec; static PyObject *__pyx_n_s__user_data; static PyObject *__pyx_n_s__weakref; static PyObject *__pyx_n_s__where; static PyObject *__pyx_int_0; static PyObject *__pyx_int_1; static PyObject *__pyx_k_9; static PyObject *__pyx_k_10; static PyObject *__pyx_k_12; static PyObject *__pyx_k_tuple_6; static PyObject *__pyx_k_tuple_8; static PyObject *__pyx_k_tuple_14; static PyObject *__pyx_k_tuple_17; static PyObject *__pyx_k_tuple_20; static PyObject *__pyx_k_tuple_22; /* "/home/das/src/pyliblo/src/liblo.pyx":33 * Weak reference to a bound method. * """ * def __init__(self, f): # <<<<<<<<<<<<<< * if PY_VERSION_HEX >= 0x03000000: * self.func = f.__func__ */ static PyObject *__pyx_pf_5liblo_15_weakref_method_0__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_5liblo_15_weakref_method_0__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pf_5liblo_15_weakref_method_0__init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; static PyObject *__pyx_pf_5liblo_15_weakref_method_0__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_f = 0; PyObject *__pyx_r = NULL; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__f,0}; __Pyx_RefNannySetupContext("__init__"); __pyx_self = __pyx_self; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[2] = {0,0}; switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self); if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; case 1: values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f); if (likely(values[1])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __pyx_v_self = values[0]; __pyx_v_f = values[1]; } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0); __pyx_v_f = PyTuple_GET_ITEM(__pyx_args, 1); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("liblo._weakref_method.__init__"); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; /* "/home/das/src/pyliblo/src/liblo.pyx":34 * """ * def __init__(self, f): * if PY_VERSION_HEX >= 0x03000000: # <<<<<<<<<<<<<< * self.func = f.__func__ * self.obj = _weakref.ref(f.__self__) */ __pyx_t_1 = (PY_VERSION_HEX >= 0x03000000); if (__pyx_t_1) { /* "/home/das/src/pyliblo/src/liblo.pyx":35 * def __init__(self, f): * if PY_VERSION_HEX >= 0x03000000: * self.func = f.__func__ # <<<<<<<<<<<<<< * self.obj = _weakref.ref(f.__self__) * else: */ __pyx_t_2 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s____func__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__func, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":36 * if PY_VERSION_HEX >= 0x03000000: * self.func = f.__func__ * self.obj = _weakref.ref(f.__self__) # <<<<<<<<<<<<<< * else: * self.func = f.im_func */ __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s___weakref); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__ref); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s____self__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__obj, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L6; } /*else*/ { /* "/home/das/src/pyliblo/src/liblo.pyx":38 * self.obj = _weakref.ref(f.__self__) * else: * self.func = f.im_func # <<<<<<<<<<<<<< * self.obj = _weakref.ref(f.im_self) * def __call__(self): */ __pyx_t_2 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__im_func); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__func, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":39 * else: * self.func = f.im_func * self.obj = _weakref.ref(f.im_self) # <<<<<<<<<<<<<< * def __call__(self): * return self.func.__get__(self.obj(), self.obj().__class__) */ __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s___weakref); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__ref); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s__im_self); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__obj, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_L6:; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("liblo._weakref_method.__init__"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/das/src/pyliblo/src/liblo.pyx":40 * self.func = f.im_func * self.obj = _weakref.ref(f.im_self) * def __call__(self): # <<<<<<<<<<<<<< * return self.func.__get__(self.obj(), self.obj().__class__) * */ static PyObject *__pyx_pf_5liblo_15_weakref_method_1__call__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ static PyMethodDef __pyx_mdef_5liblo_15_weakref_method_1__call__ = {__Pyx_NAMESTR("__call__"), (PyCFunction)__pyx_pf_5liblo_15_weakref_method_1__call__, METH_O, __Pyx_DOCSTR(0)}; static PyObject *__pyx_pf_5liblo_15_weakref_method_1__call__(PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; __Pyx_RefNannySetupContext("__call__"); __pyx_self = __pyx_self; /* "/home/das/src/pyliblo/src/liblo.pyx":41 * self.obj = _weakref.ref(f.im_self) * def __call__(self): * return self.func.__get__(self.obj(), self.obj().__class__) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__func); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s____get__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__obj); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__obj); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s____class__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_3 = 0; __pyx_t_1 = 0; __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("liblo._weakref_method.__call__"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/das/src/pyliblo/src/liblo.pyx":45 * * class struct: * def __init__(self, **kwargs): # <<<<<<<<<<<<<< * for k, v in kwargs.items(): * setattr(self, k, v) */ static PyObject *__pyx_pf_5liblo_6struct_0__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_5liblo_6struct_0__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pf_5liblo_6struct_0__init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; static PyObject *__pyx_pf_5liblo_6struct_0__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_kwargs = 0; PyObject *__pyx_v_k; PyObject *__pyx_v_v; PyObject *__pyx_r = NULL; Py_ssize_t __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; int __pyx_t_7; static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,0}; __Pyx_RefNannySetupContext("__init__"); __pyx_self = __pyx_self; __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL; __Pyx_GOTREF(__pyx_v_kwargs); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[1] = {0}; switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self); if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __pyx_v_self = values[0]; } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_DECREF(__pyx_v_kwargs); __Pyx_AddTraceback("liblo.struct.__init__"); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __pyx_v_k = Py_None; __Pyx_INCREF(Py_None); __pyx_v_v = Py_None; __Pyx_INCREF(Py_None); /* "/home/das/src/pyliblo/src/liblo.pyx":46 * class struct: * def __init__(self, **kwargs): * for k, v in kwargs.items(): # <<<<<<<<<<<<<< * setattr(self, k, v) * */ if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'items'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_2 = PyDict_Items(__pyx_v_kwargs); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_1 = 0; __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); } else { __pyx_t_1 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_3)) break; __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_2); __pyx_t_1++; } else if (likely(PyTuple_CheckExact(__pyx_t_3))) { if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break; __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_2); __pyx_t_1++; } else { __pyx_t_2 = PyIter_Next(__pyx_t_3); if (!__pyx_t_2) { if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} break; } __Pyx_GOTREF(__pyx_t_2); } if (PyTuple_CheckExact(__pyx_t_2) && likely(PyTuple_GET_SIZE(__pyx_t_2) == 2)) { PyObject* tuple = __pyx_t_2; __pyx_t_4 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_v_k); __pyx_v_k = __pyx_t_4; __pyx_t_4 = 0; __Pyx_DECREF(__pyx_v_v); __pyx_v_v = __pyx_t_5; __pyx_t_5 = 0; } else { __pyx_t_6 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_UnpackItem(__pyx_t_6, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_UnpackItem(__pyx_t_6, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); if (__Pyx_EndUnpack(__pyx_t_6, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_v_k); __pyx_v_k = __pyx_t_4; __pyx_t_4 = 0; __Pyx_DECREF(__pyx_v_v); __pyx_v_v = __pyx_t_5; __pyx_t_5 = 0; } /* "/home/das/src/pyliblo/src/liblo.pyx":47 * def __init__(self, **kwargs): * for k, v in kwargs.items(): * setattr(self, k, v) # <<<<<<<<<<<<<< * * */ __pyx_t_7 = PyObject_SetAttr(__pyx_v_self, __pyx_v_k, __pyx_v_v); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("liblo.struct.__init__"); __pyx_r = NULL; __pyx_L0:; __Pyx_DECREF(__pyx_v_kwargs); __Pyx_DECREF(__pyx_v_k); __Pyx_DECREF(__pyx_v_v); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/das/src/pyliblo/src/liblo.pyx":50 * * * cdef str _decode(s): # <<<<<<<<<<<<<< * # convert to standard string type, depending on python version * if PY_VERSION_HEX >= 0x03000000 and isinstance(s, bytes): */ static PyObject *__pyx_f_5liblo__decode(PyObject *__pyx_v_s) { PyObject *__pyx_r = NULL; int __pyx_t_1; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("_decode"); /* "/home/das/src/pyliblo/src/liblo.pyx":52 * cdef str _decode(s): * # convert to standard string type, depending on python version * if PY_VERSION_HEX >= 0x03000000 and isinstance(s, bytes): # <<<<<<<<<<<<<< * return s.decode() * else: */ __pyx_t_1 = (PY_VERSION_HEX >= 0x03000000); if (__pyx_t_1) { __pyx_t_2 = PyBytes_Check(__pyx_v_s); __pyx_t_3 = __pyx_t_2; } else { __pyx_t_3 = __pyx_t_1; } if (__pyx_t_3) { /* "/home/das/src/pyliblo/src/liblo.pyx":53 * # convert to standard string type, depending on python version * if PY_VERSION_HEX >= 0x03000000 and isinstance(s, bytes): * return s.decode() # <<<<<<<<<<<<<< * else: * return s */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __pyx_t_4 = PyObject_GetAttr(__pyx_v_s, __pyx_n_s__decode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (!(likely(PyString_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_5)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L0; goto __pyx_L3; } /*else*/ { /* "/home/das/src/pyliblo/src/liblo.pyx":55 * return s.decode() * else: * return s # <<<<<<<<<<<<<< * * cdef bytes _encode(s): */ __Pyx_XDECREF(((PyObject *)__pyx_r)); if (!(likely(PyString_CheckExact(__pyx_v_s))||((__pyx_v_s) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_v_s)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_INCREF(__pyx_v_s); __pyx_r = ((PyObject*)__pyx_v_s); goto __pyx_L0; } __pyx_L3:; __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("liblo._decode"); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/das/src/pyliblo/src/liblo.pyx":57 * return s * * cdef bytes _encode(s): # <<<<<<<<<<<<<< * # convert unicode to bytestring * if isinstance(s, unicode): */ static PyObject *__pyx_f_5liblo__encode(PyObject *__pyx_v_s) { PyObject *__pyx_r = NULL; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; __Pyx_RefNannySetupContext("_encode"); /* "/home/das/src/pyliblo/src/liblo.pyx":59 * cdef bytes _encode(s): * # convert unicode to bytestring * if isinstance(s, unicode): # <<<<<<<<<<<<<< * return s.encode() * else: */ __pyx_t_1 = PyUnicode_Check(__pyx_v_s); if (__pyx_t_1) { /* "/home/das/src/pyliblo/src/liblo.pyx":60 * # convert unicode to bytestring * if isinstance(s, unicode): * return s.encode() # <<<<<<<<<<<<<< * else: * return s */ __Pyx_XDECREF(((PyObject *)__pyx_r)); __pyx_t_2 = PyObject_GetAttr(__pyx_v_s, __pyx_n_s__encode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; goto __pyx_L3; } /*else*/ { /* "/home/das/src/pyliblo/src/liblo.pyx":62 * return s.encode() * else: * return s # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(((PyObject *)__pyx_r)); if (!(likely(PyBytes_CheckExact(__pyx_v_s))||((__pyx_v_s) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_v_s)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_INCREF(__pyx_v_s); __pyx_r = ((PyObject*)__pyx_v_s); goto __pyx_L0; } __pyx_L3:; __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("liblo._encode"); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/das/src/pyliblo/src/liblo.pyx":82 * ################################################################################ * * cdef lo_timetag _double_to_timetag(double f): # <<<<<<<<<<<<<< * cdef lo_timetag tt * cdef double intr, frac */ static lo_timetag __pyx_f_5liblo__double_to_timetag(double __pyx_v_f) { lo_timetag __pyx_v_tt; double __pyx_v_intr; double __pyx_v_frac; lo_timetag __pyx_r; __Pyx_RefNannySetupContext("_double_to_timetag"); /* "/home/das/src/pyliblo/src/liblo.pyx":85 * cdef lo_timetag tt * cdef double intr, frac * frac = modf(f, &intr) # <<<<<<<<<<<<<< * tt.sec = intr * tt.frac = (frac * 4294967296.0) */ __pyx_v_frac = modf(__pyx_v_f, (&__pyx_v_intr)); /* "/home/das/src/pyliblo/src/liblo.pyx":86 * cdef double intr, frac * frac = modf(f, &intr) * tt.sec = intr # <<<<<<<<<<<<<< * tt.frac = (frac * 4294967296.0) * return tt */ __pyx_v_tt.sec = ((uint32_t)__pyx_v_intr); /* "/home/das/src/pyliblo/src/liblo.pyx":87 * frac = modf(f, &intr) * tt.sec = intr * tt.frac = (frac * 4294967296.0) # <<<<<<<<<<<<<< * return tt * */ __pyx_v_tt.frac = ((uint32_t)(__pyx_v_frac * 4294967296.0)); /* "/home/das/src/pyliblo/src/liblo.pyx":88 * tt.sec = intr * tt.frac = (frac * 4294967296.0) * return tt # <<<<<<<<<<<<<< * * cdef double _timetag_to_double(lo_timetag tt): */ __pyx_r = __pyx_v_tt; goto __pyx_L0; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/das/src/pyliblo/src/liblo.pyx":90 * return tt * * cdef double _timetag_to_double(lo_timetag tt): # <<<<<<<<<<<<<< * return tt.sec + ((tt.frac) / 4294967296.0) * */ static double __pyx_f_5liblo__timetag_to_double(lo_timetag __pyx_v_tt) { double __pyx_r; __Pyx_RefNannySetupContext("_timetag_to_double"); /* "/home/das/src/pyliblo/src/liblo.pyx":91 * * cdef double _timetag_to_double(lo_timetag tt): * return tt.sec + ((tt.frac) / 4294967296.0) # <<<<<<<<<<<<<< * * def time(): */ __pyx_r = (((double)__pyx_v_tt.sec) + (((double)__pyx_v_tt.frac) / 4294967296.0)); goto __pyx_L0; __pyx_r = 0; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/das/src/pyliblo/src/liblo.pyx":93 * return tt.sec + ((tt.frac) / 4294967296.0) * * def time(): # <<<<<<<<<<<<<< * """ * time() */ static PyObject *__pyx_pf_5liblo_0time(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_5liblo_0time[] = "\n time()\n\n Returns the current time as a float in OSC format, that is, the number of\n seconds since the epoch (January 1, 1900).\n "; static PyMethodDef __pyx_mdef_5liblo_0time = {__Pyx_NAMESTR("time"), (PyCFunction)__pyx_pf_5liblo_0time, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5liblo_0time)}; static PyObject *__pyx_pf_5liblo_0time(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) { lo_timetag __pyx_v_tt; PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("time"); __pyx_self = __pyx_self; /* "/home/das/src/pyliblo/src/liblo.pyx":101 * """ * cdef lo_timetag tt * lo_timetag_now(&tt) # <<<<<<<<<<<<<< * return _timetag_to_double(tt) * */ lo_timetag_now((&__pyx_v_tt)); /* "/home/das/src/pyliblo/src/liblo.pyx":102 * cdef lo_timetag tt * lo_timetag_now(&tt) * return _timetag_to_double(tt) # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyFloat_FromDouble(__pyx_f_5liblo__timetag_to_double(__pyx_v_tt)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("liblo.time"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/das/src/pyliblo/src/liblo.pyx":109 * ################################################################################ * * cdef _send(target, _ServerBase src, args): # <<<<<<<<<<<<<< * cdef lo_server from_server * cdef Address target_address */ static PyObject *__pyx_f_5liblo__send(PyObject *__pyx_v_target, struct __pyx_obj_5liblo__ServerBase *__pyx_v_src, PyObject *__pyx_v_args) { lo_server __pyx_v_from_server; struct __pyx_obj_5liblo_Address *__pyx_v_target_address; int __pyx_v_r; PyObject *__pyx_v_packets; PyObject *__pyx_v_p; struct __pyx_obj_5liblo_Message *__pyx_v_message; struct __pyx_obj_5liblo_Bundle *__pyx_v_bundle; PyObject *__pyx_r = NULL; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; lo_server __pyx_t_4; Py_ssize_t __pyx_t_5; char *__pyx_t_6; PyObject *__pyx_t_7 = NULL; __Pyx_RefNannySetupContext("_send"); __pyx_v_target_address = ((struct __pyx_obj_5liblo_Address *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_packets = Py_None; __Pyx_INCREF(Py_None); __pyx_v_p = Py_None; __Pyx_INCREF(Py_None); __pyx_v_message = ((struct __pyx_obj_5liblo_Message *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_bundle = ((struct __pyx_obj_5liblo_Bundle *)Py_None); __Pyx_INCREF(Py_None); /* "/home/das/src/pyliblo/src/liblo.pyx":115 * * # convert target to Address object, if necessary * if isinstance(target, Address): # <<<<<<<<<<<<<< * target_address = target * elif isinstance(target, tuple): */ __pyx_t_1 = PyObject_TypeCheck(__pyx_v_target, ((PyTypeObject *)((PyObject*)__pyx_ptype_5liblo_Address))); if (__pyx_t_1) { /* "/home/das/src/pyliblo/src/liblo.pyx":116 * # convert target to Address object, if necessary * if isinstance(target, Address): * target_address = target # <<<<<<<<<<<<<< * elif isinstance(target, tuple): * # unpack tuple */ if (!(likely(((__pyx_v_target) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_target, __pyx_ptype_5liblo_Address))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_INCREF(__pyx_v_target); __Pyx_DECREF(((PyObject *)__pyx_v_target_address)); __pyx_v_target_address = ((struct __pyx_obj_5liblo_Address *)__pyx_v_target); goto __pyx_L3; } /* "/home/das/src/pyliblo/src/liblo.pyx":117 * if isinstance(target, Address): * target_address = target * elif isinstance(target, tuple): # <<<<<<<<<<<<<< * # unpack tuple * target_address = Address(*target) */ __pyx_t_1 = PyTuple_Check(__pyx_v_target); if (__pyx_t_1) { /* "/home/das/src/pyliblo/src/liblo.pyx":119 * elif isinstance(target, tuple): * # unpack tuple * target_address = Address(*target) # <<<<<<<<<<<<<< * else: * target_address = Address(target) */ __pyx_t_2 = PySequence_Tuple(__pyx_v_target); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5liblo_Address)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_target_address)); __pyx_v_target_address = ((struct __pyx_obj_5liblo_Address *)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L3; } /*else*/ { /* "/home/das/src/pyliblo/src/liblo.pyx":121 * target_address = Address(*target) * else: * target_address = Address(target) # <<<<<<<<<<<<<< * * # 'from' parameter is NULL if no server was specified */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); __Pyx_INCREF(__pyx_v_target); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_target); __Pyx_GIVEREF(__pyx_v_target); __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5liblo_Address)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_target_address)); __pyx_v_target_address = ((struct __pyx_obj_5liblo_Address *)__pyx_t_2); __pyx_t_2 = 0; } __pyx_L3:; /* "/home/das/src/pyliblo/src/liblo.pyx":124 * * # 'from' parameter is NULL if no server was specified * from_server = src._server if src else NULL # <<<<<<<<<<<<<< * * if isinstance(args[0], (Message, Bundle)): */ __pyx_t_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_src)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { __pyx_t_4 = __pyx_v_src->_server; } else { __pyx_t_4 = NULL; } __pyx_v_from_server = __pyx_t_4; /* "/home/das/src/pyliblo/src/liblo.pyx":126 * from_server = src._server if src else NULL * * if isinstance(args[0], (Message, Bundle)): # <<<<<<<<<<<<<< * # args is already a list of Messages/Bundles * packets = args */ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_args, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_5liblo_Message))); PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)((PyObject*)__pyx_ptype_5liblo_Message))); __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_5liblo_Message))); __Pyx_INCREF(((PyObject *)((PyObject*)__pyx_ptype_5liblo_Bundle))); PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)((PyObject*)__pyx_ptype_5liblo_Bundle))); __Pyx_GIVEREF(((PyObject *)((PyObject*)__pyx_ptype_5liblo_Bundle))); __pyx_t_1 = PyObject_IsInstance(__pyx_t_2, ((PyObject *)__pyx_t_3)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; if (__pyx_t_1) { /* "/home/das/src/pyliblo/src/liblo.pyx":128 * if isinstance(args[0], (Message, Bundle)): * # args is already a list of Messages/Bundles * packets = args # <<<<<<<<<<<<<< * else: * # make a single Message from all arguments */ __Pyx_INCREF(__pyx_v_args); __Pyx_DECREF(__pyx_v_packets); __pyx_v_packets = __pyx_v_args; goto __pyx_L4; } /*else*/ { /* "/home/das/src/pyliblo/src/liblo.pyx":131 * else: * # make a single Message from all arguments * packets = [Message(*args)] # <<<<<<<<<<<<<< * * # send all packets */ __pyx_t_3 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5liblo_Message)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_v_packets); __pyx_v_packets = ((PyObject *)__pyx_t_3); __pyx_t_3 = 0; } __pyx_L4:; /* "/home/das/src/pyliblo/src/liblo.pyx":134 * * # send all packets * for p in packets: # <<<<<<<<<<<<<< * if isinstance(p, Message): * message = p */ if (PyList_CheckExact(__pyx_v_packets) || PyTuple_CheckExact(__pyx_v_packets)) { __pyx_t_5 = 0; __pyx_t_3 = __pyx_v_packets; __Pyx_INCREF(__pyx_t_3); } else { __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_packets); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); } for (;;) { if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break; __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; } else if (likely(PyTuple_CheckExact(__pyx_t_3))) { if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break; __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; } else { __pyx_t_2 = PyIter_Next(__pyx_t_3); if (!__pyx_t_2) { if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} break; } __Pyx_GOTREF(__pyx_t_2); } __Pyx_DECREF(__pyx_v_p); __pyx_v_p = __pyx_t_2; __pyx_t_2 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":135 * # send all packets * for p in packets: * if isinstance(p, Message): # <<<<<<<<<<<<<< * message = p * r = lo_send_message_from(target_address._address, */ __pyx_t_1 = PyObject_TypeCheck(__pyx_v_p, ((PyTypeObject *)((PyObject*)__pyx_ptype_5liblo_Message))); if (__pyx_t_1) { /* "/home/das/src/pyliblo/src/liblo.pyx":136 * for p in packets: * if isinstance(p, Message): * message = p # <<<<<<<<<<<<<< * r = lo_send_message_from(target_address._address, * from_server, */ __Pyx_INCREF(((PyObject *)((struct __pyx_obj_5liblo_Message *)__pyx_v_p))); __Pyx_DECREF(((PyObject *)__pyx_v_message)); __pyx_v_message = ((struct __pyx_obj_5liblo_Message *)__pyx_v_p); /* "/home/das/src/pyliblo/src/liblo.pyx":139 * r = lo_send_message_from(target_address._address, * from_server, * message._path, # <<<<<<<<<<<<<< * message._message) * else: */ __pyx_t_6 = PyBytes_AsString(((PyObject *)__pyx_v_message->_path)); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "/home/das/src/pyliblo/src/liblo.pyx":140 * from_server, * message._path, * message._message) # <<<<<<<<<<<<<< * else: * bundle = p */ __pyx_v_r = lo_send_message_from(__pyx_v_target_address->_address, __pyx_v_from_server, __pyx_t_6, __pyx_v_message->_message); goto __pyx_L7; } /*else*/ { /* "/home/das/src/pyliblo/src/liblo.pyx":142 * message._message) * else: * bundle = p # <<<<<<<<<<<<<< * r = lo_send_bundle_from(target_address._address, * from_server, */ __Pyx_INCREF(((PyObject *)((struct __pyx_obj_5liblo_Bundle *)__pyx_v_p))); __Pyx_DECREF(((PyObject *)__pyx_v_bundle)); __pyx_v_bundle = ((struct __pyx_obj_5liblo_Bundle *)__pyx_v_p); /* "/home/das/src/pyliblo/src/liblo.pyx":145 * r = lo_send_bundle_from(target_address._address, * from_server, * bundle._bundle) # <<<<<<<<<<<<<< * * if r == -1: */ __pyx_v_r = lo_send_bundle_from(__pyx_v_target_address->_address, __pyx_v_from_server, __pyx_v_bundle->_bundle); } __pyx_L7:; /* "/home/das/src/pyliblo/src/liblo.pyx":147 * bundle._bundle) * * if r == -1: # <<<<<<<<<<<<<< * raise IOError("sending failed: %s" % * lo_address_errstr(target_address._address)) */ __pyx_t_1 = (__pyx_v_r == -1); if (__pyx_t_1) { /* "/home/das/src/pyliblo/src/liblo.pyx":149 * if r == -1: * raise IOError("sending failed: %s" % * lo_address_errstr(target_address._address)) # <<<<<<<<<<<<<< * * */ __pyx_t_2 = PyBytes_FromString(((char *)lo_address_errstr(__pyx_v_target_address->_address))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __pyx_t_7 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_1), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_7)); __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_7)); __Pyx_GIVEREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; __pyx_t_7 = PyObject_Call(__pyx_builtin_IOError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_7, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L8; } __pyx_L8:; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("liblo._send"); __pyx_r = 0; __pyx_L0:; __Pyx_DECREF((PyObject *)__pyx_v_target_address); __Pyx_DECREF(__pyx_v_packets); __Pyx_DECREF(__pyx_v_p); __Pyx_DECREF((PyObject *)__pyx_v_message); __Pyx_DECREF((PyObject *)__pyx_v_bundle); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/das/src/pyliblo/src/liblo.pyx":152 * * * def send(target, *args): # <<<<<<<<<<<<<< * """ * send(target, message) */ static PyObject *__pyx_pf_5liblo_1send(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_5liblo_1send[] = "\n send(target, message)\n send(target, bundle)\n send(target, path[, arg, ...])\n\n Sends a message or bundle to the the given target, without requiring a\n server. target may be an Address object, a port number, a (hostname, port)\n tuple, or a URL.\n Exceptions: AddressError, IOError\n "; static PyMethodDef __pyx_mdef_5liblo_1send = {__Pyx_NAMESTR("send"), (PyCFunction)__pyx_pf_5liblo_1send, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5liblo_1send)}; static PyObject *__pyx_pf_5liblo_1send(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_target = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__target,0}; __Pyx_RefNannySetupContext("send"); __pyx_self = __pyx_self; if (PyTuple_GET_SIZE(__pyx_args) > 1) { __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); __Pyx_GOTREF(__pyx_v_args); if (unlikely(!__pyx_v_args)) return NULL; } else { __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); } if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[1] = {0}; switch (PyTuple_GET_SIZE(__pyx_args)) { default: case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; } switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__target); if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t used_pos_args = (PyTuple_GET_SIZE(__pyx_args) < 1) ? PyTuple_GET_SIZE(__pyx_args) : 1; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "send") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __pyx_v_target = values[0]; } else if (PyTuple_GET_SIZE(__pyx_args) < 1) { goto __pyx_L5_argtuple_error; } else { __pyx_v_target = PyTuple_GET_ITEM(__pyx_args, 0); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("send", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_DECREF(__pyx_v_args); __Pyx_AddTraceback("liblo.send"); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; /* "/home/das/src/pyliblo/src/liblo.pyx":163 * Exceptions: AddressError, IOError * """ * _send(target, None, args) # <<<<<<<<<<<<<< * * */ __pyx_t_1 = __pyx_f_5liblo__send(__pyx_v_target, ((struct __pyx_obj_5liblo__ServerBase *)Py_None), ((PyObject *)__pyx_v_args)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("liblo.send"); __pyx_r = NULL; __pyx_L0:; __Pyx_DECREF(__pyx_v_args); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/das/src/pyliblo/src/liblo.pyx":174 * Exception raised when creating a liblo OSC server fails. * """ * def __init__(self, num, msg, where): # <<<<<<<<<<<<<< * self.num = num * self.msg = msg */ static PyObject *__pyx_pf_5liblo_11ServerError_0__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_5liblo_11ServerError_0__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pf_5liblo_11ServerError_0__init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; static PyObject *__pyx_pf_5liblo_11ServerError_0__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_num = 0; PyObject *__pyx_v_msg = 0; PyObject *__pyx_v_where = 0; PyObject *__pyx_r = NULL; static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__num,&__pyx_n_s__msg,&__pyx_n_s__where,0}; __Pyx_RefNannySetupContext("__init__"); __pyx_self = __pyx_self; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[4] = {0,0,0,0}; switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self); if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; case 1: values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__num); if (likely(values[1])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__msg); if (likely(values[2])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__where); if (likely(values[3])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __pyx_v_self = values[0]; __pyx_v_num = values[1]; __pyx_v_msg = values[2]; __pyx_v_where = values[3]; } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { goto __pyx_L5_argtuple_error; } else { __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0); __pyx_v_num = PyTuple_GET_ITEM(__pyx_args, 1); __pyx_v_msg = PyTuple_GET_ITEM(__pyx_args, 2); __pyx_v_where = PyTuple_GET_ITEM(__pyx_args, 3); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("liblo.ServerError.__init__"); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; /* "/home/das/src/pyliblo/src/liblo.pyx":175 * """ * def __init__(self, num, msg, where): * self.num = num # <<<<<<<<<<<<<< * self.msg = msg * self.where = where */ if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__num, __pyx_v_num) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "/home/das/src/pyliblo/src/liblo.pyx":176 * def __init__(self, num, msg, where): * self.num = num * self.msg = msg # <<<<<<<<<<<<<< * self.where = where * def __str__(self): */ if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__msg, __pyx_v_msg) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "/home/das/src/pyliblo/src/liblo.pyx":177 * self.num = num * self.msg = msg * self.where = where # <<<<<<<<<<<<<< * def __str__(self): * s = "server error %d" % self.num */ if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__where, __pyx_v_where) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("liblo.ServerError.__init__"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/das/src/pyliblo/src/liblo.pyx":178 * self.msg = msg * self.where = where * def __str__(self): # <<<<<<<<<<<<<< * s = "server error %d" % self.num * if self.where: s += " in %s" % self.where */ static PyObject *__pyx_pf_5liblo_11ServerError_1__str__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ static PyMethodDef __pyx_mdef_5liblo_11ServerError_1__str__ = {__Pyx_NAMESTR("__str__"), (PyCFunction)__pyx_pf_5liblo_11ServerError_1__str__, METH_O, __Pyx_DOCSTR(0)}; static PyObject *__pyx_pf_5liblo_11ServerError_1__str__(PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_v_s; PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; __Pyx_RefNannySetupContext("__str__"); __pyx_self = __pyx_self; __pyx_v_s = Py_None; __Pyx_INCREF(Py_None); /* "/home/das/src/pyliblo/src/liblo.pyx":179 * self.where = where * def __str__(self): * s = "server error %d" % self.num # <<<<<<<<<<<<<< * if self.where: s += " in %s" % self.where * s += ": %s" % self.msg */ __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__num); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_2), __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_v_s); __pyx_v_s = ((PyObject *)__pyx_t_2); __pyx_t_2 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":180 * def __str__(self): * s = "server error %d" % self.num * if self.where: s += " in %s" % self.where # <<<<<<<<<<<<<< * s += ": %s" % self.msg * return s */ __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__where); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__where); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_3), __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_s, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_v_s); __pyx_v_s = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L5; } __pyx_L5:; /* "/home/das/src/pyliblo/src/liblo.pyx":181 * s = "server error %d" % self.num * if self.where: s += " in %s" % self.where * s += ": %s" % self.msg # <<<<<<<<<<<<<< * return s * */ __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__msg); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_4), __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_s, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_v_s); __pyx_v_s = __pyx_t_2; __pyx_t_2 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":182 * if self.where: s += " in %s" % self.where * s += ": %s" % self.msg * return s # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_s); __pyx_r = __pyx_v_s; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("liblo.ServerError.__str__"); __pyx_r = NULL; __pyx_L0:; __Pyx_DECREF(__pyx_v_s); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/das/src/pyliblo/src/liblo.pyx":185 * * * cdef int _callback(const_char *path, const_char *types, lo_arg **argv, int argc, # <<<<<<<<<<<<<< * lo_message msg, void *cb_data) with gil: * cdef int i */ static int __pyx_f_5liblo__callback(const char *__pyx_v_path, const char *__pyx_v_types, lo_arg **__pyx_v_argv, int __pyx_v_argc, lo_message __pyx_v_msg, void *__pyx_v_cb_data) { int __pyx_v_i; char __pyx_v_t; unsigned char *__pyx_v_ptr; uint32_t __pyx_v_size; uint32_t __pyx_v_j; PyObject *__pyx_v_args; PyObject *__pyx_v_v; char *__pyx_v_url; struct __pyx_obj_5liblo_Address *__pyx_v_src; PyObject *__pyx_v_cb; PyObject *__pyx_v_func; PyObject *__pyx_v_func_args; PyObject *__pyx_v_n; PyObject *__pyx_v_r; int __pyx_r; PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; double __pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; uint32_t __pyx_t_9; int __pyx_t_10; Py_ssize_t __pyx_t_11; #ifdef WITH_THREAD PyGILState_STATE _save = PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("_callback"); __pyx_v_args = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); __pyx_v_v = Py_None; __Pyx_INCREF(Py_None); __pyx_v_src = ((struct __pyx_obj_5liblo_Address *)Py_None); __Pyx_INCREF(Py_None); __pyx_v_cb = Py_None; __Pyx_INCREF(Py_None); __pyx_v_func = Py_None; __Pyx_INCREF(Py_None); __pyx_v_func_args = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); __pyx_v_n = Py_None; __Pyx_INCREF(Py_None); __pyx_v_r = Py_None; __Pyx_INCREF(Py_None); /* "/home/das/src/pyliblo/src/liblo.pyx":192 * cdef uint32_t size, j * * args = [] # <<<<<<<<<<<<<< * * for i from 0 <= i < argc: */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __Pyx_DECREF(((PyObject *)__pyx_v_args)); __pyx_v_args = __pyx_t_1; __pyx_t_1 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":194 * args = [] * * for i from 0 <= i < argc: # <<<<<<<<<<<<<< * t = types[i] * if t == 'i': v = argv[i].i */ __pyx_t_2 = __pyx_v_argc; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { /* "/home/das/src/pyliblo/src/liblo.pyx":195 * * for i from 0 <= i < argc: * t = types[i] # <<<<<<<<<<<<<< * if t == 'i': v = argv[i].i * elif t == 'h': v = argv[i].h */ __pyx_v_t = (__pyx_v_types[__pyx_v_i]); /* "/home/das/src/pyliblo/src/liblo.pyx":196 * for i from 0 <= i < argc: * t = types[i] * if t == 'i': v = argv[i].i # <<<<<<<<<<<<<< * elif t == 'h': v = argv[i].h * elif t == 'f': v = argv[i].f */ __pyx_t_3 = (__pyx_v_t == 'i'); if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyInt_to_py_int32_t((__pyx_v_argv[__pyx_v_i])->i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_v_v); __pyx_v_v = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L5; } /* "/home/das/src/pyliblo/src/liblo.pyx":197 * t = types[i] * if t == 'i': v = argv[i].i * elif t == 'h': v = argv[i].h # <<<<<<<<<<<<<< * elif t == 'f': v = argv[i].f * elif t == 'd': v = argv[i].d */ __pyx_t_3 = (__pyx_v_t == 'h'); if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyInt_to_py_int64_t((__pyx_v_argv[__pyx_v_i])->h); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_v_v); __pyx_v_v = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L5; } /* "/home/das/src/pyliblo/src/liblo.pyx":198 * if t == 'i': v = argv[i].i * elif t == 'h': v = argv[i].h * elif t == 'f': v = argv[i].f # <<<<<<<<<<<<<< * elif t == 'd': v = argv[i].d * elif t == 'c': v = chr(argv[i].c) */ __pyx_t_3 = (__pyx_v_t == 'f'); if (__pyx_t_3) { __pyx_t_1 = PyFloat_FromDouble((__pyx_v_argv[__pyx_v_i])->f); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_v_v); __pyx_v_v = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L5; } /* "/home/das/src/pyliblo/src/liblo.pyx":199 * elif t == 'h': v = argv[i].h * elif t == 'f': v = argv[i].f * elif t == 'd': v = argv[i].d # <<<<<<<<<<<<<< * elif t == 'c': v = chr(argv[i].c) * elif t == 's': v = _decode(&argv[i].s) */ __pyx_t_3 = (__pyx_v_t == 'd'); if (__pyx_t_3) { __pyx_t_1 = PyFloat_FromDouble((__pyx_v_argv[__pyx_v_i])->d); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_v_v); __pyx_v_v = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L5; } /* "/home/das/src/pyliblo/src/liblo.pyx":200 * elif t == 'f': v = argv[i].f * elif t == 'd': v = argv[i].d * elif t == 'c': v = chr(argv[i].c) # <<<<<<<<<<<<<< * elif t == 's': v = _decode(&argv[i].s) * elif t == 'S': v = _decode(&argv[i].s) */ __pyx_t_3 = (__pyx_v_t == 'c'); if (__pyx_t_3) { __pyx_t_1 = PyInt_FromLong((__pyx_v_argv[__pyx_v_i])->c); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyObject_Call(__pyx_builtin_chr, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_v_v); __pyx_v_v = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L5; } /* "/home/das/src/pyliblo/src/liblo.pyx":201 * elif t == 'd': v = argv[i].d * elif t == 'c': v = chr(argv[i].c) * elif t == 's': v = _decode(&argv[i].s) # <<<<<<<<<<<<<< * elif t == 'S': v = _decode(&argv[i].s) * elif t == 'T': v = True */ __pyx_t_3 = (__pyx_v_t == 's'); if (__pyx_t_3) { __pyx_t_1 = PyBytes_FromString((&(__pyx_v_argv[__pyx_v_i])->s)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __pyx_t_4 = ((PyObject *)__pyx_f_5liblo__decode(((PyObject *)__pyx_t_1))); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_v_v); __pyx_v_v = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L5; } /* "/home/das/src/pyliblo/src/liblo.pyx":202 * elif t == 'c': v = chr(argv[i].c) * elif t == 's': v = _decode(&argv[i].s) * elif t == 'S': v = _decode(&argv[i].s) # <<<<<<<<<<<<<< * elif t == 'T': v = True * elif t == 'F': v = False */ __pyx_t_3 = (__pyx_v_t == 'S'); if (__pyx_t_3) { __pyx_t_4 = PyBytes_FromString((&(__pyx_v_argv[__pyx_v_i])->s)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); __pyx_t_1 = ((PyObject *)__pyx_f_5liblo__decode(((PyObject *)__pyx_t_4))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_v_v); __pyx_v_v = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L5; } /* "/home/das/src/pyliblo/src/liblo.pyx":203 * elif t == 's': v = _decode(&argv[i].s) * elif t == 'S': v = _decode(&argv[i].s) * elif t == 'T': v = True # <<<<<<<<<<<<<< * elif t == 'F': v = False * elif t == 'N': v = None */ __pyx_t_3 = (__pyx_v_t == 'T'); if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_v_v); __pyx_v_v = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L5; } /* "/home/das/src/pyliblo/src/liblo.pyx":204 * elif t == 'S': v = _decode(&argv[i].s) * elif t == 'T': v = True * elif t == 'F': v = False # <<<<<<<<<<<<<< * elif t == 'N': v = None * elif t == 'I': v = float('inf') */ __pyx_t_3 = (__pyx_v_t == 'F'); if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_v_v); __pyx_v_v = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L5; } /* "/home/das/src/pyliblo/src/liblo.pyx":205 * elif t == 'T': v = True * elif t == 'F': v = False * elif t == 'N': v = None # <<<<<<<<<<<<<< * elif t == 'I': v = float('inf') * elif t == 'm': v = (argv[i].m[0], argv[i].m[1], argv[i].m[2], argv[i].m[3]) */ __pyx_t_3 = (__pyx_v_t == 'N'); if (__pyx_t_3) { __Pyx_INCREF(Py_None); __Pyx_DECREF(__pyx_v_v); __pyx_v_v = Py_None; goto __pyx_L5; } /* "/home/das/src/pyliblo/src/liblo.pyx":206 * elif t == 'F': v = False * elif t == 'N': v = None * elif t == 'I': v = float('inf') # <<<<<<<<<<<<<< * elif t == 'm': v = (argv[i].m[0], argv[i].m[1], argv[i].m[2], argv[i].m[3]) * elif t == 't': v = _timetag_to_double(argv[i].t) */ __pyx_t_3 = (__pyx_v_t == 'I'); if (__pyx_t_3) { __pyx_t_5 = __Pyx_PyObject_AsDouble(((PyObject *)__pyx_n_s__inf)); if (unlikely(__pyx_t_5 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = PyFloat_FromDouble(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_v_v); __pyx_v_v = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L5; } /* "/home/das/src/pyliblo/src/liblo.pyx":207 * elif t == 'N': v = None * elif t == 'I': v = float('inf') * elif t == 'm': v = (argv[i].m[0], argv[i].m[1], argv[i].m[2], argv[i].m[3]) # <<<<<<<<<<<<<< * elif t == 't': v = _timetag_to_double(argv[i].t) * elif t == 'b': */ __pyx_t_3 = (__pyx_v_t == 'm'); if (__pyx_t_3) { __pyx_t_1 = __Pyx_PyInt_to_py_uint8_t(((__pyx_v_argv[__pyx_v_i])->m[0])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyInt_to_py_uint8_t(((__pyx_v_argv[__pyx_v_i])->m[1])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = __Pyx_PyInt_to_py_uint8_t(((__pyx_v_argv[__pyx_v_i])->m[2])); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = __Pyx_PyInt_to_py_uint8_t(((__pyx_v_argv[__pyx_v_i])->m[3])); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = PyTuple_New(4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_8)); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_1 = 0; __pyx_t_4 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __Pyx_DECREF(__pyx_v_v); __pyx_v_v = ((PyObject *)__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L5; } /* "/home/das/src/pyliblo/src/liblo.pyx":208 * elif t == 'I': v = float('inf') * elif t == 'm': v = (argv[i].m[0], argv[i].m[1], argv[i].m[2], argv[i].m[3]) * elif t == 't': v = _timetag_to_double(argv[i].t) # <<<<<<<<<<<<<< * elif t == 'b': * if PY_VERSION_HEX >= 0x03000000: */ __pyx_t_3 = (__pyx_v_t == 't'); if (__pyx_t_3) { __pyx_t_8 = PyFloat_FromDouble(__pyx_f_5liblo__timetag_to_double((__pyx_v_argv[__pyx_v_i])->t)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_v_v); __pyx_v_v = __pyx_t_8; __pyx_t_8 = 0; goto __pyx_L5; } /* "/home/das/src/pyliblo/src/liblo.pyx":209 * elif t == 'm': v = (argv[i].m[0], argv[i].m[1], argv[i].m[2], argv[i].m[3]) * elif t == 't': v = _timetag_to_double(argv[i].t) * elif t == 'b': # <<<<<<<<<<<<<< * if PY_VERSION_HEX >= 0x03000000: * v = bytes(lo_blob_dataptr(argv[i])) */ __pyx_t_3 = (__pyx_v_t == 'b'); if (__pyx_t_3) { /* "/home/das/src/pyliblo/src/liblo.pyx":210 * elif t == 't': v = _timetag_to_double(argv[i].t) * elif t == 'b': * if PY_VERSION_HEX >= 0x03000000: # <<<<<<<<<<<<<< * v = bytes(lo_blob_dataptr(argv[i])) * else: */ __pyx_t_3 = (PY_VERSION_HEX >= 0x03000000); if (__pyx_t_3) { /* "/home/das/src/pyliblo/src/liblo.pyx":211 * elif t == 'b': * if PY_VERSION_HEX >= 0x03000000: * v = bytes(lo_blob_dataptr(argv[i])) # <<<<<<<<<<<<<< * else: * # convert binary data to python list */ __pyx_t_8 = __Pyx_PyBytes_FromUString(((unsigned char *)lo_blob_dataptr((__pyx_v_argv[__pyx_v_i])))); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_8)); __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_7)); PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_t_8)); __Pyx_GIVEREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; __pyx_t_8 = PyObject_Call(((PyObject *)((PyObject*)(&PyBytes_Type))), ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_v_v); __pyx_v_v = __pyx_t_8; __pyx_t_8 = 0; goto __pyx_L6; } /*else*/ { /* "/home/das/src/pyliblo/src/liblo.pyx":214 * else: * # convert binary data to python list * v = [] # <<<<<<<<<<<<<< * ptr = lo_blob_dataptr(argv[i]) * size = lo_blob_datasize(argv[i]) */ __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_8)); __Pyx_DECREF(__pyx_v_v); __pyx_v_v = ((PyObject *)__pyx_t_8); __pyx_t_8 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":215 * # convert binary data to python list * v = [] * ptr = lo_blob_dataptr(argv[i]) # <<<<<<<<<<<<<< * size = lo_blob_datasize(argv[i]) * for j from 0 <= j < size: */ __pyx_v_ptr = ((unsigned char *)lo_blob_dataptr((__pyx_v_argv[__pyx_v_i]))); /* "/home/das/src/pyliblo/src/liblo.pyx":216 * v = [] * ptr = lo_blob_dataptr(argv[i]) * size = lo_blob_datasize(argv[i]) # <<<<<<<<<<<<<< * for j from 0 <= j < size: * v.append(ptr[j]) */ __pyx_v_size = lo_blob_datasize((__pyx_v_argv[__pyx_v_i])); /* "/home/das/src/pyliblo/src/liblo.pyx":217 * ptr = lo_blob_dataptr(argv[i]) * size = lo_blob_datasize(argv[i]) * for j from 0 <= j < size: # <<<<<<<<<<<<<< * v.append(ptr[j]) * else: */ __pyx_t_9 = __pyx_v_size; for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_9; __pyx_v_j++) { /* "/home/das/src/pyliblo/src/liblo.pyx":218 * size = lo_blob_datasize(argv[i]) * for j from 0 <= j < size: * v.append(ptr[j]) # <<<<<<<<<<<<<< * else: * v = None # unhandled data type */ __pyx_t_8 = PyInt_FromLong((__pyx_v_ptr[__pyx_v_j])); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = __Pyx_PyObject_Append(__pyx_v_v, __pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } } __pyx_L6:; goto __pyx_L5; } /*else*/ { /* "/home/das/src/pyliblo/src/liblo.pyx":220 * v.append(ptr[j]) * else: * v = None # unhandled data type # <<<<<<<<<<<<<< * * args.append(v) */ __Pyx_INCREF(Py_None); __Pyx_DECREF(__pyx_v_v); __pyx_v_v = Py_None; } __pyx_L5:; /* "/home/das/src/pyliblo/src/liblo.pyx":222 * v = None # unhandled data type * * args.append(v) # <<<<<<<<<<<<<< * * cdef char *url = lo_address_get_url(lo_message_get_source(msg)) */ if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_10 = PyList_Append(__pyx_v_args, __pyx_v_v); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } /* "/home/das/src/pyliblo/src/liblo.pyx":224 * args.append(v) * * cdef char *url = lo_address_get_url(lo_message_get_source(msg)) # <<<<<<<<<<<<<< * src = Address(url) * free(url) */ __pyx_v_url = lo_address_get_url(lo_message_get_source(__pyx_v_msg)); /* "/home/das/src/pyliblo/src/liblo.pyx":225 * * cdef char *url = lo_address_get_url(lo_message_get_source(msg)) * src = Address(url) # <<<<<<<<<<<<<< * free(url) * */ __pyx_t_7 = PyBytes_FromString(__pyx_v_url); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_7)); __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_8)); PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_t_7)); __Pyx_GIVEREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; __pyx_t_7 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5liblo_Address)), ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_src)); __pyx_v_src = ((struct __pyx_obj_5liblo_Address *)__pyx_t_7); __pyx_t_7 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":226 * cdef char *url = lo_address_get_url(lo_message_get_source(msg)) * src = Address(url) * free(url) # <<<<<<<<<<<<<< * * cb = cb_data */ free(__pyx_v_url); /* "/home/das/src/pyliblo/src/liblo.pyx":228 * free(url) * * cb = cb_data # <<<<<<<<<<<<<< * * if isinstance(cb.func, _weakref_method): */ __Pyx_INCREF(((PyObject *)__pyx_v_cb_data)); __Pyx_DECREF(__pyx_v_cb); __pyx_v_cb = ((PyObject *)__pyx_v_cb_data); /* "/home/das/src/pyliblo/src/liblo.pyx":230 * cb = cb_data * * if isinstance(cb.func, _weakref_method): # <<<<<<<<<<<<<< * func = cb.func() * else: */ __pyx_t_7 = PyObject_GetAttr(__pyx_v_cb, __pyx_n_s__func); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = __Pyx_GetName(__pyx_m, __pyx_n_s___weakref_method); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_3 = PyObject_IsInstance(__pyx_t_7, __pyx_t_8); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_3) { /* "/home/das/src/pyliblo/src/liblo.pyx":231 * * if isinstance(cb.func, _weakref_method): * func = cb.func() # <<<<<<<<<<<<<< * else: * func = cb.func */ __pyx_t_8 = PyObject_GetAttr(__pyx_v_cb, __pyx_n_s__func); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = PyObject_Call(__pyx_t_8, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_v_func); __pyx_v_func = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L9; } /*else*/ { /* "/home/das/src/pyliblo/src/liblo.pyx":233 * func = cb.func() * else: * func = cb.func # <<<<<<<<<<<<<< * * func_args = (_decode(path), */ __pyx_t_7 = PyObject_GetAttr(__pyx_v_cb, __pyx_n_s__func); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_v_func); __pyx_v_func = __pyx_t_7; __pyx_t_7 = 0; } __pyx_L9:; /* "/home/das/src/pyliblo/src/liblo.pyx":235 * func = cb.func * * func_args = (_decode(path), # <<<<<<<<<<<<<< * args, * _decode(types), */ __pyx_t_7 = PyBytes_FromString(((char *)__pyx_v_path)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_7)); __pyx_t_8 = ((PyObject *)__pyx_f_5liblo__decode(((PyObject *)__pyx_t_7))); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":237 * func_args = (_decode(path), * args, * _decode(types), # <<<<<<<<<<<<<< * src, * cb.user_data) */ __pyx_t_7 = PyBytes_FromString(((char *)__pyx_v_types)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_7)); __pyx_t_6 = ((PyObject *)__pyx_f_5liblo__decode(((PyObject *)__pyx_t_7))); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":239 * _decode(types), * src, * cb.user_data) # <<<<<<<<<<<<<< * * # call function */ __pyx_t_7 = PyObject_GetAttr(__pyx_v_cb, __pyx_n_s__user_data); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); __Pyx_INCREF(((PyObject *)__pyx_v_args)); PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_args)); __Pyx_GIVEREF(((PyObject *)__pyx_v_args)); PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); __Pyx_INCREF(((PyObject *)__pyx_v_src)); PyTuple_SET_ITEM(__pyx_t_4, 3, ((PyObject *)__pyx_v_src)); __Pyx_GIVEREF(((PyObject *)__pyx_v_src)); PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); __pyx_t_8 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_func_args)); __pyx_v_func_args = __pyx_t_4; __pyx_t_4 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":242 * * # call function * if _inspect.getargspec(func)[1] == None: # <<<<<<<<<<<<<< * # determine number of arguments to call the function with * n = len(_inspect.getargspec(func)[0]) */ __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s___inspect); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s__getargspec); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); __Pyx_INCREF(__pyx_v_func); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_func); __Pyx_GIVEREF(__pyx_v_func); __pyx_t_6 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_6, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, Py_None, Py_EQ); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_3) { /* "/home/das/src/pyliblo/src/liblo.pyx":244 * if _inspect.getargspec(func)[1] == None: * # determine number of arguments to call the function with * n = len(_inspect.getargspec(func)[0]) # <<<<<<<<<<<<<< * if _inspect.ismethod(func): * n -= 1 # self doesn't count */ __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s___inspect); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__getargspec); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_6)); __Pyx_INCREF(__pyx_v_func); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_func); __Pyx_GIVEREF(__pyx_v_func); __pyx_t_7 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_7, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_11 = PyObject_Length(__pyx_t_6); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_11); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_v_n); __pyx_v_n = __pyx_t_6; __pyx_t_6 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":245 * # determine number of arguments to call the function with * n = len(_inspect.getargspec(func)[0]) * if _inspect.ismethod(func): # <<<<<<<<<<<<<< * n -= 1 # self doesn't count * r = func(*func_args[0:n]) */ __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s___inspect); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = PyObject_GetAttr(__pyx_t_6, __pyx_n_s__ismethod); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_6)); __Pyx_INCREF(__pyx_v_func); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_func); __Pyx_GIVEREF(__pyx_v_func); __pyx_t_4 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_3) { /* "/home/das/src/pyliblo/src/liblo.pyx":246 * n = len(_inspect.getargspec(func)[0]) * if _inspect.ismethod(func): * n -= 1 # self doesn't count # <<<<<<<<<<<<<< * r = func(*func_args[0:n]) * else: */ __pyx_t_4 = PyNumber_InPlaceSubtract(__pyx_v_n, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_v_n); __pyx_v_n = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L11; } __pyx_L11:; /* "/home/das/src/pyliblo/src/liblo.pyx":247 * if _inspect.ismethod(func): * n -= 1 # self doesn't count * r = func(*func_args[0:n]) # <<<<<<<<<<<<<< * else: * # function has argument list, pass all arguments */ __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_n); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = __Pyx_PySequence_GetSlice(((PyObject *)__pyx_v_func_args), 0, __pyx_t_11); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); __pyx_t_6 = PySequence_Tuple(((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_6)); __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __pyx_t_4 = PyObject_Call(__pyx_v_func, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_v_r); __pyx_v_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L10; } /*else*/ { /* "/home/das/src/pyliblo/src/liblo.pyx":250 * else: * # function has argument list, pass all arguments * r = func(*func_args) # <<<<<<<<<<<<<< * * if r == None: */ __pyx_t_4 = PySequence_Tuple(((PyObject *)__pyx_v_func_args)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); __pyx_t_6 = PyObject_Call(__pyx_v_func, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_v_r); __pyx_v_r = __pyx_t_6; __pyx_t_6 = 0; } __pyx_L10:; /* "/home/das/src/pyliblo/src/liblo.pyx":252 * r = func(*func_args) * * if r == None: # <<<<<<<<<<<<<< * return 0 * else: */ __pyx_t_6 = PyObject_RichCompare(__pyx_v_r, Py_None, Py_EQ); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_3) { /* "/home/das/src/pyliblo/src/liblo.pyx":253 * * if r == None: * return 0 # <<<<<<<<<<<<<< * else: * return r */ __pyx_r = 0; goto __pyx_L0; goto __pyx_L12; } /*else*/ { /* "/home/das/src/pyliblo/src/liblo.pyx":255 * return 0 * else: * return r # <<<<<<<<<<<<<< * * */ __pyx_t_2 = __Pyx_PyInt_AsInt(__pyx_v_r); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = __pyx_t_2; goto __pyx_L0; } __pyx_L12:; __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_WriteUnraisable("liblo._callback"); __pyx_r = 0; __pyx_L0:; __Pyx_DECREF(__pyx_v_args); __Pyx_DECREF(__pyx_v_v); __Pyx_DECREF((PyObject *)__pyx_v_src); __Pyx_DECREF(__pyx_v_cb); __Pyx_DECREF(__pyx_v_func); __Pyx_DECREF(__pyx_v_func_args); __Pyx_DECREF(__pyx_v_n); __Pyx_DECREF(__pyx_v_r); __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD PyGILState_Release(_save); #endif return __pyx_r; } /* "/home/das/src/pyliblo/src/liblo.pyx":258 * * * cdef void _err_handler(int num, const_char *msg, const_char *where) with gil: # <<<<<<<<<<<<<< * # can't raise exception in cdef callback function, so use a global variable * # instead */ static void __pyx_f_5liblo__err_handler(int __pyx_v_num, const char *__pyx_v_msg, const char *__pyx_v_where) { PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; int __pyx_t_5; #ifdef WITH_THREAD PyGILState_STATE _save = PyGILState_Ensure(); #endif __Pyx_RefNannySetupContext("_err_handler"); /* "/home/das/src/pyliblo/src/liblo.pyx":262 * # instead * global __exception * __exception = ServerError(num, msg, None) # <<<<<<<<<<<<<< * if where: __exception.where = where * */ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__ServerError); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyInt_FromLong(__pyx_v_num); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyBytes_FromString(((char *)__pyx_v_msg)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_4)); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_t_3)); __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); __Pyx_INCREF(Py_None); PyTuple_SET_ITEM(__pyx_t_4, 2, Py_None); __Pyx_GIVEREF(Py_None); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_s____exception, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":263 * global __exception * __exception = ServerError(num, msg, None) * if where: __exception.where = where # <<<<<<<<<<<<<< * * */ __pyx_t_5 = (__pyx_v_where != 0); if (__pyx_t_5) { __pyx_t_3 = PyBytes_FromString(((char *)__pyx_v_where)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s____exception); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); if (PyObject_SetAttr(__pyx_t_4, __pyx_n_s__where, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L3; } __pyx_L3:; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_WriteUnraisable("liblo._err_handler"); __pyx_L0:; __Pyx_RefNannyFinishContext(); #ifdef WITH_THREAD PyGILState_Release(_save); #endif } /* "/home/das/src/pyliblo/src/liblo.pyx":279 * _counter = 0 * * def __init__(self, path, types, user_data=None): # <<<<<<<<<<<<<< * self.spec = struct(counter=make_method._counter, * path=path, */ static PyObject *__pyx_pf_5liblo_11make_method_0__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_5liblo_11make_method_0__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pf_5liblo_11make_method_0__init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; static PyObject *__pyx_pf_5liblo_11make_method_0__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_path = 0; PyObject *__pyx_v_types = 0; PyObject *__pyx_v_user_data = 0; PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__path,&__pyx_n_s__types,&__pyx_n_s__user_data,0}; __Pyx_RefNannySetupContext("__init__"); __pyx_self = __pyx_self; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[4] = {0,0,0,0}; values[3] = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self); if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; case 1: values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__path); if (likely(values[1])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__types); if (likely(values[2])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__user_data); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __pyx_v_self = values[0]; __pyx_v_path = values[1]; __pyx_v_types = values[2]; __pyx_v_user_data = values[3]; } else { __pyx_v_user_data = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: __pyx_v_user_data = PyTuple_GET_ITEM(__pyx_args, 3); case 3: __pyx_v_types = PyTuple_GET_ITEM(__pyx_args, 2); __pyx_v_path = PyTuple_GET_ITEM(__pyx_args, 1); __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("liblo.make_method.__init__"); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; /* "/home/das/src/pyliblo/src/liblo.pyx":280 * * def __init__(self, path, types, user_data=None): * self.spec = struct(counter=make_method._counter, # <<<<<<<<<<<<<< * path=path, * types=types, */ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__struct); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__make_method); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s___counter); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__counter), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":281 * def __init__(self, path, types, user_data=None): * self.spec = struct(counter=make_method._counter, * path=path, # <<<<<<<<<<<<<< * types=types, * user_data=user_data) */ if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__path), __pyx_v_path) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "/home/das/src/pyliblo/src/liblo.pyx":282 * self.spec = struct(counter=make_method._counter, * path=path, * types=types, # <<<<<<<<<<<<<< * user_data=user_data) * make_method._counter += 1 */ if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__types), __pyx_v_types) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "/home/das/src/pyliblo/src/liblo.pyx":283 * path=path, * types=types, * user_data=user_data) # <<<<<<<<<<<<<< * make_method._counter += 1 * */ if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__user_data), __pyx_v_user_data) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":280 * * def __init__(self, path, types, user_data=None): * self.spec = struct(counter=make_method._counter, # <<<<<<<<<<<<<< * path=path, * types=types, */ if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__spec, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":284 * types=types, * user_data=user_data) * make_method._counter += 1 # <<<<<<<<<<<<<< * * def __call__(self, f): */ __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__make_method); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_n_s___counter); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__make_method); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyObject_SetAttr(__pyx_t_2, __pyx_n_s___counter, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_AddTraceback("liblo.make_method.__init__"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/das/src/pyliblo/src/liblo.pyx":286 * make_method._counter += 1 * * def __call__(self, f): # <<<<<<<<<<<<<< * # we can't access the Server object here, because at the time the * # decorator is run it doesn't even exist yet, so we store the */ static PyObject *__pyx_pf_5liblo_11make_method_1__call__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_5liblo_11make_method_1__call__ = {__Pyx_NAMESTR("__call__"), (PyCFunction)__pyx_pf_5liblo_11make_method_1__call__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; static PyObject *__pyx_pf_5liblo_11make_method_1__call__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_f = 0; PyObject *__pyx_r = NULL; int __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__f,0}; __Pyx_RefNannySetupContext("__call__"); __pyx_self = __pyx_self; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[2] = {0,0}; switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self); if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; case 1: values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f); if (likely(values[1])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__call__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__call__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __pyx_v_self = values[0]; __pyx_v_f = values[1]; } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0); __pyx_v_f = PyTuple_GET_ITEM(__pyx_args, 1); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__call__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("liblo.make_method.__call__"); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; /* "/home/das/src/pyliblo/src/liblo.pyx":290 * # decorator is run it doesn't even exist yet, so we store the * # path/typespec in the function object instead... * if not hasattr(f, '_method_spec'): # <<<<<<<<<<<<<< * f._method_spec = [] * f._method_spec.append(self.spec) */ __pyx_t_1 = PyObject_HasAttr(__pyx_v_f, ((PyObject *)__pyx_n_s___method_spec)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { /* "/home/das/src/pyliblo/src/liblo.pyx":291 * # path/typespec in the function object instead... * if not hasattr(f, '_method_spec'): * f._method_spec = [] # <<<<<<<<<<<<<< * f._method_spec.append(self.spec) * return f */ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); if (PyObject_SetAttr(__pyx_v_f, __pyx_n_s___method_spec, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; goto __pyx_L6; } __pyx_L6:; /* "/home/das/src/pyliblo/src/liblo.pyx":292 * if not hasattr(f, '_method_spec'): * f._method_spec = [] * f._method_spec.append(self.spec) # <<<<<<<<<<<<<< * return f * */ __pyx_t_3 = PyObject_GetAttr(__pyx_v_f, __pyx_n_s___method_spec); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__spec); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __Pyx_PyObject_Append(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":293 * f._method_spec = [] * f._method_spec.append(self.spec) * return f # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __Pyx_INCREF(__pyx_v_f); __pyx_r = __pyx_v_f; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("liblo.make_method.__call__"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/das/src/pyliblo/src/liblo.pyx":302 * cdef list _keep_refs * * def __init__(self, **kwargs): # <<<<<<<<<<<<<< * self._keep_refs = [] * */ static int __pyx_pf_5liblo_11_ServerBase_0__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pf_5liblo_11_ServerBase_0__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_kwargs = 0; int __pyx_r; PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; PyObject *__pyx_t_5 = NULL; __Pyx_RefNannySetupContext("__init__"); if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;} if (__pyx_kwds && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 1))) return -1; __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; __Pyx_GOTREF(__pyx_v_kwargs); /* "/home/das/src/pyliblo/src/liblo.pyx":303 * * def __init__(self, **kwargs): * self._keep_refs = [] # <<<<<<<<<<<<<< * * if 'reg_methods' not in kwargs or kwargs['reg_methods']: */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); __Pyx_GOTREF(((struct __pyx_obj_5liblo__ServerBase *)__pyx_v_self)->_keep_refs); __Pyx_DECREF(((PyObject *)((struct __pyx_obj_5liblo__ServerBase *)__pyx_v_self)->_keep_refs)); ((struct __pyx_obj_5liblo__ServerBase *)__pyx_v_self)->_keep_refs = __pyx_t_1; __pyx_t_1 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":305 * self._keep_refs = [] * * if 'reg_methods' not in kwargs or kwargs['reg_methods']: # <<<<<<<<<<<<<< * self.register_methods() * */ if (unlikely(__pyx_v_kwargs == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_2 = (__Pyx_NegateNonNeg(PyDict_Contains(((PyObject *)__pyx_v_kwargs), ((PyObject *)__pyx_n_s__reg_methods)))); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!__pyx_t_2) { __pyx_t_1 = __Pyx_PyDict_GetItem(((PyObject *)__pyx_v_kwargs), ((PyObject *)__pyx_n_s__reg_methods)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = __pyx_t_3; } else { __pyx_t_4 = __pyx_t_2; } if (__pyx_t_4) { /* "/home/das/src/pyliblo/src/liblo.pyx":306 * * if 'reg_methods' not in kwargs or kwargs['reg_methods']: * self.register_methods() # <<<<<<<<<<<<<< * * def register_methods(self, obj=None): */ __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__register_methods); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L5; } __pyx_L5:; __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("liblo._ServerBase.__init__"); __pyx_r = -1; __pyx_L0:; __Pyx_DECREF(__pyx_v_kwargs); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/das/src/pyliblo/src/liblo.pyx":326 * methods.append(struct(spec=spec, name=m[1])) * # sort by counter * methods.sort(key=lambda x: x.spec.counter) # <<<<<<<<<<<<<< * for e in methods: * self.add_method(e.spec.path, e.spec.types, e.name, e.spec.user_data) */ static PyObject *__pyx_lambda_funcdef5liblo_16register_methods_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/ static PyMethodDef __pyx_lambda_methdef5liblo_16register_methods_lambda1 = {__Pyx_NAMESTR("__pyx_lambda_funcdef5liblo_16register_methods_lambda1"), (PyCFunction)__pyx_lambda_funcdef5liblo_16register_methods_lambda1, METH_O, __Pyx_DOCSTR(0)}; static PyObject *__pyx_lambda_funcdef5liblo_16register_methods_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_x) { PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("__pyx_lambda_funcdef5liblo_16register_methods_lambda1"); __pyx_self = __pyx_self; __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyObject_GetAttr(__pyx_v_x, __pyx_n_s__spec); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__counter); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("liblo.register_methods.lambda1"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/das/src/pyliblo/src/liblo.pyx":308 * self.register_methods() * * def register_methods(self, obj=None): # <<<<<<<<<<<<<< * """ * register_methods([obj]) */ static PyObject *__pyx_pf_5liblo_11_ServerBase_1register_methods(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_5liblo_11_ServerBase_1register_methods[] = "\n register_methods([obj])\n\n Calls add_method() for all methods of obj decorated with @make_method.\n obj defaults to the Server object itself. This function is called\n automatically by the Server's init function, unless its reg_methods\n parameter is False.\n "; static PyObject *__pyx_pf_5liblo_11_ServerBase_1register_methods(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_obj = 0; PyObject *__pyx_v_methods; PyObject *__pyx_v_m; PyObject *__pyx_v_spec; PyObject *__pyx_v_e; PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; int __pyx_t_2; Py_ssize_t __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; Py_ssize_t __pyx_t_6; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__obj,0}; __Pyx_RefNannySetupContext("register_methods"); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__obj); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "register_methods") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __pyx_v_obj = values[0]; } else { __pyx_v_obj = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: __pyx_v_obj = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("register_methods", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("liblo._ServerBase.register_methods"); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __Pyx_INCREF(__pyx_v_obj); __pyx_v_methods = Py_None; __Pyx_INCREF(Py_None); __pyx_v_m = Py_None; __Pyx_INCREF(Py_None); __pyx_v_spec = Py_None; __Pyx_INCREF(Py_None); __pyx_v_e = Py_None; __Pyx_INCREF(Py_None); /* "/home/das/src/pyliblo/src/liblo.pyx":317 * parameter is False. * """ * if obj == None: # <<<<<<<<<<<<<< * obj = self * # find and register methods that were defined using decorators */ __pyx_t_1 = PyObject_RichCompare(__pyx_v_obj, Py_None, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "/home/das/src/pyliblo/src/liblo.pyx":318 * """ * if obj == None: * obj = self # <<<<<<<<<<<<<< * # find and register methods that were defined using decorators * methods = [] */ __Pyx_INCREF(__pyx_v_self); __Pyx_DECREF(__pyx_v_obj); __pyx_v_obj = __pyx_v_self; goto __pyx_L6; } __pyx_L6:; /* "/home/das/src/pyliblo/src/liblo.pyx":320 * obj = self * # find and register methods that were defined using decorators * methods = [] # <<<<<<<<<<<<<< * for m in _inspect.getmembers(obj): * if hasattr(m[1], '_method_spec'): */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __Pyx_DECREF(__pyx_v_methods); __pyx_v_methods = ((PyObject *)__pyx_t_1); __pyx_t_1 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":321 * # find and register methods that were defined using decorators * methods = [] * for m in _inspect.getmembers(obj): # <<<<<<<<<<<<<< * if hasattr(m[1], '_method_spec'): * for spec in m[1]._method_spec: */ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___inspect); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__getmembers); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __Pyx_INCREF(__pyx_v_obj); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_obj); __Pyx_GIVEREF(__pyx_v_obj); __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; if (PyList_CheckExact(__pyx_t_5) || PyTuple_CheckExact(__pyx_t_5)) { __pyx_t_3 = 0; __pyx_t_1 = __pyx_t_5; __Pyx_INCREF(__pyx_t_1); } else { __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; for (;;) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break; __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; } else if (likely(PyTuple_CheckExact(__pyx_t_1))) { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break; __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; } else { __pyx_t_5 = PyIter_Next(__pyx_t_1); if (!__pyx_t_5) { if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;} break; } __Pyx_GOTREF(__pyx_t_5); } __Pyx_DECREF(__pyx_v_m); __pyx_v_m = __pyx_t_5; __pyx_t_5 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":322 * methods = [] * for m in _inspect.getmembers(obj): * if hasattr(m[1], '_method_spec'): # <<<<<<<<<<<<<< * for spec in m[1]._method_spec: * methods.append(struct(spec=spec, name=m[1])) */ __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_m, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = PyObject_HasAttr(__pyx_t_5, ((PyObject *)__pyx_n_s___method_spec)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_2) { /* "/home/das/src/pyliblo/src/liblo.pyx":323 * for m in _inspect.getmembers(obj): * if hasattr(m[1], '_method_spec'): * for spec in m[1]._method_spec: # <<<<<<<<<<<<<< * methods.append(struct(spec=spec, name=m[1])) * # sort by counter */ __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_m, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_4 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s___method_spec); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (PyList_CheckExact(__pyx_t_4) || PyTuple_CheckExact(__pyx_t_4)) { __pyx_t_6 = 0; __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); } else { __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; for (;;) { if (likely(PyList_CheckExact(__pyx_t_5))) { if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break; __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; } else if (likely(PyTuple_CheckExact(__pyx_t_5))) { if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break; __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; } else { __pyx_t_4 = PyIter_Next(__pyx_t_5); if (!__pyx_t_4) { if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} break; } __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_v_spec); __pyx_v_spec = __pyx_t_4; __pyx_t_4 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":324 * if hasattr(m[1], '_method_spec'): * for spec in m[1]._method_spec: * methods.append(struct(spec=spec, name=m[1])) # <<<<<<<<<<<<<< * # sort by counter * methods.sort(key=lambda x: x.spec.counter) */ __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__struct); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_7)); if (PyDict_SetItem(__pyx_t_7, ((PyObject *)__pyx_n_s__spec), __pyx_v_spec) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_m, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); if (PyDict_SetItem(__pyx_t_7, ((PyObject *)__pyx_n_s__name), __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = PyEval_CallObjectWithKeywords(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; __pyx_t_7 = __Pyx_PyObject_Append(__pyx_v_methods, __pyx_t_8); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L9; } __pyx_L9:; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":326 * methods.append(struct(spec=spec, name=m[1])) * # sort by counter * methods.sort(key=lambda x: x.spec.counter) # <<<<<<<<<<<<<< * for e in methods: * self.add_method(e.spec.path, e.spec.types, e.name, e.spec.user_data) */ __pyx_t_1 = PyObject_GetAttr(__pyx_v_methods, __pyx_n_s__sort); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_5)); __pyx_t_7 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_lambda_methdef5liblo_16register_methods_lambda1, NULL, __pyx_n_s__liblo); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__key), __pyx_t_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":327 * # sort by counter * methods.sort(key=lambda x: x.spec.counter) * for e in methods: # <<<<<<<<<<<<<< * self.add_method(e.spec.path, e.spec.types, e.name, e.spec.user_data) * */ if (PyList_CheckExact(__pyx_v_methods) || PyTuple_CheckExact(__pyx_v_methods)) { __pyx_t_3 = 0; __pyx_t_7 = __pyx_v_methods; __Pyx_INCREF(__pyx_t_7); } else { __pyx_t_3 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_methods); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); } for (;;) { if (likely(PyList_CheckExact(__pyx_t_7))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_7)) break; __pyx_t_5 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; } else if (likely(PyTuple_CheckExact(__pyx_t_7))) { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_7)) break; __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; } else { __pyx_t_5 = PyIter_Next(__pyx_t_7); if (!__pyx_t_5) { if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} break; } __Pyx_GOTREF(__pyx_t_5); } __Pyx_DECREF(__pyx_v_e); __pyx_v_e = __pyx_t_5; __pyx_t_5 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":328 * methods.sort(key=lambda x: x.spec.counter) * for e in methods: * self.add_method(e.spec.path, e.spec.types, e.name, e.spec.user_data) # <<<<<<<<<<<<<< * * def get_url(self): */ __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__add_method); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = PyObject_GetAttr(__pyx_v_e, __pyx_n_s__spec); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__path); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyObject_GetAttr(__pyx_v_e, __pyx_n_s__spec); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__types); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyObject_GetAttr(__pyx_v_e, __pyx_n_s__name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = PyObject_GetAttr(__pyx_v_e, __pyx_n_s__spec); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = PyObject_GetAttr(__pyx_t_9, __pyx_n_s__user_data); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = PyTuple_New(4); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_9)); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); __pyx_t_8 = 0; __pyx_t_4 = 0; __pyx_t_1 = 0; __pyx_t_10 = 0; __pyx_t_10 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("liblo._ServerBase.register_methods"); __pyx_r = NULL; __pyx_L0:; __Pyx_DECREF(__pyx_v_methods); __Pyx_DECREF(__pyx_v_m); __Pyx_DECREF(__pyx_v_spec); __Pyx_DECREF(__pyx_v_e); __Pyx_DECREF(__pyx_v_obj); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/das/src/pyliblo/src/liblo.pyx":330 * self.add_method(e.spec.path, e.spec.types, e.name, e.spec.user_data) * * def get_url(self): # <<<<<<<<<<<<<< * cdef char *tmp = lo_server_get_url(self._server) * cdef object r = tmp */ static PyObject *__pyx_pf_5liblo_11_ServerBase_2get_url(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pf_5liblo_11_ServerBase_2get_url(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { char *__pyx_v_tmp; PyObject *__pyx_v_r = 0; PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("get_url"); /* "/home/das/src/pyliblo/src/liblo.pyx":331 * * def get_url(self): * cdef char *tmp = lo_server_get_url(self._server) # <<<<<<<<<<<<<< * cdef object r = tmp * free(tmp) */ __pyx_v_tmp = lo_server_get_url(((struct __pyx_obj_5liblo__ServerBase *)__pyx_v_self)->_server); /* "/home/das/src/pyliblo/src/liblo.pyx":332 * def get_url(self): * cdef char *tmp = lo_server_get_url(self._server) * cdef object r = tmp # <<<<<<<<<<<<<< * free(tmp) * return _decode(r) */ __pyx_t_1 = PyBytes_FromString(__pyx_v_tmp); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __pyx_v_r = ((PyObject *)__pyx_t_1); __pyx_t_1 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":333 * cdef char *tmp = lo_server_get_url(self._server) * cdef object r = tmp * free(tmp) # <<<<<<<<<<<<<< * return _decode(r) * */ free(__pyx_v_tmp); /* "/home/das/src/pyliblo/src/liblo.pyx":334 * cdef object r = tmp * free(tmp) * return _decode(r) # <<<<<<<<<<<<<< * * def get_port(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_5liblo__decode(__pyx_v_r)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("liblo._ServerBase.get_url"); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_r); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/das/src/pyliblo/src/liblo.pyx":336 * return _decode(r) * * def get_port(self): # <<<<<<<<<<<<<< * return lo_server_get_port(self._server) * */ static PyObject *__pyx_pf_5liblo_11_ServerBase_3get_port(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pf_5liblo_11_ServerBase_3get_port(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("get_port"); /* "/home/das/src/pyliblo/src/liblo.pyx":337 * * def get_port(self): * return lo_server_get_port(self._server) # <<<<<<<<<<<<<< * * def get_protocol(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyInt_FromLong(lo_server_get_port(((struct __pyx_obj_5liblo__ServerBase *)__pyx_v_self)->_server)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("liblo._ServerBase.get_port"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/das/src/pyliblo/src/liblo.pyx":339 * return lo_server_get_port(self._server) * * def get_protocol(self): # <<<<<<<<<<<<<< * return lo_server_get_protocol(self._server) * */ static PyObject *__pyx_pf_5liblo_11_ServerBase_4get_protocol(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pf_5liblo_11_ServerBase_4get_protocol(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("get_protocol"); /* "/home/das/src/pyliblo/src/liblo.pyx":340 * * def get_protocol(self): * return lo_server_get_protocol(self._server) # <<<<<<<<<<<<<< * * def fileno(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyInt_FromLong(lo_server_get_protocol(((struct __pyx_obj_5liblo__ServerBase *)__pyx_v_self)->_server)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("liblo._ServerBase.get_protocol"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/das/src/pyliblo/src/liblo.pyx":342 * return lo_server_get_protocol(self._server) * * def fileno(self): # <<<<<<<<<<<<<< * """ * fileno() */ static PyObject *__pyx_pf_5liblo_11_ServerBase_5fileno(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_5liblo_11_ServerBase_5fileno[] = "\n fileno()\n\n Returns the file descriptor of the server socket, or -1 if not supported\n by the underlying server protocol.\n "; static PyObject *__pyx_pf_5liblo_11_ServerBase_5fileno(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("fileno"); /* "/home/das/src/pyliblo/src/liblo.pyx":349 * by the underlying server protocol. * """ * return lo_server_get_socket_fd(self._server) # <<<<<<<<<<<<<< * * def add_method(self, path, typespec, func, user_data=None): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyInt_FromLong(lo_server_get_socket_fd(((struct __pyx_obj_5liblo__ServerBase *)__pyx_v_self)->_server)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("liblo._ServerBase.fileno"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/das/src/pyliblo/src/liblo.pyx":351 * return lo_server_get_socket_fd(self._server) * * def add_method(self, path, typespec, func, user_data=None): # <<<<<<<<<<<<<< * """ * add_method(path, typespec, callback_func[, user_data]) */ static PyObject *__pyx_pf_5liblo_11_ServerBase_6add_method(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_5liblo_11_ServerBase_6add_method[] = "\n add_method(path, typespec, callback_func[, user_data])\n\n Registers a callback function for OSC messages with matching path and\n argument types. For both path and typespec, None may be used as a\n wildcard. The optional user_data will be passed on to the callback\n function. callback_func may be a global function or a class method,\n pyliblo will know what to do either way.\n "; static PyObject *__pyx_pf_5liblo_11_ServerBase_6add_method(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_path = 0; PyObject *__pyx_v_typespec = 0; PyObject *__pyx_v_func = 0; PyObject *__pyx_v_user_data = 0; char *__pyx_v_p; char *__pyx_v_t; PyObject *__pyx_v_s; PyObject *__pyx_v_s2; PyObject *__pyx_v_cb; PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; int __pyx_t_4; char *__pyx_t_5; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; int __pyx_t_8; static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__path,&__pyx_n_s__typespec,&__pyx_n_s__func,&__pyx_n_s__user_data,0}; __Pyx_RefNannySetupContext("add_method"); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[4] = {0,0,0,0}; values[3] = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__path); if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; case 1: values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__typespec); if (likely(values[1])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("add_method", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 2: values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__func); if (likely(values[2])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("add_method", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } case 3: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__user_data); if (value) { values[3] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "add_method") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __pyx_v_path = values[0]; __pyx_v_typespec = values[1]; __pyx_v_func = values[2]; __pyx_v_user_data = values[3]; } else { __pyx_v_user_data = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 4: __pyx_v_user_data = PyTuple_GET_ITEM(__pyx_args, 3); case 3: __pyx_v_func = PyTuple_GET_ITEM(__pyx_args, 2); __pyx_v_typespec = PyTuple_GET_ITEM(__pyx_args, 1); __pyx_v_path = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("add_method", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("liblo._ServerBase.add_method"); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; __Pyx_INCREF(__pyx_v_func); __pyx_v_s = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); __pyx_v_s2 = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); __pyx_v_cb = Py_None; __Pyx_INCREF(Py_None); /* "/home/das/src/pyliblo/src/liblo.pyx":364 * cdef char *t * * if isinstance(path, (bytes, unicode)): # <<<<<<<<<<<<<< * s = _encode(path) * p = s */ __Pyx_INCREF(__pyx_v_path); __pyx_t_1 = __pyx_v_path; __pyx_t_2 = PyBytes_Check(__pyx_t_1); if (!__pyx_t_2) { __pyx_t_3 = PyUnicode_Check(__pyx_t_1); __pyx_t_4 = __pyx_t_3; } else { __pyx_t_4 = __pyx_t_2; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_4) { /* "/home/das/src/pyliblo/src/liblo.pyx":365 * * if isinstance(path, (bytes, unicode)): * s = _encode(path) # <<<<<<<<<<<<<< * p = s * elif path == None: */ __pyx_t_1 = ((PyObject *)__pyx_f_5liblo__encode(__pyx_v_path)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_v_s)); __pyx_v_s = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":366 * if isinstance(path, (bytes, unicode)): * s = _encode(path) * p = s # <<<<<<<<<<<<<< * elif path == None: * p = NULL */ __pyx_t_5 = PyBytes_AsString(((PyObject *)__pyx_v_s)); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_p = __pyx_t_5; goto __pyx_L6; } /* "/home/das/src/pyliblo/src/liblo.pyx":367 * s = _encode(path) * p = s * elif path == None: # <<<<<<<<<<<<<< * p = NULL * else: */ __pyx_t_1 = PyObject_RichCompare(__pyx_v_path, Py_None, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_4) { /* "/home/das/src/pyliblo/src/liblo.pyx":368 * p = s * elif path == None: * p = NULL # <<<<<<<<<<<<<< * else: * raise TypeError("path must be a string or None") */ __pyx_v_p = NULL; goto __pyx_L6; } /*else*/ { /* "/home/das/src/pyliblo/src/liblo.pyx":370 * p = NULL * else: * raise TypeError("path must be a string or None") # <<<<<<<<<<<<<< * * if isinstance(typespec, (bytes, unicode)): */ __pyx_t_1 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_6), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L6:; /* "/home/das/src/pyliblo/src/liblo.pyx":372 * raise TypeError("path must be a string or None") * * if isinstance(typespec, (bytes, unicode)): # <<<<<<<<<<<<<< * s2 = _encode(typespec) * t = s2 */ __Pyx_INCREF(__pyx_v_typespec); __pyx_t_1 = __pyx_v_typespec; __pyx_t_4 = PyBytes_Check(__pyx_t_1); if (!__pyx_t_4) { __pyx_t_2 = PyUnicode_Check(__pyx_t_1); __pyx_t_3 = __pyx_t_2; } else { __pyx_t_3 = __pyx_t_4; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* "/home/das/src/pyliblo/src/liblo.pyx":373 * * if isinstance(typespec, (bytes, unicode)): * s2 = _encode(typespec) # <<<<<<<<<<<<<< * t = s2 * elif typespec == None: */ __pyx_t_1 = ((PyObject *)__pyx_f_5liblo__encode(__pyx_v_typespec)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_v_s2)); __pyx_v_s2 = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":374 * if isinstance(typespec, (bytes, unicode)): * s2 = _encode(typespec) * t = s2 # <<<<<<<<<<<<<< * elif typespec == None: * t = NULL */ __pyx_t_5 = PyBytes_AsString(((PyObject *)__pyx_v_s2)); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_t = __pyx_t_5; goto __pyx_L7; } /* "/home/das/src/pyliblo/src/liblo.pyx":375 * s2 = _encode(typespec) * t = s2 * elif typespec == None: # <<<<<<<<<<<<<< * t = NULL * else: */ __pyx_t_1 = PyObject_RichCompare(__pyx_v_typespec, Py_None, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_3) { /* "/home/das/src/pyliblo/src/liblo.pyx":376 * t = s2 * elif typespec == None: * t = NULL # <<<<<<<<<<<<<< * else: * raise TypeError("typespec must be a string or None") */ __pyx_v_t = NULL; goto __pyx_L7; } /*else*/ { /* "/home/das/src/pyliblo/src/liblo.pyx":378 * t = NULL * else: * raise TypeError("typespec must be a string or None") # <<<<<<<<<<<<<< * * # use a weak reference if func is a method, to avoid circular references */ __pyx_t_1 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_8), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L7:; /* "/home/das/src/pyliblo/src/liblo.pyx":383 * # in cases where func is a method an object that also has a reference to * # the server (e.g. when deriving from the Server class) * if _inspect.ismethod(func): # <<<<<<<<<<<<<< * func = _weakref_method(func) * */ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s___inspect); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__ismethod); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __Pyx_INCREF(__pyx_v_func); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_func); __Pyx_GIVEREF(__pyx_v_func); __pyx_t_7 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_3) { /* "/home/das/src/pyliblo/src/liblo.pyx":384 * # the server (e.g. when deriving from the Server class) * if _inspect.ismethod(func): * func = _weakref_method(func) # <<<<<<<<<<<<<< * * cb = struct(func=func, user_data=user_data) */ __pyx_t_7 = __Pyx_GetName(__pyx_m, __pyx_n_s___weakref_method); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __Pyx_INCREF(__pyx_v_func); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_func); __Pyx_GIVEREF(__pyx_v_func); __pyx_t_6 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_v_func); __pyx_v_func = __pyx_t_6; __pyx_t_6 = 0; goto __pyx_L8; } __pyx_L8:; /* "/home/das/src/pyliblo/src/liblo.pyx":386 * func = _weakref_method(func) * * cb = struct(func=func, user_data=user_data) # <<<<<<<<<<<<<< * self._keep_refs.append(cb) * lo_server_add_method(self._server, p, t, _callback, cb) */ __pyx_t_6 = __Pyx_GetName(__pyx_m, __pyx_n_s__struct); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__func), __pyx_v_func) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__user_data), __pyx_v_user_data) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = PyEval_CallObjectWithKeywords(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_v_cb); __pyx_v_cb = __pyx_t_7; __pyx_t_7 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":387 * * cb = struct(func=func, user_data=user_data) * self._keep_refs.append(cb) # <<<<<<<<<<<<<< * lo_server_add_method(self._server, p, t, _callback, cb) * */ if (unlikely(((struct __pyx_obj_5liblo__ServerBase *)__pyx_v_self)->_keep_refs == Py_None)) { PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_8 = PyList_Append(((struct __pyx_obj_5liblo__ServerBase *)__pyx_v_self)->_keep_refs, __pyx_v_cb); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "/home/das/src/pyliblo/src/liblo.pyx":388 * cb = struct(func=func, user_data=user_data) * self._keep_refs.append(cb) * lo_server_add_method(self._server, p, t, _callback, cb) # <<<<<<<<<<<<<< * * def send(self, target, *args): */ lo_server_add_method(((struct __pyx_obj_5liblo__ServerBase *)__pyx_v_self)->_server, __pyx_v_p, __pyx_v_t, __pyx_f_5liblo__callback, ((void *)__pyx_v_cb)); __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("liblo._ServerBase.add_method"); __pyx_r = NULL; __pyx_L0:; __Pyx_DECREF(__pyx_v_s); __Pyx_DECREF(__pyx_v_s2); __Pyx_DECREF(__pyx_v_cb); __Pyx_DECREF(__pyx_v_func); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/das/src/pyliblo/src/liblo.pyx":390 * lo_server_add_method(self._server, p, t, _callback, cb) * * def send(self, target, *args): # <<<<<<<<<<<<<< * """ * send(target, message) */ static PyObject *__pyx_pf_5liblo_11_ServerBase_7send(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_5liblo_11_ServerBase_7send[] = "\n send(target, message)\n send(target, bundle)\n send(target, path[, arg, ...])\n\n Sends a message or bundle from this server to the the given target.\n target may be an Address object, a port number, a (hostname, port)\n tuple, or a URL.\n Exceptions: AddressError, IOError\n "; static PyObject *__pyx_pf_5liblo_11_ServerBase_7send(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_target = 0; PyObject *__pyx_v_args = 0; PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__target,0}; __Pyx_RefNannySetupContext("send"); if (PyTuple_GET_SIZE(__pyx_args) > 1) { __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); __Pyx_GOTREF(__pyx_v_args); if (unlikely(!__pyx_v_args)) return NULL; } else { __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); } if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[1] = {0}; switch (PyTuple_GET_SIZE(__pyx_args)) { default: case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; } switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__target); if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t used_pos_args = (PyTuple_GET_SIZE(__pyx_args) < 1) ? PyTuple_GET_SIZE(__pyx_args) : 1; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "send") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __pyx_v_target = values[0]; } else if (PyTuple_GET_SIZE(__pyx_args) < 1) { goto __pyx_L5_argtuple_error; } else { __pyx_v_target = PyTuple_GET_ITEM(__pyx_args, 0); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("send", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_DECREF(__pyx_v_args); __Pyx_AddTraceback("liblo._ServerBase.send"); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; /* "/home/das/src/pyliblo/src/liblo.pyx":401 * Exceptions: AddressError, IOError * """ * _send(target, self, args) # <<<<<<<<<<<<<< * * property url: */ __pyx_t_1 = __pyx_f_5liblo__send(__pyx_v_target, ((struct __pyx_obj_5liblo__ServerBase *)__pyx_v_self), ((PyObject *)__pyx_v_args)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("liblo._ServerBase.send"); __pyx_r = NULL; __pyx_L0:; __Pyx_DECREF(__pyx_v_args); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/das/src/pyliblo/src/liblo.pyx":407 * The server's URL. * """ * def __get__(self): # <<<<<<<<<<<<<< * return self.get_url() * */ static PyObject *__pyx_pf_5liblo_11_ServerBase_3url_0__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pf_5liblo_11_ServerBase_3url_0__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("__get__"); /* "/home/das/src/pyliblo/src/liblo.pyx":408 * """ * def __get__(self): * return self.get_url() # <<<<<<<<<<<<<< * * property port: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_url); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("liblo._ServerBase.url.__get__"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/das/src/pyliblo/src/liblo.pyx":414 * The server's port number. * """ * def __get__(self): # <<<<<<<<<<<<<< * return self.get_port() * */ static PyObject *__pyx_pf_5liblo_11_ServerBase_4port_0__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pf_5liblo_11_ServerBase_4port_0__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("__get__"); /* "/home/das/src/pyliblo/src/liblo.pyx":415 * """ * def __get__(self): * return self.get_port() # <<<<<<<<<<<<<< * * property protocol: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_port); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("liblo._ServerBase.port.__get__"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/das/src/pyliblo/src/liblo.pyx":421 * The server's protocol (one of the constants UDP, TCP, UNIX). * """ * def __get__(self): # <<<<<<<<<<<<<< * return self.get_protocol() * */ static PyObject *__pyx_pf_5liblo_11_ServerBase_8protocol_0__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pf_5liblo_11_ServerBase_8protocol_0__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("__get__"); /* "/home/das/src/pyliblo/src/liblo.pyx":422 * """ * def __get__(self): * return self.get_protocol() # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_protocol); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("liblo._ServerBase.protocol.__get__"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/das/src/pyliblo/src/liblo.pyx":437 * Exceptions: ServerError * """ * def __init__(self, port=None, proto=LO_DEFAULT, **kwargs): # <<<<<<<<<<<<<< * cdef char *cs * */ static int __pyx_pf_5liblo_6Server_0__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pf_5liblo_6Server_0__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_port = 0; PyObject *__pyx_v_proto = 0; PyObject *__pyx_v_kwargs = 0; char *__pyx_v_cs; PyObject *__pyx_v_p; int __pyx_r; PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; char *__pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__port,&__pyx_n_s__proto,0}; __Pyx_RefNannySetupContext("__init__"); __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; __Pyx_GOTREF(__pyx_v_kwargs); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[2] = {0,0}; values[0] = ((PyObject *)Py_None); values[1] = __pyx_k_9; switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__port); if (value) { values[0] = value; kw_args--; } } case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__proto); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __pyx_v_port = values[0]; __pyx_v_proto = values[1]; } else { __pyx_v_port = ((PyObject *)Py_None); __pyx_v_proto = __pyx_k_9; switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: __pyx_v_proto = PyTuple_GET_ITEM(__pyx_args, 1); case 1: __pyx_v_port = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_DECREF(__pyx_v_kwargs); __Pyx_AddTraceback("liblo.Server.__init__"); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_v_p = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); /* "/home/das/src/pyliblo/src/liblo.pyx":440 * cdef char *cs * * if port != None: # <<<<<<<<<<<<<< * p = _encode(str(port)); * cs = p */ __pyx_t_1 = PyObject_RichCompare(__pyx_v_port, Py_None, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "/home/das/src/pyliblo/src/liblo.pyx":441 * * if port != None: * p = _encode(str(port)); # <<<<<<<<<<<<<< * cs = p * else: */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __Pyx_INCREF(__pyx_v_port); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_port); __Pyx_GIVEREF(__pyx_v_port); __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __pyx_t_1 = ((PyObject *)__pyx_f_5liblo__encode(__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_p)); __pyx_v_p = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":442 * if port != None: * p = _encode(str(port)); * cs = p # <<<<<<<<<<<<<< * else: * cs = NULL */ __pyx_t_4 = PyBytes_AsString(((PyObject *)__pyx_v_p)); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_cs = __pyx_t_4; goto __pyx_L6; } /*else*/ { /* "/home/das/src/pyliblo/src/liblo.pyx":444 * cs = p * else: * cs = NULL # <<<<<<<<<<<<<< * * global __exception */ __pyx_v_cs = NULL; } __pyx_L6:; /* "/home/das/src/pyliblo/src/liblo.pyx":447 * * global __exception * __exception = None # <<<<<<<<<<<<<< * self._server = lo_server_new_with_proto(cs, proto, _err_handler) * if __exception: */ if (PyObject_SetAttr(__pyx_m, __pyx_n_s____exception, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "/home/das/src/pyliblo/src/liblo.pyx":448 * global __exception * __exception = None * self._server = lo_server_new_with_proto(cs, proto, _err_handler) # <<<<<<<<<<<<<< * if __exception: * raise __exception */ __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_v_proto); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ((struct __pyx_obj_5liblo_Server *)__pyx_v_self)->__pyx_base._server = lo_server_new_with_proto(__pyx_v_cs, __pyx_t_5, __pyx_f_5liblo__err_handler); /* "/home/das/src/pyliblo/src/liblo.pyx":449 * __exception = None * self._server = lo_server_new_with_proto(cs, proto, _err_handler) * if __exception: # <<<<<<<<<<<<<< * raise __exception * */ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s____exception); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "/home/das/src/pyliblo/src/liblo.pyx":450 * self._server = lo_server_new_with_proto(cs, proto, _err_handler) * if __exception: * raise __exception # <<<<<<<<<<<<<< * * _ServerBase.__init__(self, **kwargs) */ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s____exception); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L7; } __pyx_L7:; /* "/home/das/src/pyliblo/src/liblo.pyx":452 * raise __exception * * _ServerBase.__init__(self, **kwargs) # <<<<<<<<<<<<<< * * def __dealloc__(self): */ __pyx_t_1 = PyObject_GetAttr(((PyObject *)((PyObject*)__pyx_ptype_5liblo__ServerBase)), __pyx_n_s____init__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); __Pyx_INCREF(__pyx_v_self); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self); __Pyx_GIVEREF(__pyx_v_self); __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_v_kwargs)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("liblo.Server.__init__"); __pyx_r = -1; __pyx_L0:; __Pyx_DECREF(__pyx_v_kwargs); __Pyx_DECREF(__pyx_v_p); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/das/src/pyliblo/src/liblo.pyx":454 * _ServerBase.__init__(self, **kwargs) * * def __dealloc__(self): # <<<<<<<<<<<<<< * self.free() * */ static void __pyx_pf_5liblo_6Server_1__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pf_5liblo_6Server_1__dealloc__(PyObject *__pyx_v_self) { PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("__dealloc__"); /* "/home/das/src/pyliblo/src/liblo.pyx":455 * * def __dealloc__(self): * self.free() # <<<<<<<<<<<<<< * * def free(self): */ __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__free); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("liblo.Server.__dealloc__"); __pyx_L0:; __Pyx_RefNannyFinishContext(); } /* "/home/das/src/pyliblo/src/liblo.pyx":457 * self.free() * * def free(self): # <<<<<<<<<<<<<< * """ * free() */ static PyObject *__pyx_pf_5liblo_6Server_2free(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_5liblo_6Server_2free[] = "\n free()\n\n Frees the underlying server object and closes its port. Note that this\n will also happen automatically when the server is garbage-collected.\n "; static PyObject *__pyx_pf_5liblo_6Server_2free(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = NULL; int __pyx_t_1; __Pyx_RefNannySetupContext("free"); /* "/home/das/src/pyliblo/src/liblo.pyx":464 * will also happen automatically when the server is garbage-collected. * """ * if self._server: # <<<<<<<<<<<<<< * lo_server_free(self._server) * self._server = NULL */ __pyx_t_1 = (((struct __pyx_obj_5liblo_Server *)__pyx_v_self)->__pyx_base._server != 0); if (__pyx_t_1) { /* "/home/das/src/pyliblo/src/liblo.pyx":465 * """ * if self._server: * lo_server_free(self._server) # <<<<<<<<<<<<<< * self._server = NULL * */ lo_server_free(((struct __pyx_obj_5liblo_Server *)__pyx_v_self)->__pyx_base._server); /* "/home/das/src/pyliblo/src/liblo.pyx":466 * if self._server: * lo_server_free(self._server) * self._server = NULL # <<<<<<<<<<<<<< * * def recv(self, timeout=None): */ ((struct __pyx_obj_5liblo_Server *)__pyx_v_self)->__pyx_base._server = NULL; goto __pyx_L5; } __pyx_L5:; __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/das/src/pyliblo/src/liblo.pyx":468 * self._server = NULL * * def recv(self, timeout=None): # <<<<<<<<<<<<<< * """ * recv([timeout]) */ static PyObject *__pyx_pf_5liblo_6Server_3recv(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_5liblo_6Server_3recv[] = "\n recv([timeout])\n\n Receives and dispatches one OSC message. Blocking by default, unless\n timeout (in ms) is specified. timeout may be 0, in which case recv()\n returns immediately. Returns True if a message was received, False\n otherwise.\n "; static PyObject *__pyx_pf_5liblo_6Server_3recv(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_timeout = 0; int __pyx_v_t; int __pyx_v_r; PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; int __pyx_t_2; int __pyx_t_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__timeout,0}; __Pyx_RefNannySetupContext("recv"); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[1] = {0}; values[0] = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__timeout); if (value) { values[0] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "recv") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __pyx_v_timeout = values[0]; } else { __pyx_v_timeout = ((PyObject *)Py_None); switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: __pyx_v_timeout = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("recv", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("liblo.Server.recv"); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; /* "/home/das/src/pyliblo/src/liblo.pyx":478 * """ * cdef int t, r * if timeout != None: # <<<<<<<<<<<<<< * t = timeout * with nogil: */ __pyx_t_1 = PyObject_RichCompare(__pyx_v_timeout, Py_None, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "/home/das/src/pyliblo/src/liblo.pyx":479 * cdef int t, r * if timeout != None: * t = timeout # <<<<<<<<<<<<<< * with nogil: * r = lo_server_recv_noblock(self._server, t) */ __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_v_timeout); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_t = __pyx_t_3; /* "/home/das/src/pyliblo/src/liblo.pyx":480 * if timeout != None: * t = timeout * with nogil: # <<<<<<<<<<<<<< * r = lo_server_recv_noblock(self._server, t) * return r and True or False */ { #ifdef WITH_THREAD PyThreadState *_save; #endif Py_UNBLOCK_THREADS /*try:*/ { /* "/home/das/src/pyliblo/src/liblo.pyx":481 * t = timeout * with nogil: * r = lo_server_recv_noblock(self._server, t) # <<<<<<<<<<<<<< * return r and True or False * else: */ __pyx_v_r = lo_server_recv_noblock(((struct __pyx_obj_5liblo_Server *)__pyx_v_self)->__pyx_base._server, __pyx_v_t); } /* "/home/das/src/pyliblo/src/liblo.pyx":480 * if timeout != None: * t = timeout * with nogil: # <<<<<<<<<<<<<< * r = lo_server_recv_noblock(self._server, t) * return r and True or False */ /*finally:*/ { Py_BLOCK_THREADS } } /* "/home/das/src/pyliblo/src/liblo.pyx":482 * with nogil: * r = lo_server_recv_noblock(self._server, t) * return r and True or False # <<<<<<<<<<<<<< * else: * with nogil: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyInt_FromLong(__pyx_v_r); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_2) { __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __pyx_t_4; __pyx_t_4 = 0; } else { __pyx_t_5 = __pyx_t_1; __pyx_t_1 = 0; } __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (!__pyx_t_2) { __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = __pyx_t_1; __pyx_t_1 = 0; } else { __pyx_t_4 = __pyx_t_5; __pyx_t_5 = 0; } __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; goto __pyx_L6; } /*else*/ { /* "/home/das/src/pyliblo/src/liblo.pyx":484 * return r and True or False * else: * with nogil: # <<<<<<<<<<<<<< * lo_server_recv(self._server) * return True */ { #ifdef WITH_THREAD PyThreadState *_save; #endif Py_UNBLOCK_THREADS /*try:*/ { /* "/home/das/src/pyliblo/src/liblo.pyx":485 * else: * with nogil: * lo_server_recv(self._server) # <<<<<<<<<<<<<< * return True * */ lo_server_recv(((struct __pyx_obj_5liblo_Server *)__pyx_v_self)->__pyx_base._server); } /* "/home/das/src/pyliblo/src/liblo.pyx":484 * return r and True or False * else: * with nogil: # <<<<<<<<<<<<<< * lo_server_recv(self._server) * return True */ /*finally:*/ { Py_BLOCK_THREADS } } /* "/home/das/src/pyliblo/src/liblo.pyx":486 * with nogil: * lo_server_recv(self._server) * return True # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; } __pyx_L6:; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_AddTraceback("liblo.Server.recv"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/das/src/pyliblo/src/liblo.pyx":507 * cdef lo_server_thread _server_thread * * def __init__(self, port=None, proto=LO_DEFAULT, **kwargs): # <<<<<<<<<<<<<< * cdef char *cs * */ static int __pyx_pf_5liblo_12ServerThread_0__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pf_5liblo_12ServerThread_0__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_port = 0; PyObject *__pyx_v_proto = 0; PyObject *__pyx_v_kwargs = 0; char *__pyx_v_cs; PyObject *__pyx_v_p; int __pyx_r; PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; char *__pyx_t_4; int __pyx_t_5; PyObject *__pyx_t_6 = NULL; static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__port,&__pyx_n_s__proto,0}; __Pyx_RefNannySetupContext("__init__"); __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1; __Pyx_GOTREF(__pyx_v_kwargs); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[2] = {0,0}; values[0] = ((PyObject *)Py_None); values[1] = __pyx_k_10; switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__port); if (value) { values[0] = value; kw_args--; } } case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__proto); if (value) { values[1] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __pyx_v_port = values[0]; __pyx_v_proto = values[1]; } else { __pyx_v_port = ((PyObject *)Py_None); __pyx_v_proto = __pyx_k_10; switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: __pyx_v_proto = PyTuple_GET_ITEM(__pyx_args, 1); case 1: __pyx_v_port = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_DECREF(__pyx_v_kwargs); __Pyx_AddTraceback("liblo.ServerThread.__init__"); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_v_p = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); /* "/home/das/src/pyliblo/src/liblo.pyx":510 * cdef char *cs * * if port != None: # <<<<<<<<<<<<<< * p = _encode(str(port)); * cs = p */ __pyx_t_1 = PyObject_RichCompare(__pyx_v_port, Py_None, Py_NE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "/home/das/src/pyliblo/src/liblo.pyx":511 * * if port != None: * p = _encode(str(port)); # <<<<<<<<<<<<<< * cs = p * else: */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __Pyx_INCREF(__pyx_v_port); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_port); __Pyx_GIVEREF(__pyx_v_port); __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __pyx_t_1 = ((PyObject *)__pyx_f_5liblo__encode(__pyx_t_3)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_p)); __pyx_v_p = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":512 * if port != None: * p = _encode(str(port)); * cs = p # <<<<<<<<<<<<<< * else: * cs = NULL */ __pyx_t_4 = PyBytes_AsString(((PyObject *)__pyx_v_p)); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_cs = __pyx_t_4; goto __pyx_L6; } /*else*/ { /* "/home/das/src/pyliblo/src/liblo.pyx":514 * cs = p * else: * cs = NULL # <<<<<<<<<<<<<< * * # make sure python can handle threading */ __pyx_v_cs = NULL; } __pyx_L6:; /* "/home/das/src/pyliblo/src/liblo.pyx":517 * * # make sure python can handle threading * PyEval_InitThreads() # <<<<<<<<<<<<<< * * global __exception */ PyEval_InitThreads(); /* "/home/das/src/pyliblo/src/liblo.pyx":520 * * global __exception * __exception = None # <<<<<<<<<<<<<< * self._server_thread = lo_server_thread_new_with_proto(cs, proto, _err_handler) * if __exception: */ if (PyObject_SetAttr(__pyx_m, __pyx_n_s____exception, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "/home/das/src/pyliblo/src/liblo.pyx":521 * global __exception * __exception = None * self._server_thread = lo_server_thread_new_with_proto(cs, proto, _err_handler) # <<<<<<<<<<<<<< * if __exception: * raise __exception */ __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_v_proto); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ((struct __pyx_obj_5liblo_ServerThread *)__pyx_v_self)->_server_thread = lo_server_thread_new_with_proto(__pyx_v_cs, __pyx_t_5, __pyx_f_5liblo__err_handler); /* "/home/das/src/pyliblo/src/liblo.pyx":522 * __exception = None * self._server_thread = lo_server_thread_new_with_proto(cs, proto, _err_handler) * if __exception: # <<<<<<<<<<<<<< * raise __exception * self._server = lo_server_thread_get_server(self._server_thread) */ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s____exception); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "/home/das/src/pyliblo/src/liblo.pyx":523 * self._server_thread = lo_server_thread_new_with_proto(cs, proto, _err_handler) * if __exception: * raise __exception # <<<<<<<<<<<<<< * self._server = lo_server_thread_get_server(self._server_thread) * */ __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s____exception); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_Raise(__pyx_t_1, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L7; } __pyx_L7:; /* "/home/das/src/pyliblo/src/liblo.pyx":524 * if __exception: * raise __exception * self._server = lo_server_thread_get_server(self._server_thread) # <<<<<<<<<<<<<< * * _ServerBase.__init__(self, **kwargs) */ ((struct __pyx_obj_5liblo_ServerThread *)__pyx_v_self)->__pyx_base._server = lo_server_thread_get_server(((struct __pyx_obj_5liblo_ServerThread *)__pyx_v_self)->_server_thread); /* "/home/das/src/pyliblo/src/liblo.pyx":526 * self._server = lo_server_thread_get_server(self._server_thread) * * _ServerBase.__init__(self, **kwargs) # <<<<<<<<<<<<<< * * def __dealloc__(self): */ __pyx_t_1 = PyObject_GetAttr(((PyObject *)((PyObject*)__pyx_ptype_5liblo__ServerBase)), __pyx_n_s____init__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); __Pyx_INCREF(__pyx_v_self); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self); __Pyx_GIVEREF(__pyx_v_self); __pyx_t_6 = PyEval_CallObjectWithKeywords(__pyx_t_1, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_v_kwargs)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("liblo.ServerThread.__init__"); __pyx_r = -1; __pyx_L0:; __Pyx_DECREF(__pyx_v_kwargs); __Pyx_DECREF(__pyx_v_p); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/das/src/pyliblo/src/liblo.pyx":528 * _ServerBase.__init__(self, **kwargs) * * def __dealloc__(self): # <<<<<<<<<<<<<< * self.free() * */ static void __pyx_pf_5liblo_12ServerThread_1__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pf_5liblo_12ServerThread_1__dealloc__(PyObject *__pyx_v_self) { PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("__dealloc__"); /* "/home/das/src/pyliblo/src/liblo.pyx":529 * * def __dealloc__(self): * self.free() # <<<<<<<<<<<<<< * * def free(self): */ __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__free); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("liblo.ServerThread.__dealloc__"); __pyx_L0:; __Pyx_RefNannyFinishContext(); } /* "/home/das/src/pyliblo/src/liblo.pyx":531 * self.free() * * def free(self): # <<<<<<<<<<<<<< * """ * free() */ static PyObject *__pyx_pf_5liblo_12ServerThread_2free(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_5liblo_12ServerThread_2free[] = "\n free()\n\n Frees the underlying server object and closes its port. Note that this\n will also happen automatically when the server is garbage-collected.\n "; static PyObject *__pyx_pf_5liblo_12ServerThread_2free(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = NULL; int __pyx_t_1; __Pyx_RefNannySetupContext("free"); /* "/home/das/src/pyliblo/src/liblo.pyx":538 * will also happen automatically when the server is garbage-collected. * """ * if self._server_thread: # <<<<<<<<<<<<<< * lo_server_thread_free(self._server_thread) * self._server_thread = NULL */ __pyx_t_1 = (((struct __pyx_obj_5liblo_ServerThread *)__pyx_v_self)->_server_thread != 0); if (__pyx_t_1) { /* "/home/das/src/pyliblo/src/liblo.pyx":539 * """ * if self._server_thread: * lo_server_thread_free(self._server_thread) # <<<<<<<<<<<<<< * self._server_thread = NULL * self._server = NULL */ lo_server_thread_free(((struct __pyx_obj_5liblo_ServerThread *)__pyx_v_self)->_server_thread); /* "/home/das/src/pyliblo/src/liblo.pyx":540 * if self._server_thread: * lo_server_thread_free(self._server_thread) * self._server_thread = NULL # <<<<<<<<<<<<<< * self._server = NULL * */ ((struct __pyx_obj_5liblo_ServerThread *)__pyx_v_self)->_server_thread = NULL; /* "/home/das/src/pyliblo/src/liblo.pyx":541 * lo_server_thread_free(self._server_thread) * self._server_thread = NULL * self._server = NULL # <<<<<<<<<<<<<< * * def start(self): */ ((struct __pyx_obj_5liblo_ServerThread *)__pyx_v_self)->__pyx_base._server = NULL; goto __pyx_L5; } __pyx_L5:; __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/das/src/pyliblo/src/liblo.pyx":543 * self._server = NULL * * def start(self): # <<<<<<<<<<<<<< * """ * start() */ static PyObject *__pyx_pf_5liblo_12ServerThread_3start(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_5liblo_12ServerThread_3start[] = "\n start()\n\n Starts the server thread, liblo will now start to dispatch any messages\n it receives.\n "; static PyObject *__pyx_pf_5liblo_12ServerThread_3start(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = NULL; __Pyx_RefNannySetupContext("start"); /* "/home/das/src/pyliblo/src/liblo.pyx":550 * it receives. * """ * lo_server_thread_start(self._server_thread) # <<<<<<<<<<<<<< * * def stop(self): */ lo_server_thread_start(((struct __pyx_obj_5liblo_ServerThread *)__pyx_v_self)->_server_thread); __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/das/src/pyliblo/src/liblo.pyx":552 * lo_server_thread_start(self._server_thread) * * def stop(self): # <<<<<<<<<<<<<< * """ * stop() */ static PyObject *__pyx_pf_5liblo_12ServerThread_4stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static char __pyx_doc_5liblo_12ServerThread_4stop[] = "\n stop()\n\n Stops the server thread.\n "; static PyObject *__pyx_pf_5liblo_12ServerThread_4stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = NULL; __Pyx_RefNannySetupContext("stop"); /* "/home/das/src/pyliblo/src/liblo.pyx":558 * Stops the server thread. * """ * lo_server_thread_stop(self._server_thread) # <<<<<<<<<<<<<< * * */ lo_server_thread_stop(((struct __pyx_obj_5liblo_ServerThread *)__pyx_v_self)->_server_thread); __pyx_r = Py_None; __Pyx_INCREF(Py_None); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/das/src/pyliblo/src/liblo.pyx":569 * Exception raised when trying to create an invalid Address object. * """ * def __init__(self, msg): # <<<<<<<<<<<<<< * self.msg = msg * def __str__(self): */ static PyObject *__pyx_pf_5liblo_12AddressError_0__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyMethodDef __pyx_mdef_5liblo_12AddressError_0__init__ = {__Pyx_NAMESTR("__init__"), (PyCFunction)__pyx_pf_5liblo_12AddressError_0__init__, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; static PyObject *__pyx_pf_5liblo_12AddressError_0__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_msg = 0; PyObject *__pyx_r = NULL; static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__self,&__pyx_n_s__msg,0}; __Pyx_RefNannySetupContext("__init__"); __pyx_self = __pyx_self; if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[2] = {0,0}; switch (PyTuple_GET_SIZE(__pyx_args)) { case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__self); if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; case 1: values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__msg); if (likely(values[1])) kw_args--; else { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __pyx_v_self = values[0]; __pyx_v_msg = values[1]; } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; } else { __pyx_v_self = PyTuple_GET_ITEM(__pyx_args, 0); __pyx_v_msg = PyTuple_GET_ITEM(__pyx_args, 1); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("liblo.AddressError.__init__"); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; /* "/home/das/src/pyliblo/src/liblo.pyx":570 * """ * def __init__(self, msg): * self.msg = msg # <<<<<<<<<<<<<< * def __str__(self): * return "address error: %s" % self.msg */ if (PyObject_SetAttr(__pyx_v_self, __pyx_n_s__msg, __pyx_v_msg) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_AddTraceback("liblo.AddressError.__init__"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/das/src/pyliblo/src/liblo.pyx":571 * def __init__(self, msg): * self.msg = msg * def __str__(self): # <<<<<<<<<<<<<< * return "address error: %s" % self.msg * */ static PyObject *__pyx_pf_5liblo_12AddressError_1__str__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/ static PyMethodDef __pyx_mdef_5liblo_12AddressError_1__str__ = {__Pyx_NAMESTR("__str__"), (PyCFunction)__pyx_pf_5liblo_12AddressError_1__str__, METH_O, __Pyx_DOCSTR(0)}; static PyObject *__pyx_pf_5liblo_12AddressError_1__str__(PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("__str__"); __pyx_self = __pyx_self; /* "/home/das/src/pyliblo/src/liblo.pyx":572 * self.msg = msg * def __str__(self): * return "address error: %s" % self.msg # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__msg); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_11), __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = ((PyObject *)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("liblo.AddressError.__str__"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/das/src/pyliblo/src/liblo.pyx":587 * cdef lo_address _address * * def __init__(self, addr, addr2=None, proto=LO_UDP): # <<<<<<<<<<<<<< * if addr2: * # Address(host, port[, proto]) */ static int __pyx_pf_5liblo_7Address_0__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pf_5liblo_7Address_0__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_addr = 0; PyObject *__pyx_v_addr2 = 0; PyObject *__pyx_v_proto = 0; PyObject *__pyx_v_s; PyObject *__pyx_v_s2; int __pyx_r; int __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; char *__pyx_t_5; char *__pyx_t_6; int __pyx_t_7; int __pyx_t_8; int __pyx_t_9; PyObject *__pyx_t_10 = NULL; static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__addr,&__pyx_n_s__addr2,&__pyx_n_s__proto,0}; __Pyx_RefNannySetupContext("__init__"); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[3] = {0,0,0}; values[1] = ((PyObject *)Py_None); values[2] = __pyx_k_12; switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__addr); if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; case 1: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__addr2); if (value) { values[1] = value; kw_args--; } } case 2: if (kw_args > 0) { PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__proto); if (value) { values[2] = value; kw_args--; } } } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __pyx_v_addr = values[0]; __pyx_v_addr2 = values[1]; __pyx_v_proto = values[2]; } else { __pyx_v_addr2 = ((PyObject *)Py_None); __pyx_v_proto = __pyx_k_12; switch (PyTuple_GET_SIZE(__pyx_args)) { case 3: __pyx_v_proto = PyTuple_GET_ITEM(__pyx_args, 2); case 2: __pyx_v_addr2 = PyTuple_GET_ITEM(__pyx_args, 1); case 1: __pyx_v_addr = PyTuple_GET_ITEM(__pyx_args, 0); break; default: goto __pyx_L5_argtuple_error; } } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("liblo.Address.__init__"); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; __pyx_v_s = Py_None; __Pyx_INCREF(Py_None); __pyx_v_s2 = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); /* "/home/das/src/pyliblo/src/liblo.pyx":588 * * def __init__(self, addr, addr2=None, proto=LO_UDP): * if addr2: # <<<<<<<<<<<<<< * # Address(host, port[, proto]) * s = _encode(addr) */ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_addr2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_t_1) { /* "/home/das/src/pyliblo/src/liblo.pyx":590 * if addr2: * # Address(host, port[, proto]) * s = _encode(addr) # <<<<<<<<<<<<<< * s2 = _encode(str(addr2)) * self._address = lo_address_new_with_proto(proto, s, s2) */ __pyx_t_2 = ((PyObject *)__pyx_f_5liblo__encode(__pyx_v_addr)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_v_s); __pyx_v_s = __pyx_t_2; __pyx_t_2 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":591 * # Address(host, port[, proto]) * s = _encode(addr) * s2 = _encode(str(addr2)) # <<<<<<<<<<<<<< * self._address = lo_address_new_with_proto(proto, s, s2) * if not self._address: */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __Pyx_INCREF(__pyx_v_addr2); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_addr2); __Pyx_GIVEREF(__pyx_v_addr2); __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __pyx_t_2 = ((PyObject *)__pyx_f_5liblo__encode(__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_s2)); __pyx_v_s2 = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":592 * s = _encode(addr) * s2 = _encode(str(addr2)) * self._address = lo_address_new_with_proto(proto, s, s2) # <<<<<<<<<<<<<< * if not self._address: * raise AddressError("invalid protocol") */ __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_v_proto); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = PyBytes_AsString(__pyx_v_s); if (unlikely((!__pyx_t_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = PyBytes_AsString(((PyObject *)__pyx_v_s2)); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ((struct __pyx_obj_5liblo_Address *)__pyx_v_self)->_address = lo_address_new_with_proto(__pyx_t_4, __pyx_t_5, __pyx_t_6); /* "/home/das/src/pyliblo/src/liblo.pyx":593 * s2 = _encode(str(addr2)) * self._address = lo_address_new_with_proto(proto, s, s2) * if not self._address: # <<<<<<<<<<<<<< * raise AddressError("invalid protocol") * elif isinstance(addr, int) or (isinstance(addr, str) and addr.isdigit()): */ __pyx_t_1 = (!(((struct __pyx_obj_5liblo_Address *)__pyx_v_self)->_address != 0)); if (__pyx_t_1) { /* "/home/das/src/pyliblo/src/liblo.pyx":594 * self._address = lo_address_new_with_proto(proto, s, s2) * if not self._address: * raise AddressError("invalid protocol") # <<<<<<<<<<<<<< * elif isinstance(addr, int) or (isinstance(addr, str) and addr.isdigit()): * # Address(port) */ __pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__AddressError); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_14), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L7; } __pyx_L7:; goto __pyx_L6; } /* "/home/das/src/pyliblo/src/liblo.pyx":595 * if not self._address: * raise AddressError("invalid protocol") * elif isinstance(addr, int) or (isinstance(addr, str) and addr.isdigit()): # <<<<<<<<<<<<<< * # Address(port) * s = str(addr).encode() */ __pyx_t_1 = PyInt_Check(__pyx_v_addr); if (!__pyx_t_1) { __pyx_t_7 = PyString_Check(__pyx_v_addr); if (__pyx_t_7) { __pyx_t_3 = PyObject_GetAttr(__pyx_v_addr, __pyx_n_s__isdigit); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_9 = __pyx_t_8; } else { __pyx_t_9 = __pyx_t_7; } __pyx_t_7 = __pyx_t_9; } else { __pyx_t_7 = __pyx_t_1; } if (__pyx_t_7) { /* "/home/das/src/pyliblo/src/liblo.pyx":597 * elif isinstance(addr, int) or (isinstance(addr, str) and addr.isdigit()): * # Address(port) * s = str(addr).encode() # <<<<<<<<<<<<<< * self._address = lo_address_new(NULL, s) * else: */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __Pyx_INCREF(__pyx_v_addr); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_addr); __Pyx_GIVEREF(__pyx_v_addr); __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __pyx_t_2 = PyObject_GetAttr(__pyx_t_3, __pyx_n_s__encode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_v_s); __pyx_v_s = __pyx_t_3; __pyx_t_3 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":598 * # Address(port) * s = str(addr).encode() * self._address = lo_address_new(NULL, s) # <<<<<<<<<<<<<< * else: * # Address(url) */ __pyx_t_6 = PyBytes_AsString(__pyx_v_s); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ((struct __pyx_obj_5liblo_Address *)__pyx_v_self)->_address = lo_address_new(NULL, __pyx_t_6); goto __pyx_L6; } /*else*/ { /* "/home/das/src/pyliblo/src/liblo.pyx":601 * else: * # Address(url) * s = _encode(addr) # <<<<<<<<<<<<<< * self._address = lo_address_new_from_url(s) * # lo_address_errno() is of no use if self._addr == NULL */ __pyx_t_3 = ((PyObject *)__pyx_f_5liblo__encode(__pyx_v_addr)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_v_s); __pyx_v_s = __pyx_t_3; __pyx_t_3 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":602 * # Address(url) * s = _encode(addr) * self._address = lo_address_new_from_url(s) # <<<<<<<<<<<<<< * # lo_address_errno() is of no use if self._addr == NULL * if not self._address: */ __pyx_t_6 = PyBytes_AsString(__pyx_v_s); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ((struct __pyx_obj_5liblo_Address *)__pyx_v_self)->_address = lo_address_new_from_url(__pyx_t_6); /* "/home/das/src/pyliblo/src/liblo.pyx":604 * self._address = lo_address_new_from_url(s) * # lo_address_errno() is of no use if self._addr == NULL * if not self._address: # <<<<<<<<<<<<<< * raise AddressError("invalid URL '%s'" % str(addr)) * */ __pyx_t_7 = (!(((struct __pyx_obj_5liblo_Address *)__pyx_v_self)->_address != 0)); if (__pyx_t_7) { /* "/home/das/src/pyliblo/src/liblo.pyx":605 * # lo_address_errno() is of no use if self._addr == NULL * if not self._address: * raise AddressError("invalid URL '%s'" % str(addr)) # <<<<<<<<<<<<<< * * def __dealloc__(self): */ __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__AddressError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __Pyx_INCREF(__pyx_v_addr); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_addr); __Pyx_GIVEREF(__pyx_v_addr); __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_15), __pyx_t_10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_10)); PyTuple_SET_ITEM(__pyx_t_10, 0, ((PyObject *)__pyx_t_2)); __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0; __Pyx_Raise(__pyx_t_2, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L8; } __pyx_L8:; } __pyx_L6:; __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("liblo.Address.__init__"); __pyx_r = -1; __pyx_L0:; __Pyx_DECREF(__pyx_v_s); __Pyx_DECREF(__pyx_v_s2); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/das/src/pyliblo/src/liblo.pyx":607 * raise AddressError("invalid URL '%s'" % str(addr)) * * def __dealloc__(self): # <<<<<<<<<<<<<< * lo_address_free(self._address) * */ static void __pyx_pf_5liblo_7Address_1__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pf_5liblo_7Address_1__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannySetupContext("__dealloc__"); /* "/home/das/src/pyliblo/src/liblo.pyx":608 * * def __dealloc__(self): * lo_address_free(self._address) # <<<<<<<<<<<<<< * * def get_url(self): */ lo_address_free(((struct __pyx_obj_5liblo_Address *)__pyx_v_self)->_address); __Pyx_RefNannyFinishContext(); } /* "/home/das/src/pyliblo/src/liblo.pyx":610 * lo_address_free(self._address) * * def get_url(self): # <<<<<<<<<<<<<< * cdef char *tmp = lo_address_get_url(self._address) * cdef object r = tmp */ static PyObject *__pyx_pf_5liblo_7Address_2get_url(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pf_5liblo_7Address_2get_url(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { char *__pyx_v_tmp; PyObject *__pyx_v_r = 0; PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("get_url"); /* "/home/das/src/pyliblo/src/liblo.pyx":611 * * def get_url(self): * cdef char *tmp = lo_address_get_url(self._address) # <<<<<<<<<<<<<< * cdef object r = tmp * free(tmp) */ __pyx_v_tmp = lo_address_get_url(((struct __pyx_obj_5liblo_Address *)__pyx_v_self)->_address); /* "/home/das/src/pyliblo/src/liblo.pyx":612 * def get_url(self): * cdef char *tmp = lo_address_get_url(self._address) * cdef object r = tmp # <<<<<<<<<<<<<< * free(tmp) * return _decode(r) */ __pyx_t_1 = PyBytes_FromString(__pyx_v_tmp); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __pyx_v_r = ((PyObject *)__pyx_t_1); __pyx_t_1 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":613 * cdef char *tmp = lo_address_get_url(self._address) * cdef object r = tmp * free(tmp) # <<<<<<<<<<<<<< * return _decode(r) * */ free(__pyx_v_tmp); /* "/home/das/src/pyliblo/src/liblo.pyx":614 * cdef object r = tmp * free(tmp) * return _decode(r) # <<<<<<<<<<<<<< * * def get_hostname(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_5liblo__decode(__pyx_v_r)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("liblo.Address.get_url"); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_r); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/das/src/pyliblo/src/liblo.pyx":616 * return _decode(r) * * def get_hostname(self): # <<<<<<<<<<<<<< * return _decode(lo_address_get_hostname(self._address)) * */ static PyObject *__pyx_pf_5liblo_7Address_3get_hostname(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pf_5liblo_7Address_3get_hostname(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("get_hostname"); /* "/home/das/src/pyliblo/src/liblo.pyx":617 * * def get_hostname(self): * return _decode(lo_address_get_hostname(self._address)) # <<<<<<<<<<<<<< * * def get_port(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyBytes_FromString(lo_address_get_hostname(((struct __pyx_obj_5liblo_Address *)__pyx_v_self)->_address)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __pyx_t_2 = ((PyObject *)__pyx_f_5liblo__decode(((PyObject *)__pyx_t_1))); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("liblo.Address.get_hostname"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/das/src/pyliblo/src/liblo.pyx":619 * return _decode(lo_address_get_hostname(self._address)) * * def get_port(self): # <<<<<<<<<<<<<< * cdef bytes s = lo_address_get_port(self._address) * if s.isdigit(): */ static PyObject *__pyx_pf_5liblo_7Address_4get_port(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pf_5liblo_7Address_4get_port(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_v_s = 0; PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; int __pyx_t_3; __Pyx_RefNannySetupContext("get_port"); /* "/home/das/src/pyliblo/src/liblo.pyx":620 * * def get_port(self): * cdef bytes s = lo_address_get_port(self._address) # <<<<<<<<<<<<<< * if s.isdigit(): * return int(s) */ __pyx_t_1 = PyBytes_FromString(lo_address_get_port(((struct __pyx_obj_5liblo_Address *)__pyx_v_self)->_address)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __pyx_v_s = __pyx_t_1; __pyx_t_1 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":621 * def get_port(self): * cdef bytes s = lo_address_get_port(self._address) * if s.isdigit(): # <<<<<<<<<<<<<< * return int(s) * else: */ __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_s), __pyx_n_s__isdigit); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_3) { /* "/home/das/src/pyliblo/src/liblo.pyx":622 * cdef bytes s = lo_address_get_port(self._address) * if s.isdigit(): * return int(s) # <<<<<<<<<<<<<< * else: * return _decode(s) */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __Pyx_INCREF(((PyObject *)__pyx_v_s)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_s)); __Pyx_GIVEREF(((PyObject *)__pyx_v_s)); __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; goto __pyx_L5; } /*else*/ { /* "/home/das/src/pyliblo/src/liblo.pyx":624 * return int(s) * else: * return _decode(s) # <<<<<<<<<<<<<< * * def get_protocol(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = ((PyObject *)__pyx_f_5liblo__decode(((PyObject *)__pyx_v_s))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; } __pyx_L5:; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("liblo.Address.get_port"); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_s); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/das/src/pyliblo/src/liblo.pyx":626 * return _decode(s) * * def get_protocol(self): # <<<<<<<<<<<<<< * return lo_address_get_protocol(self._address) * */ static PyObject *__pyx_pf_5liblo_7Address_5get_protocol(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/ static PyObject *__pyx_pf_5liblo_7Address_5get_protocol(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) { PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; __Pyx_RefNannySetupContext("get_protocol"); /* "/home/das/src/pyliblo/src/liblo.pyx":627 * * def get_protocol(self): * return lo_address_get_protocol(self._address) # <<<<<<<<<<<<<< * * property url: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyInt_FromLong(lo_address_get_protocol(((struct __pyx_obj_5liblo_Address *)__pyx_v_self)->_address)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_AddTraceback("liblo.Address.get_protocol"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/das/src/pyliblo/src/liblo.pyx":633 * The address' URL. * """ * def __get__(self): # <<<<<<<<<<<<<< * return self.get_url() * */ static PyObject *__pyx_pf_5liblo_7Address_3url_0__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pf_5liblo_7Address_3url_0__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("__get__"); /* "/home/das/src/pyliblo/src/liblo.pyx":634 * """ * def __get__(self): * return self.get_url() # <<<<<<<<<<<<<< * * property hostname: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_url); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 634; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("liblo.Address.url.__get__"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/das/src/pyliblo/src/liblo.pyx":640 * The address' hostname. * """ * def __get__(self): # <<<<<<<<<<<<<< * return self.get_hostname() * */ static PyObject *__pyx_pf_5liblo_7Address_8hostname_0__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pf_5liblo_7Address_8hostname_0__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("__get__"); /* "/home/das/src/pyliblo/src/liblo.pyx":641 * """ * def __get__(self): * return self.get_hostname() # <<<<<<<<<<<<<< * * property port: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_hostname); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("liblo.Address.hostname.__get__"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/das/src/pyliblo/src/liblo.pyx":647 * The address' port number. * """ * def __get__(self): # <<<<<<<<<<<<<< * return self.get_port() * */ static PyObject *__pyx_pf_5liblo_7Address_4port_0__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pf_5liblo_7Address_4port_0__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("__get__"); /* "/home/das/src/pyliblo/src/liblo.pyx":648 * """ * def __get__(self): * return self.get_port() # <<<<<<<<<<<<<< * * property protocol: */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_port); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("liblo.Address.port.__get__"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/das/src/pyliblo/src/liblo.pyx":654 * The address' protocol (one of the constants UDP, TCP, UNIX). * """ * def __get__(self): # <<<<<<<<<<<<<< * return self.get_protocol() * */ static PyObject *__pyx_pf_5liblo_7Address_8protocol_0__get__(PyObject *__pyx_v_self); /*proto*/ static PyObject *__pyx_pf_5liblo_7Address_8protocol_0__get__(PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; __Pyx_RefNannySetupContext("__get__"); /* "/home/das/src/pyliblo/src/liblo.pyx":655 * """ * def __get__(self): * return self.get_protocol() # <<<<<<<<<<<<<< * * */ __Pyx_XDECREF(__pyx_r); __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__get_protocol); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("liblo.Address.protocol.__get__"); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/das/src/pyliblo/src/liblo.pyx":665 * cdef lo_blob _blob * * def __init__(self, arr): # <<<<<<<<<<<<<< * # arr can by any sequence type * cdef unsigned char *p */ static int __pyx_pf_5liblo_5_Blob_0__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pf_5liblo_5_Blob_0__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_arr = 0; unsigned char *__pyx_v_p; uint32_t __pyx_v_size; uint32_t __pyx_v_i; int __pyx_r; Py_ssize_t __pyx_t_1; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; int __pyx_t_5; uint32_t __pyx_t_6; PyObject *__pyx_t_7 = NULL; unsigned char __pyx_t_8; static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__arr,0}; __Pyx_RefNannySetupContext("__init__"); if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[1] = {0}; switch (PyTuple_GET_SIZE(__pyx_args)) { case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; default: goto __pyx_L5_argtuple_error; } switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__arr); if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __pyx_v_arr = values[0]; } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { goto __pyx_L5_argtuple_error; } else { __pyx_v_arr = PyTuple_GET_ITEM(__pyx_args, 0); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_AddTraceback("liblo._Blob.__init__"); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; /* "/home/das/src/pyliblo/src/liblo.pyx":669 * cdef unsigned char *p * cdef uint32_t size, i * size = len(arr) # <<<<<<<<<<<<<< * if size < 1: * raise ValueError("blob is empty") */ __pyx_t_1 = PyObject_Length(__pyx_v_arr); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_size = __pyx_t_1; /* "/home/das/src/pyliblo/src/liblo.pyx":670 * cdef uint32_t size, i * size = len(arr) * if size < 1: # <<<<<<<<<<<<<< * raise ValueError("blob is empty") * # copy each element of arr to a C array */ __pyx_t_2 = (__pyx_v_size < 1); if (__pyx_t_2) { /* "/home/das/src/pyliblo/src/liblo.pyx":671 * size = len(arr) * if size < 1: * raise ValueError("blob is empty") # <<<<<<<<<<<<<< * # copy each element of arr to a C array * p = malloc(size) */ __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_17), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_Raise(__pyx_t_3, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} goto __pyx_L6; } __pyx_L6:; /* "/home/das/src/pyliblo/src/liblo.pyx":673 * raise ValueError("blob is empty") * # copy each element of arr to a C array * p = malloc(size) # <<<<<<<<<<<<<< * try: * if isinstance(arr[0], (str, unicode)): */ __pyx_v_p = ((unsigned char *)malloc(__pyx_v_size)); /* "/home/das/src/pyliblo/src/liblo.pyx":674 * # copy each element of arr to a C array * p = malloc(size) * try: # <<<<<<<<<<<<<< * if isinstance(arr[0], (str, unicode)): * # use ord() if arr is a string (but not bytes) */ /*try:*/ { /* "/home/das/src/pyliblo/src/liblo.pyx":675 * p = malloc(size) * try: * if isinstance(arr[0], (str, unicode)): # <<<<<<<<<<<<<< * # use ord() if arr is a string (but not bytes) * for i from 0 <= i < size: */ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_arr, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; __pyx_clineno = __LINE__; goto __pyx_L8;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = PyString_Check(__pyx_t_3); if (!__pyx_t_2) { __pyx_t_4 = PyUnicode_Check(__pyx_t_3); __pyx_t_5 = __pyx_t_4; } else { __pyx_t_5 = __pyx_t_2; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_5) { /* "/home/das/src/pyliblo/src/liblo.pyx":677 * if isinstance(arr[0], (str, unicode)): * # use ord() if arr is a string (but not bytes) * for i from 0 <= i < size: # <<<<<<<<<<<<<< * p[i] = ord(arr[i]) * else: */ __pyx_t_6 = __pyx_v_size; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) { /* "/home/das/src/pyliblo/src/liblo.pyx":678 * # use ord() if arr is a string (but not bytes) * for i from 0 <= i < size: * p[i] = ord(arr[i]) # <<<<<<<<<<<<<< * else: * for i from 0 <= i < size: */ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_arr, __pyx_v_i, sizeof(uint32_t)+1, PyLong_FromUnsignedLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L8;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L8;} __Pyx_GOTREF(((PyObject *)__pyx_t_7)); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyObject_Call(__pyx_builtin_ord, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L8;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0; __pyx_t_8 = __Pyx_PyInt_AsUnsignedChar(__pyx_t_3); if (unlikely((__pyx_t_8 == (unsigned char)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L8;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; (__pyx_v_p[__pyx_v_i]) = __pyx_t_8; } goto __pyx_L10; } /*else*/ { /* "/home/das/src/pyliblo/src/liblo.pyx":680 * p[i] = ord(arr[i]) * else: * for i from 0 <= i < size: # <<<<<<<<<<<<<< * p[i] = arr[i] * # build blob */ __pyx_t_6 = __pyx_v_size; for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) { /* "/home/das/src/pyliblo/src/liblo.pyx":681 * else: * for i from 0 <= i < size: * p[i] = arr[i] # <<<<<<<<<<<<<< * # build blob * self._blob = lo_blob_new(size, p) */ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_arr, __pyx_v_i, sizeof(uint32_t)+1, PyLong_FromUnsignedLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L8;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = __Pyx_PyInt_AsUnsignedChar(__pyx_t_3); if (unlikely((__pyx_t_8 == (unsigned char)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L8;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; (__pyx_v_p[__pyx_v_i]) = __pyx_t_8; } } __pyx_L10:; /* "/home/das/src/pyliblo/src/liblo.pyx":683 * p[i] = arr[i] * # build blob * self._blob = lo_blob_new(size, p) # <<<<<<<<<<<<<< * finally: * free(p) */ ((struct __pyx_obj_5liblo__Blob *)__pyx_v_self)->_blob = lo_blob_new(__pyx_v_size, __pyx_v_p); } /* "/home/das/src/pyliblo/src/liblo.pyx":685 * self._blob = lo_blob_new(size, p) * finally: * free(p) # <<<<<<<<<<<<<< * * def __dealloc__(self): */ /*finally:*/ { int __pyx_why; PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb; int __pyx_exc_lineno; __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0; __pyx_why = 0; goto __pyx_L9; __pyx_L8: { __pyx_why = 4; __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb); __pyx_exc_lineno = __pyx_lineno; goto __pyx_L9; } __pyx_L9:; free(__pyx_v_p); switch (__pyx_why) { case 4: { __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb); __pyx_lineno = __pyx_exc_lineno; __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; goto __pyx_L1_error; } } } __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_7); __Pyx_AddTraceback("liblo._Blob.__init__"); __pyx_r = -1; __pyx_L0:; __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/das/src/pyliblo/src/liblo.pyx":687 * free(p) * * def __dealloc__(self): # <<<<<<<<<<<<<< * lo_blob_free(self._blob) * */ static void __pyx_pf_5liblo_5_Blob_1__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pf_5liblo_5_Blob_1__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannySetupContext("__dealloc__"); /* "/home/das/src/pyliblo/src/liblo.pyx":688 * * def __dealloc__(self): * lo_blob_free(self._blob) # <<<<<<<<<<<<<< * * */ lo_blob_free(((struct __pyx_obj_5liblo__Blob *)__pyx_v_self)->_blob); __Pyx_RefNannyFinishContext(); } /* "/home/das/src/pyliblo/src/liblo.pyx":701 * cdef list _keep_refs * * def __init__(self, path, *args): # <<<<<<<<<<<<<< * self._keep_refs = [] * # encode path to bytestring if necessary */ static int __pyx_pf_5liblo_7Message_0__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pf_5liblo_7Message_0__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_path = 0; PyObject *__pyx_v_args = 0; int __pyx_r; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__path,0}; __Pyx_RefNannySetupContext("__init__"); if (PyTuple_GET_SIZE(__pyx_args) > 1) { __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args)); __Pyx_GOTREF(__pyx_v_args); if (unlikely(!__pyx_v_args)) return -1; } else { __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple); } if (unlikely(__pyx_kwds)) { Py_ssize_t kw_args = PyDict_Size(__pyx_kwds); PyObject* values[1] = {0}; switch (PyTuple_GET_SIZE(__pyx_args)) { default: case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); case 0: break; } switch (PyTuple_GET_SIZE(__pyx_args)) { case 0: values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__path); if (likely(values[0])) kw_args--; else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t used_pos_args = (PyTuple_GET_SIZE(__pyx_args) < 1) ? PyTuple_GET_SIZE(__pyx_args) : 1; if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L3_error;} } __pyx_v_path = values[0]; } else if (PyTuple_GET_SIZE(__pyx_args) < 1) { goto __pyx_L5_argtuple_error; } else { __pyx_v_path = PyTuple_GET_ITEM(__pyx_args, 0); } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L3_error;} __pyx_L3_error:; __Pyx_DECREF(__pyx_v_args); __Pyx_AddTraceback("liblo.Message.__init__"); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; /* "/home/das/src/pyliblo/src/liblo.pyx":702 * * def __init__(self, path, *args): * self._keep_refs = [] # <<<<<<<<<<<<<< * # encode path to bytestring if necessary * self._path = _encode(path) */ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); __Pyx_GOTREF(((struct __pyx_obj_5liblo_Message *)__pyx_v_self)->_keep_refs); __Pyx_DECREF(((PyObject *)((struct __pyx_obj_5liblo_Message *)__pyx_v_self)->_keep_refs)); ((struct __pyx_obj_5liblo_Message *)__pyx_v_self)->_keep_refs = __pyx_t_1; __pyx_t_1 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":704 * self._keep_refs = [] * # encode path to bytestring if necessary * self._path = _encode(path) # <<<<<<<<<<<<<< * self._message = lo_message_new() * */ __pyx_t_1 = ((PyObject *)__pyx_f_5liblo__encode(__pyx_v_path)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); __Pyx_GOTREF(((struct __pyx_obj_5liblo_Message *)__pyx_v_self)->_path); __Pyx_DECREF(((PyObject *)((struct __pyx_obj_5liblo_Message *)__pyx_v_self)->_path)); ((struct __pyx_obj_5liblo_Message *)__pyx_v_self)->_path = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":705 * # encode path to bytestring if necessary * self._path = _encode(path) * self._message = lo_message_new() # <<<<<<<<<<<<<< * * self.add(*args) */ ((struct __pyx_obj_5liblo_Message *)__pyx_v_self)->_message = lo_message_new(); /* "/home/das/src/pyliblo/src/liblo.pyx":707 * self._message = lo_message_new() * * self.add(*args) # <<<<<<<<<<<<<< * * def __dealloc__(self): */ __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__add); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PySequence_Tuple(((PyObject *)__pyx_v_args)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("liblo.Message.__init__"); __pyx_r = -1; __pyx_L0:; __Pyx_DECREF(__pyx_v_args); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/das/src/pyliblo/src/liblo.pyx":709 * self.add(*args) * * def __dealloc__(self): # <<<<<<<<<<<<<< * lo_message_free(self._message) * */ static void __pyx_pf_5liblo_7Message_1__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pf_5liblo_7Message_1__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannySetupContext("__dealloc__"); /* "/home/das/src/pyliblo/src/liblo.pyx":710 * * def __dealloc__(self): * lo_message_free(self._message) # <<<<<<<<<<<<<< * * def add(self, *args): */ lo_message_free(((struct __pyx_obj_5liblo_Message *)__pyx_v_self)->_message); __Pyx_RefNannyFinishContext(); } /* "/home/das/src/pyliblo/src/liblo.pyx":712 * lo_message_free(self._message) * * def add(self, *args): # <<<<<<<<<<<<<< * """ * add(arg[, ...]) */ static PyObject *__pyx_pf_5liblo_7Message_2add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_5liblo_7Message_2add[] = "\n add(arg[, ...])\n\n Appends the given argument(s) to the message.\n "; static PyObject *__pyx_pf_5liblo_7Message_2add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_arg; PyObject *__pyx_r = NULL; Py_ssize_t __pyx_t_1; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; int __pyx_t_4; Py_ssize_t __pyx_t_5; int __pyx_t_6; int __pyx_t_7; int __pyx_t_8; int __pyx_t_9; PyObject *__pyx_t_10 = NULL; PyObject *__pyx_t_11 = NULL; __Pyx_RefNannySetupContext("add"); if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "add", 0))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_v_arg = Py_None; __Pyx_INCREF(Py_None); /* "/home/das/src/pyliblo/src/liblo.pyx":718 * Appends the given argument(s) to the message. * """ * for arg in args: # <<<<<<<<<<<<<< * if (isinstance(arg, tuple) and len(arg) <= 2 and * isinstance(arg[0], (bytes, unicode)) and len(arg[0]) == 1): */ if (unlikely(__pyx_v_args == Py_None)) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_1 = 0; __pyx_t_2 = ((PyObject *)__pyx_v_args); __Pyx_INCREF(__pyx_t_2); for (;;) { if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_2)) break; __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; __Pyx_DECREF(__pyx_v_arg); __pyx_v_arg = __pyx_t_3; __pyx_t_3 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":719 * """ * for arg in args: * if (isinstance(arg, tuple) and len(arg) <= 2 and # <<<<<<<<<<<<<< * isinstance(arg[0], (bytes, unicode)) and len(arg[0]) == 1): * # type explicitly specified */ __pyx_t_4 = PyTuple_Check(__pyx_v_arg); if (__pyx_t_4) { __pyx_t_5 = PyObject_Length(__pyx_v_arg); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = (__pyx_t_5 <= 2); if (__pyx_t_6) { /* "/home/das/src/pyliblo/src/liblo.pyx":720 * for arg in args: * if (isinstance(arg, tuple) and len(arg) <= 2 and * isinstance(arg[0], (bytes, unicode)) and len(arg[0]) == 1): # <<<<<<<<<<<<<< * # type explicitly specified * if len(arg) == 2: */ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_arg, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = PyBytes_Check(__pyx_t_3); if (!__pyx_t_7) { __pyx_t_8 = PyUnicode_Check(__pyx_t_3); __pyx_t_9 = __pyx_t_8; } else { __pyx_t_9 = __pyx_t_7; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_9) { __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_arg, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_7 = (__pyx_t_5 == 1); __pyx_t_8 = __pyx_t_7; } else { __pyx_t_8 = __pyx_t_9; } __pyx_t_9 = __pyx_t_8; } else { __pyx_t_9 = __pyx_t_6; } __pyx_t_6 = __pyx_t_9; } else { __pyx_t_6 = __pyx_t_4; } if (__pyx_t_6) { /* "/home/das/src/pyliblo/src/liblo.pyx":722 * isinstance(arg[0], (bytes, unicode)) and len(arg[0]) == 1): * # type explicitly specified * if len(arg) == 2: # <<<<<<<<<<<<<< * self._add(arg[0], arg[1]) * else: */ __pyx_t_5 = PyObject_Length(__pyx_v_arg); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = (__pyx_t_5 == 2); if (__pyx_t_6) { /* "/home/das/src/pyliblo/src/liblo.pyx":723 * # type explicitly specified * if len(arg) == 2: * self._add(arg[0], arg[1]) # <<<<<<<<<<<<<< * else: * self._add(arg[0], None) */ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_arg, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_arg, 1, sizeof(long), PyInt_FromLong); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = ((struct __pyx_vtabstruct_5liblo_Message *)((struct __pyx_obj_5liblo_Message *)__pyx_v_self)->__pyx_vtab)->_add(((struct __pyx_obj_5liblo_Message *)__pyx_v_self), __pyx_t_3, __pyx_t_10); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L8; } /*else*/ { /* "/home/das/src/pyliblo/src/liblo.pyx":725 * self._add(arg[0], arg[1]) * else: * self._add(arg[0], None) # <<<<<<<<<<<<<< * else: * # detect type automatically */ __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_arg, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_11) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __pyx_t_10 = ((struct __pyx_vtabstruct_5liblo_Message *)((struct __pyx_obj_5liblo_Message *)__pyx_v_self)->__pyx_vtab)->_add(((struct __pyx_obj_5liblo_Message *)__pyx_v_self), __pyx_t_11, Py_None); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 725; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __pyx_L8:; goto __pyx_L7; } /*else*/ { /* "/home/das/src/pyliblo/src/liblo.pyx":728 * else: * # detect type automatically * self._add_auto(arg) # <<<<<<<<<<<<<< * * cdef _add(self, type, value): */ __pyx_t_10 = ((struct __pyx_vtabstruct_5liblo_Message *)((struct __pyx_obj_5liblo_Message *)__pyx_v_self)->__pyx_vtab)->_add_auto(((struct __pyx_obj_5liblo_Message *)__pyx_v_self), __pyx_v_arg); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 728; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __pyx_L7:; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); __Pyx_AddTraceback("liblo.Message.add"); __pyx_r = NULL; __pyx_L0:; __Pyx_DECREF(__pyx_v_args); __Pyx_DECREF(__pyx_v_arg); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/das/src/pyliblo/src/liblo.pyx":730 * self._add_auto(arg) * * cdef _add(self, type, value): # <<<<<<<<<<<<<< * cdef uint8_t midi[4] * */ static PyObject *__pyx_f_5liblo_7Message__add(struct __pyx_obj_5liblo_Message *__pyx_v_self, PyObject *__pyx_v_type, PyObject *__pyx_v_value) { uint8_t __pyx_v_midi[4]; char __pyx_v_t; PyObject *__pyx_v_s; long __pyx_v_n; struct __pyx_obj_5liblo__Blob *__pyx_v_b; PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; char __pyx_t_3; int __pyx_t_4; int32_t __pyx_t_5; int64_t __pyx_t_6; double __pyx_t_7; char *__pyx_t_8; uint8_t __pyx_t_9; int __pyx_t_10; __Pyx_RefNannySetupContext("_add"); __pyx_v_s = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); __pyx_v_b = ((struct __pyx_obj_5liblo__Blob *)Py_None); __Pyx_INCREF(Py_None); /* "/home/das/src/pyliblo/src/liblo.pyx":734 * * # accept both bytes and unicode as type specifier * cdef char t = ord(_decode(type)[0]) # <<<<<<<<<<<<<< * * if t == 'i': */ __pyx_t_1 = ((PyObject *)__pyx_f_5liblo__decode(__pyx_v_type)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __Pyx_GIVEREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyObject_Call(__pyx_builtin_ord, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __pyx_t_3 = __Pyx_PyInt_AsChar(__pyx_t_2); if (unlikely((__pyx_t_3 == (char)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_t = __pyx_t_3; /* "/home/das/src/pyliblo/src/liblo.pyx":736 * cdef char t = ord(_decode(type)[0]) * * if t == 'i': # <<<<<<<<<<<<<< * lo_message_add_int32(self._message, int(value)) * elif t == 'h': */ __pyx_t_4 = (__pyx_v_t == 'i'); if (__pyx_t_4) { /* "/home/das/src/pyliblo/src/liblo.pyx":737 * * if t == 'i': * lo_message_add_int32(self._message, int(value)) # <<<<<<<<<<<<<< * elif t == 'h': * lo_message_add_int64(self._message, long(value)) */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __Pyx_INCREF(__pyx_v_value); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __pyx_t_5 = __Pyx_PyInt_from_py_int32_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (int32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; lo_message_add_int32(__pyx_v_self->_message, __pyx_t_5); goto __pyx_L3; } /* "/home/das/src/pyliblo/src/liblo.pyx":738 * if t == 'i': * lo_message_add_int32(self._message, int(value)) * elif t == 'h': # <<<<<<<<<<<<<< * lo_message_add_int64(self._message, long(value)) * elif t == 'f': */ __pyx_t_4 = (__pyx_v_t == 'h'); if (__pyx_t_4) { /* "/home/das/src/pyliblo/src/liblo.pyx":739 * lo_message_add_int32(self._message, int(value)) * elif t == 'h': * lo_message_add_int64(self._message, long(value)) # <<<<<<<<<<<<<< * elif t == 'f': * lo_message_add_float(self._message, float(value)) */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __Pyx_INCREF(__pyx_v_value); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyLong_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __pyx_t_6 = __Pyx_PyInt_from_py_int64_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (int64_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; lo_message_add_int64(__pyx_v_self->_message, __pyx_t_6); goto __pyx_L3; } /* "/home/das/src/pyliblo/src/liblo.pyx":740 * elif t == 'h': * lo_message_add_int64(self._message, long(value)) * elif t == 'f': # <<<<<<<<<<<<<< * lo_message_add_float(self._message, float(value)) * elif t == 'd': */ __pyx_t_4 = (__pyx_v_t == 'f'); if (__pyx_t_4) { /* "/home/das/src/pyliblo/src/liblo.pyx":741 * lo_message_add_int64(self._message, long(value)) * elif t == 'f': * lo_message_add_float(self._message, float(value)) # <<<<<<<<<<<<<< * elif t == 'd': * lo_message_add_double(self._message, float(value)) */ __pyx_t_7 = __Pyx_PyObject_AsDouble(__pyx_v_value); if (unlikely(__pyx_t_7 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;} lo_message_add_float(__pyx_v_self->_message, __pyx_t_7); goto __pyx_L3; } /* "/home/das/src/pyliblo/src/liblo.pyx":742 * elif t == 'f': * lo_message_add_float(self._message, float(value)) * elif t == 'd': # <<<<<<<<<<<<<< * lo_message_add_double(self._message, float(value)) * elif t == 'c': */ __pyx_t_4 = (__pyx_v_t == 'd'); if (__pyx_t_4) { /* "/home/das/src/pyliblo/src/liblo.pyx":743 * lo_message_add_float(self._message, float(value)) * elif t == 'd': * lo_message_add_double(self._message, float(value)) # <<<<<<<<<<<<<< * elif t == 'c': * lo_message_add_char(self._message, ord(value)) */ __pyx_t_7 = __Pyx_PyObject_AsDouble(__pyx_v_value); if (unlikely(__pyx_t_7 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;} lo_message_add_double(__pyx_v_self->_message, __pyx_t_7); goto __pyx_L3; } /* "/home/das/src/pyliblo/src/liblo.pyx":744 * elif t == 'd': * lo_message_add_double(self._message, float(value)) * elif t == 'c': # <<<<<<<<<<<<<< * lo_message_add_char(self._message, ord(value)) * elif t == 's': */ __pyx_t_4 = (__pyx_v_t == 'c'); if (__pyx_t_4) { /* "/home/das/src/pyliblo/src/liblo.pyx":745 * lo_message_add_double(self._message, float(value)) * elif t == 'c': * lo_message_add_char(self._message, ord(value)) # <<<<<<<<<<<<<< * elif t == 's': * s = _encode(value) */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __Pyx_INCREF(__pyx_v_value); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); __pyx_t_1 = PyObject_Call(__pyx_builtin_ord, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __pyx_t_3 = __Pyx_PyInt_AsChar(__pyx_t_1); if (unlikely((__pyx_t_3 == (char)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; lo_message_add_char(__pyx_v_self->_message, __pyx_t_3); goto __pyx_L3; } /* "/home/das/src/pyliblo/src/liblo.pyx":746 * elif t == 'c': * lo_message_add_char(self._message, ord(value)) * elif t == 's': # <<<<<<<<<<<<<< * s = _encode(value) * lo_message_add_string(self._message, s) */ __pyx_t_4 = (__pyx_v_t == 's'); if (__pyx_t_4) { /* "/home/das/src/pyliblo/src/liblo.pyx":747 * lo_message_add_char(self._message, ord(value)) * elif t == 's': * s = _encode(value) # <<<<<<<<<<<<<< * lo_message_add_string(self._message, s) * elif t == 'S': */ __pyx_t_1 = ((PyObject *)__pyx_f_5liblo__encode(__pyx_v_value)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_v_s)); __pyx_v_s = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":748 * elif t == 's': * s = _encode(value) * lo_message_add_string(self._message, s) # <<<<<<<<<<<<<< * elif t == 'S': * s = _encode(value) */ __pyx_t_8 = PyBytes_AsString(((PyObject *)__pyx_v_s)); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;} lo_message_add_string(__pyx_v_self->_message, __pyx_t_8); goto __pyx_L3; } /* "/home/das/src/pyliblo/src/liblo.pyx":749 * s = _encode(value) * lo_message_add_string(self._message, s) * elif t == 'S': # <<<<<<<<<<<<<< * s = _encode(value) * lo_message_add_symbol(self._message, s) */ __pyx_t_4 = (__pyx_v_t == 'S'); if (__pyx_t_4) { /* "/home/das/src/pyliblo/src/liblo.pyx":750 * lo_message_add_string(self._message, s) * elif t == 'S': * s = _encode(value) # <<<<<<<<<<<<<< * lo_message_add_symbol(self._message, s) * elif t == 'T': */ __pyx_t_1 = ((PyObject *)__pyx_f_5liblo__encode(__pyx_v_value)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_v_s)); __pyx_v_s = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":751 * elif t == 'S': * s = _encode(value) * lo_message_add_symbol(self._message, s) # <<<<<<<<<<<<<< * elif t == 'T': * lo_message_add_true(self._message) */ __pyx_t_8 = PyBytes_AsString(((PyObject *)__pyx_v_s)); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;} lo_message_add_symbol(__pyx_v_self->_message, __pyx_t_8); goto __pyx_L3; } /* "/home/das/src/pyliblo/src/liblo.pyx":752 * s = _encode(value) * lo_message_add_symbol(self._message, s) * elif t == 'T': # <<<<<<<<<<<<<< * lo_message_add_true(self._message) * elif t == 'F': */ __pyx_t_4 = (__pyx_v_t == 'T'); if (__pyx_t_4) { /* "/home/das/src/pyliblo/src/liblo.pyx":753 * lo_message_add_symbol(self._message, s) * elif t == 'T': * lo_message_add_true(self._message) # <<<<<<<<<<<<<< * elif t == 'F': * lo_message_add_false(self._message) */ lo_message_add_true(__pyx_v_self->_message); goto __pyx_L3; } /* "/home/das/src/pyliblo/src/liblo.pyx":754 * elif t == 'T': * lo_message_add_true(self._message) * elif t == 'F': # <<<<<<<<<<<<<< * lo_message_add_false(self._message) * elif t == 'N': */ __pyx_t_4 = (__pyx_v_t == 'F'); if (__pyx_t_4) { /* "/home/das/src/pyliblo/src/liblo.pyx":755 * lo_message_add_true(self._message) * elif t == 'F': * lo_message_add_false(self._message) # <<<<<<<<<<<<<< * elif t == 'N': * lo_message_add_nil(self._message) */ lo_message_add_false(__pyx_v_self->_message); goto __pyx_L3; } /* "/home/das/src/pyliblo/src/liblo.pyx":756 * elif t == 'F': * lo_message_add_false(self._message) * elif t == 'N': # <<<<<<<<<<<<<< * lo_message_add_nil(self._message) * elif t == 'I': */ __pyx_t_4 = (__pyx_v_t == 'N'); if (__pyx_t_4) { /* "/home/das/src/pyliblo/src/liblo.pyx":757 * lo_message_add_false(self._message) * elif t == 'N': * lo_message_add_nil(self._message) # <<<<<<<<<<<<<< * elif t == 'I': * lo_message_add_infinitum(self._message) */ lo_message_add_nil(__pyx_v_self->_message); goto __pyx_L3; } /* "/home/das/src/pyliblo/src/liblo.pyx":758 * elif t == 'N': * lo_message_add_nil(self._message) * elif t == 'I': # <<<<<<<<<<<<<< * lo_message_add_infinitum(self._message) * elif t == 'm': */ __pyx_t_4 = (__pyx_v_t == 'I'); if (__pyx_t_4) { /* "/home/das/src/pyliblo/src/liblo.pyx":759 * lo_message_add_nil(self._message) * elif t == 'I': * lo_message_add_infinitum(self._message) # <<<<<<<<<<<<<< * elif t == 'm': * for n from 0 <= n < 4: */ lo_message_add_infinitum(__pyx_v_self->_message); goto __pyx_L3; } /* "/home/das/src/pyliblo/src/liblo.pyx":760 * elif t == 'I': * lo_message_add_infinitum(self._message) * elif t == 'm': # <<<<<<<<<<<<<< * for n from 0 <= n < 4: * midi[n] = value[n] */ __pyx_t_4 = (__pyx_v_t == 'm'); if (__pyx_t_4) { /* "/home/das/src/pyliblo/src/liblo.pyx":761 * lo_message_add_infinitum(self._message) * elif t == 'm': * for n from 0 <= n < 4: # <<<<<<<<<<<<<< * midi[n] = value[n] * lo_message_add_midi(self._message, midi) */ for (__pyx_v_n = 0; __pyx_v_n < 4; __pyx_v_n++) { /* "/home/das/src/pyliblo/src/liblo.pyx":762 * elif t == 'm': * for n from 0 <= n < 4: * midi[n] = value[n] # <<<<<<<<<<<<<< * lo_message_add_midi(self._message, midi) * elif t == 't': */ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_value, __pyx_v_n, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = __Pyx_PyInt_from_py_uint8_t(__pyx_t_1); if (unlikely((__pyx_t_9 == (uint8_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; (__pyx_v_midi[__pyx_v_n]) = __pyx_t_9; } /* "/home/das/src/pyliblo/src/liblo.pyx":763 * for n from 0 <= n < 4: * midi[n] = value[n] * lo_message_add_midi(self._message, midi) # <<<<<<<<<<<<<< * elif t == 't': * lo_message_add_timetag(self._message, _double_to_timetag(value)) */ lo_message_add_midi(__pyx_v_self->_message, __pyx_v_midi); goto __pyx_L3; } /* "/home/das/src/pyliblo/src/liblo.pyx":764 * midi[n] = value[n] * lo_message_add_midi(self._message, midi) * elif t == 't': # <<<<<<<<<<<<<< * lo_message_add_timetag(self._message, _double_to_timetag(value)) * elif t == 'b': */ __pyx_t_4 = (__pyx_v_t == 't'); if (__pyx_t_4) { /* "/home/das/src/pyliblo/src/liblo.pyx":765 * lo_message_add_midi(self._message, midi) * elif t == 't': * lo_message_add_timetag(self._message, _double_to_timetag(value)) # <<<<<<<<<<<<<< * elif t == 'b': * b = _Blob(value) */ __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L1_error;} lo_message_add_timetag(__pyx_v_self->_message, __pyx_f_5liblo__double_to_timetag(__pyx_t_7)); goto __pyx_L3; } /* "/home/das/src/pyliblo/src/liblo.pyx":766 * elif t == 't': * lo_message_add_timetag(self._message, _double_to_timetag(value)) * elif t == 'b': # <<<<<<<<<<<<<< * b = _Blob(value) * # make sure the blob is not deleted as long as this message exists */ __pyx_t_4 = (__pyx_v_t == 'b'); if (__pyx_t_4) { /* "/home/das/src/pyliblo/src/liblo.pyx":767 * lo_message_add_timetag(self._message, _double_to_timetag(value)) * elif t == 'b': * b = _Blob(value) # <<<<<<<<<<<<<< * # make sure the blob is not deleted as long as this message exists * self._keep_refs.append(b) */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __Pyx_INCREF(__pyx_v_value); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5liblo__Blob)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_DECREF(((PyObject *)__pyx_v_b)); __pyx_v_b = ((struct __pyx_obj_5liblo__Blob *)__pyx_t_2); __pyx_t_2 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":769 * b = _Blob(value) * # make sure the blob is not deleted as long as this message exists * self._keep_refs.append(b) # <<<<<<<<<<<<<< * lo_message_add_blob(self._message, (<_Blob>b)._blob) * else: */ if (unlikely(__pyx_v_self->_keep_refs == Py_None)) { PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_10 = PyList_Append(__pyx_v_self->_keep_refs, ((PyObject *)__pyx_v_b)); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "/home/das/src/pyliblo/src/liblo.pyx":770 * # make sure the blob is not deleted as long as this message exists * self._keep_refs.append(b) * lo_message_add_blob(self._message, (<_Blob>b)._blob) # <<<<<<<<<<<<<< * else: * raise TypeError("unknown OSC data type '%c'" % t) */ lo_message_add_blob(__pyx_v_self->_message, __pyx_v_b->_blob); goto __pyx_L3; } /*else*/ { /* "/home/das/src/pyliblo/src/liblo.pyx":772 * lo_message_add_blob(self._message, (<_Blob>b)._blob) * else: * raise TypeError("unknown OSC data type '%c'" % t) # <<<<<<<<<<<<<< * * cdef _add_auto(self, value): */ __pyx_t_2 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_18), __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_1)); __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __pyx_t_1 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __Pyx_Raise(__pyx_t_1, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L3:; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_AddTraceback("liblo.Message._add"); __pyx_r = 0; __pyx_L0:; __Pyx_DECREF(__pyx_v_s); __Pyx_DECREF((PyObject *)__pyx_v_b); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/das/src/pyliblo/src/liblo.pyx":774 * raise TypeError("unknown OSC data type '%c'" % t) * * cdef _add_auto(self, value): # <<<<<<<<<<<<<< * # bool is a subclass of int, so check those first * if value is True: */ static PyObject *__pyx_f_5liblo_7Message__add_auto(struct __pyx_obj_5liblo_Message *__pyx_v_self, PyObject *__pyx_v_value) { PyObject *__pyx_v_s; PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int32_t __pyx_t_4; int64_t __pyx_t_5; double __pyx_t_6; int __pyx_t_7; int __pyx_t_8; char *__pyx_t_9; int __pyx_t_10; PyObject *__pyx_t_11 = NULL; PyObject *__pyx_t_12 = NULL; __Pyx_RefNannySetupContext("_add_auto"); __pyx_v_s = ((PyObject*)Py_None); __Pyx_INCREF(Py_None); /* "/home/das/src/pyliblo/src/liblo.pyx":776 * cdef _add_auto(self, value): * # bool is a subclass of int, so check those first * if value is True: # <<<<<<<<<<<<<< * lo_message_add_true(self._message) * elif value is False: */ __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__pyx_v_value == __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "/home/das/src/pyliblo/src/liblo.pyx":777 * # bool is a subclass of int, so check those first * if value is True: * lo_message_add_true(self._message) # <<<<<<<<<<<<<< * elif value is False: * lo_message_add_false(self._message) */ lo_message_add_true(__pyx_v_self->_message); goto __pyx_L3; } /* "/home/das/src/pyliblo/src/liblo.pyx":778 * if value is True: * lo_message_add_true(self._message) * elif value is False: # <<<<<<<<<<<<<< * lo_message_add_false(self._message) * elif isinstance(value, int): */ __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = (__pyx_v_value == __pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "/home/das/src/pyliblo/src/liblo.pyx":779 * lo_message_add_true(self._message) * elif value is False: * lo_message_add_false(self._message) # <<<<<<<<<<<<<< * elif isinstance(value, int): * lo_message_add_int32(self._message, int(value)) */ lo_message_add_false(__pyx_v_self->_message); goto __pyx_L3; } /* "/home/das/src/pyliblo/src/liblo.pyx":780 * elif value is False: * lo_message_add_false(self._message) * elif isinstance(value, int): # <<<<<<<<<<<<<< * lo_message_add_int32(self._message, int(value)) * elif isinstance(value, long): */ __pyx_t_2 = PyInt_Check(__pyx_v_value); if (__pyx_t_2) { /* "/home/das/src/pyliblo/src/liblo.pyx":781 * lo_message_add_false(self._message) * elif isinstance(value, int): * lo_message_add_int32(self._message, int(value)) # <<<<<<<<<<<<<< * elif isinstance(value, long): * lo_message_add_int64(self._message, long(value)) */ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __Pyx_INCREF(__pyx_v_value); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __pyx_t_4 = __Pyx_PyInt_from_py_int32_t(__pyx_t_3); if (unlikely((__pyx_t_4 == (int32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; lo_message_add_int32(__pyx_v_self->_message, __pyx_t_4); goto __pyx_L3; } /* "/home/das/src/pyliblo/src/liblo.pyx":782 * elif isinstance(value, int): * lo_message_add_int32(self._message, int(value)) * elif isinstance(value, long): # <<<<<<<<<<<<<< * lo_message_add_int64(self._message, long(value)) * elif isinstance(value, float): */ __pyx_t_2 = PyLong_Check(__pyx_v_value); if (__pyx_t_2) { /* "/home/das/src/pyliblo/src/liblo.pyx":783 * lo_message_add_int32(self._message, int(value)) * elif isinstance(value, long): * lo_message_add_int64(self._message, long(value)) # <<<<<<<<<<<<<< * elif isinstance(value, float): * lo_message_add_float(self._message, float(value)) */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); __Pyx_INCREF(__pyx_v_value); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_value); __Pyx_GIVEREF(__pyx_v_value); __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyLong_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __pyx_t_5 = __Pyx_PyInt_from_py_int64_t(__pyx_t_1); if (unlikely((__pyx_t_5 == (int64_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; lo_message_add_int64(__pyx_v_self->_message, __pyx_t_5); goto __pyx_L3; } /* "/home/das/src/pyliblo/src/liblo.pyx":784 * elif isinstance(value, long): * lo_message_add_int64(self._message, long(value)) * elif isinstance(value, float): # <<<<<<<<<<<<<< * lo_message_add_float(self._message, float(value)) * elif isinstance(value, (bytes, unicode)): */ __pyx_t_2 = PyFloat_Check(__pyx_v_value); if (__pyx_t_2) { /* "/home/das/src/pyliblo/src/liblo.pyx":785 * lo_message_add_int64(self._message, long(value)) * elif isinstance(value, float): * lo_message_add_float(self._message, float(value)) # <<<<<<<<<<<<<< * elif isinstance(value, (bytes, unicode)): * s = _encode(value) */ __pyx_t_6 = __Pyx_PyObject_AsDouble(__pyx_v_value); if (unlikely(__pyx_t_6 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;} lo_message_add_float(__pyx_v_self->_message, __pyx_t_6); goto __pyx_L3; } /* "/home/das/src/pyliblo/src/liblo.pyx":786 * elif isinstance(value, float): * lo_message_add_float(self._message, float(value)) * elif isinstance(value, (bytes, unicode)): # <<<<<<<<<<<<<< * s = _encode(value) * lo_message_add_string(self._message, s) */ __Pyx_INCREF(__pyx_v_value); __pyx_t_1 = __pyx_v_value; __pyx_t_2 = PyBytes_Check(__pyx_t_1); if (!__pyx_t_2) { __pyx_t_7 = PyUnicode_Check(__pyx_t_1); __pyx_t_8 = __pyx_t_7; } else { __pyx_t_8 = __pyx_t_2; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_8) { /* "/home/das/src/pyliblo/src/liblo.pyx":787 * lo_message_add_float(self._message, float(value)) * elif isinstance(value, (bytes, unicode)): * s = _encode(value) # <<<<<<<<<<<<<< * lo_message_add_string(self._message, s) * elif value == None: */ __pyx_t_1 = ((PyObject *)__pyx_f_5liblo__encode(__pyx_v_value)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 787; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(((PyObject *)__pyx_v_s)); __pyx_v_s = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":788 * elif isinstance(value, (bytes, unicode)): * s = _encode(value) * lo_message_add_string(self._message, s) # <<<<<<<<<<<<<< * elif value == None: * lo_message_add_nil(self._message) */ __pyx_t_9 = PyBytes_AsString(((PyObject *)__pyx_v_s)); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;} lo_message_add_string(__pyx_v_self->_message, __pyx_t_9); goto __pyx_L3; } /* "/home/das/src/pyliblo/src/liblo.pyx":789 * s = _encode(value) * lo_message_add_string(self._message, s) * elif value == None: # <<<<<<<<<<<<<< * lo_message_add_nil(self._message) * elif value == float('inf'): */ __pyx_t_1 = PyObject_RichCompare(__pyx_v_value, Py_None, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 789; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_8) { /* "/home/das/src/pyliblo/src/liblo.pyx":790 * lo_message_add_string(self._message, s) * elif value == None: * lo_message_add_nil(self._message) # <<<<<<<<<<<<<< * elif value == float('inf'): * lo_message_add_infinitum(self._message) */ lo_message_add_nil(__pyx_v_self->_message); goto __pyx_L3; } /* "/home/das/src/pyliblo/src/liblo.pyx":791 * elif value == None: * lo_message_add_nil(self._message) * elif value == float('inf'): # <<<<<<<<<<<<<< * lo_message_add_infinitum(self._message) * else: */ __pyx_t_6 = __Pyx_PyObject_AsDouble(((PyObject *)__pyx_n_s__inf)); if (unlikely(__pyx_t_6 == ((double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_1 = PyFloat_FromDouble(__pyx_t_6); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_3 = PyObject_RichCompare(__pyx_v_value, __pyx_t_1, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_8) { /* "/home/das/src/pyliblo/src/liblo.pyx":792 * lo_message_add_nil(self._message) * elif value == float('inf'): * lo_message_add_infinitum(self._message) # <<<<<<<<<<<<<< * else: * # last chance: could be a blob */ lo_message_add_infinitum(__pyx_v_self->_message); goto __pyx_L3; } /*else*/ { /* "/home/das/src/pyliblo/src/liblo.pyx":795 * else: * # last chance: could be a blob * try: # <<<<<<<<<<<<<< * iter(value) * except TypeError: */ { PyObject *__pyx_save_exc_type, *__pyx_save_exc_value, *__pyx_save_exc_tb; __Pyx_ExceptionSave(&__pyx_save_exc_type, &__pyx_save_exc_value, &__pyx_save_exc_tb); __Pyx_XGOTREF(__pyx_save_exc_type); __Pyx_XGOTREF(__pyx_save_exc_value); __Pyx_XGOTREF(__pyx_save_exc_tb); /*try:*/ { /* "/home/das/src/pyliblo/src/liblo.pyx":796 * # last chance: could be a blob * try: * iter(value) # <<<<<<<<<<<<<< * except TypeError: * raise TypeError("unsupported message argument type") */ __pyx_t_3 = PyObject_GetIter(__pyx_v_value); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L4_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_XDECREF(__pyx_save_exc_type); __pyx_save_exc_type = 0; __Pyx_XDECREF(__pyx_save_exc_value); __pyx_save_exc_value = 0; __Pyx_XDECREF(__pyx_save_exc_tb); __pyx_save_exc_tb = 0; goto __pyx_L11_try_end; __pyx_L4_error:; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":797 * try: * iter(value) * except TypeError: # <<<<<<<<<<<<<< * raise TypeError("unsupported message argument type") * self._add('b', value) */ __pyx_t_10 = PyErr_ExceptionMatches(__pyx_builtin_TypeError); if (__pyx_t_10) { __Pyx_AddTraceback("liblo.Message._add_auto"); if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_GOTREF(__pyx_t_1); __Pyx_GOTREF(__pyx_t_11); /* "/home/das/src/pyliblo/src/liblo.pyx":798 * iter(value) * except TypeError: * raise TypeError("unsupported message argument type") # <<<<<<<<<<<<<< * self._add('b', value) * */ __pyx_t_12 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_20), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} __Pyx_GOTREF(__pyx_t_12); __Pyx_Raise(__pyx_t_12, 0, 0); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L5_exception_handled; } __pyx_L6_except_error:; __Pyx_XGIVEREF(__pyx_save_exc_type); __Pyx_XGIVEREF(__pyx_save_exc_value); __Pyx_XGIVEREF(__pyx_save_exc_tb); __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); goto __pyx_L1_error; __pyx_L5_exception_handled:; __Pyx_XGIVEREF(__pyx_save_exc_type); __Pyx_XGIVEREF(__pyx_save_exc_value); __Pyx_XGIVEREF(__pyx_save_exc_tb); __Pyx_ExceptionReset(__pyx_save_exc_type, __pyx_save_exc_value, __pyx_save_exc_tb); __pyx_L11_try_end:; } /* "/home/das/src/pyliblo/src/liblo.pyx":799 * except TypeError: * raise TypeError("unsupported message argument type") * self._add('b', value) # <<<<<<<<<<<<<< * * */ __pyx_t_11 = ((struct __pyx_vtabstruct_5liblo_Message *)__pyx_v_self->__pyx_vtab)->_add(__pyx_v_self, ((PyObject *)__pyx_n_s__b), __pyx_v_value); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __pyx_L3:; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_11); __Pyx_XDECREF(__pyx_t_12); __Pyx_AddTraceback("liblo.Message._add_auto"); __pyx_r = 0; __pyx_L0:; __Pyx_DECREF(__pyx_v_s); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/das/src/pyliblo/src/liblo.pyx":817 * cdef list _keep_refs * * def __init__(self, *messages): # <<<<<<<<<<<<<< * cdef lo_timetag tt * tt.sec, tt.frac = 0, 0 */ static int __pyx_pf_5liblo_6Bundle_0__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static int __pyx_pf_5liblo_6Bundle_0__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_messages = 0; lo_timetag __pyx_v_tt; PyObject *__pyx_v_t; int __pyx_r; uint32_t __pyx_t_1; uint32_t __pyx_t_2; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; int __pyx_t_5; int __pyx_t_6; int __pyx_t_7; double __pyx_t_8; PyObject *__pyx_t_9 = NULL; PyObject *__pyx_t_10 = NULL; __Pyx_RefNannySetupContext("__init__"); if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1; __Pyx_INCREF(__pyx_args); __pyx_v_messages = __pyx_args; __pyx_v_t = Py_None; __Pyx_INCREF(Py_None); /* "/home/das/src/pyliblo/src/liblo.pyx":819 * def __init__(self, *messages): * cdef lo_timetag tt * tt.sec, tt.frac = 0, 0 # <<<<<<<<<<<<<< * self._keep_refs = [] * */ __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_v_tt.sec = __pyx_t_1; __pyx_v_tt.frac = __pyx_t_2; /* "/home/das/src/pyliblo/src/liblo.pyx":820 * cdef lo_timetag tt * tt.sec, tt.frac = 0, 0 * self._keep_refs = [] # <<<<<<<<<<<<<< * * if len(messages) and not isinstance(messages[0], Message): */ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); __Pyx_GIVEREF(((PyObject *)__pyx_t_3)); __Pyx_GOTREF(((struct __pyx_obj_5liblo_Bundle *)__pyx_v_self)->_keep_refs); __Pyx_DECREF(((PyObject *)((struct __pyx_obj_5liblo_Bundle *)__pyx_v_self)->_keep_refs)); ((struct __pyx_obj_5liblo_Bundle *)__pyx_v_self)->_keep_refs = __pyx_t_3; __pyx_t_3 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":822 * self._keep_refs = [] * * if len(messages) and not isinstance(messages[0], Message): # <<<<<<<<<<<<<< * t = messages[0] * if isinstance(t, (float, int, long)): */ if (unlikely(__pyx_v_messages == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_4 = PyTuple_GET_SIZE(((PyObject *)__pyx_v_messages)); if (__pyx_t_4) { __pyx_t_3 = __Pyx_GetItemInt_Tuple(((PyObject *)__pyx_v_messages), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = PyObject_TypeCheck(__pyx_t_3, ((PyTypeObject *)((PyObject*)__pyx_ptype_5liblo_Message))); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = (!__pyx_t_5); __pyx_t_5 = __pyx_t_6; } else { __pyx_t_5 = __pyx_t_4; } if (__pyx_t_5) { /* "/home/das/src/pyliblo/src/liblo.pyx":823 * * if len(messages) and not isinstance(messages[0], Message): * t = messages[0] # <<<<<<<<<<<<<< * if isinstance(t, (float, int, long)): * tt = _double_to_timetag(t) */ __pyx_t_3 = __Pyx_GetItemInt_Tuple(((PyObject *)__pyx_v_messages), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_v_t); __pyx_v_t = __pyx_t_3; __pyx_t_3 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":824 * if len(messages) and not isinstance(messages[0], Message): * t = messages[0] * if isinstance(t, (float, int, long)): # <<<<<<<<<<<<<< * tt = _double_to_timetag(t) * elif isinstance(t, tuple) and len(t) == 2: */ __Pyx_INCREF(__pyx_v_t); __pyx_t_3 = __pyx_v_t; __pyx_t_5 = PyFloat_Check(__pyx_t_3); if (!__pyx_t_5) { __pyx_t_6 = PyInt_Check(__pyx_t_3); __pyx_t_7 = __pyx_t_6; } else { __pyx_t_7 = __pyx_t_5; } if (!__pyx_t_7) { __pyx_t_5 = PyLong_Check(__pyx_t_3); __pyx_t_6 = __pyx_t_5; } else { __pyx_t_6 = __pyx_t_7; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { /* "/home/das/src/pyliblo/src/liblo.pyx":825 * t = messages[0] * if isinstance(t, (float, int, long)): * tt = _double_to_timetag(t) # <<<<<<<<<<<<<< * elif isinstance(t, tuple) and len(t) == 2: * tt.sec, tt.frac = t */ __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_v_t); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_v_tt = __pyx_f_5liblo__double_to_timetag(__pyx_t_8); goto __pyx_L6; } /* "/home/das/src/pyliblo/src/liblo.pyx":826 * if isinstance(t, (float, int, long)): * tt = _double_to_timetag(t) * elif isinstance(t, tuple) and len(t) == 2: # <<<<<<<<<<<<<< * tt.sec, tt.frac = t * else: */ __pyx_t_6 = PyTuple_Check(__pyx_v_t); if (__pyx_t_6) { __pyx_t_4 = PyObject_Length(__pyx_v_t); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_7 = (__pyx_t_4 == 2); __pyx_t_5 = __pyx_t_7; } else { __pyx_t_5 = __pyx_t_6; } if (__pyx_t_5) { /* "/home/das/src/pyliblo/src/liblo.pyx":827 * tt = _double_to_timetag(t) * elif isinstance(t, tuple) and len(t) == 2: * tt.sec, tt.frac = t # <<<<<<<<<<<<<< * else: * raise TypeError("invalid timetag") */ if (PyTuple_CheckExact(__pyx_v_t) && likely(PyTuple_GET_SIZE(__pyx_v_t) == 2)) { PyObject* tuple = __pyx_v_t; __pyx_t_3 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = __Pyx_PyInt_from_py_uint32_t(__pyx_t_3); if (unlikely((__pyx_t_2 == (uint32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_9 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_t_9); __pyx_t_1 = __Pyx_PyInt_from_py_uint32_t(__pyx_t_9); if (unlikely((__pyx_t_1 == (uint32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_tt.sec = __pyx_t_2; __pyx_v_tt.frac = __pyx_t_1; } else { __pyx_t_10 = PyObject_GetIter(__pyx_v_t); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __pyx_t_3 = __Pyx_UnpackItem(__pyx_t_10, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = __Pyx_PyInt_from_py_uint32_t(__pyx_t_3); if (unlikely((__pyx_t_1 == (uint32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_9 = __Pyx_UnpackItem(__pyx_t_10, 1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_2 = __Pyx_PyInt_from_py_uint32_t(__pyx_t_9); if (unlikely((__pyx_t_2 == (uint32_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__Pyx_EndUnpack(__pyx_t_10, 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_v_tt.sec = __pyx_t_1; __pyx_v_tt.frac = __pyx_t_2; } goto __pyx_L6; } /*else*/ { /* "/home/das/src/pyliblo/src/liblo.pyx":829 * tt.sec, tt.frac = t * else: * raise TypeError("invalid timetag") # <<<<<<<<<<<<<< * # first argument was timetag, so continue with second * messages = messages[1:] */ __pyx_t_9 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_22), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __Pyx_Raise(__pyx_t_9, 0, 0); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_L6:; /* "/home/das/src/pyliblo/src/liblo.pyx":831 * raise TypeError("invalid timetag") * # first argument was timetag, so continue with second * messages = messages[1:] # <<<<<<<<<<<<<< * * self._bundle = lo_bundle_new(tt) */ __pyx_t_9 = __Pyx_PySequence_GetSlice(((PyObject *)__pyx_v_messages), 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_9)); __Pyx_DECREF(((PyObject *)__pyx_v_messages)); __pyx_v_messages = __pyx_t_9; __pyx_t_9 = 0; goto __pyx_L5; } __pyx_L5:; /* "/home/das/src/pyliblo/src/liblo.pyx":833 * messages = messages[1:] * * self._bundle = lo_bundle_new(tt) # <<<<<<<<<<<<<< * if len(messages): * self.add(*messages) */ ((struct __pyx_obj_5liblo_Bundle *)__pyx_v_self)->_bundle = lo_bundle_new(__pyx_v_tt); /* "/home/das/src/pyliblo/src/liblo.pyx":834 * * self._bundle = lo_bundle_new(tt) * if len(messages): # <<<<<<<<<<<<<< * self.add(*messages) * */ if (unlikely(__pyx_v_messages == Py_None)) { PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_4 = PyTuple_GET_SIZE(((PyObject *)__pyx_v_messages)); if (__pyx_t_4) { /* "/home/das/src/pyliblo/src/liblo.pyx":835 * self._bundle = lo_bundle_new(tt) * if len(messages): * self.add(*messages) # <<<<<<<<<<<<<< * * def __dealloc__(self): */ __pyx_t_9 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__add); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_9); __pyx_t_3 = PySequence_Tuple(((PyObject *)__pyx_v_messages)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); __pyx_t_10 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; goto __pyx_L7; } __pyx_L7:; __pyx_r = 0; goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); __Pyx_AddTraceback("liblo.Bundle.__init__"); __pyx_r = -1; __pyx_L0:; __Pyx_DECREF(__pyx_v_messages); __Pyx_DECREF(__pyx_v_t); __Pyx_RefNannyFinishContext(); return __pyx_r; } /* "/home/das/src/pyliblo/src/liblo.pyx":837 * self.add(*messages) * * def __dealloc__(self): # <<<<<<<<<<<<<< * lo_bundle_free(self._bundle) * */ static void __pyx_pf_5liblo_6Bundle_1__dealloc__(PyObject *__pyx_v_self); /*proto*/ static void __pyx_pf_5liblo_6Bundle_1__dealloc__(PyObject *__pyx_v_self) { __Pyx_RefNannySetupContext("__dealloc__"); /* "/home/das/src/pyliblo/src/liblo.pyx":838 * * def __dealloc__(self): * lo_bundle_free(self._bundle) # <<<<<<<<<<<<<< * * def add(self, *args): */ lo_bundle_free(((struct __pyx_obj_5liblo_Bundle *)__pyx_v_self)->_bundle); __Pyx_RefNannyFinishContext(); } /* "/home/das/src/pyliblo/src/liblo.pyx":840 * lo_bundle_free(self._bundle) * * def add(self, *args): # <<<<<<<<<<<<<< * """ * add(message[, ...]) */ static PyObject *__pyx_pf_5liblo_6Bundle_2add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_5liblo_6Bundle_2add[] = "\n add(message[, ...])\n add(path[, arg, ...])\n\n Adds one or more messages to the bundle.\n "; static PyObject *__pyx_pf_5liblo_6Bundle_2add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_args = 0; PyObject *__pyx_v_messages; PyObject *__pyx_v_m; struct __pyx_obj_5liblo_Message *__pyx_v_message; PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; int __pyx_t_2; PyObject *__pyx_t_3 = NULL; Py_ssize_t __pyx_t_4; int __pyx_t_5; char *__pyx_t_6; __Pyx_RefNannySetupContext("add"); if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "add", 0))) return NULL; __Pyx_INCREF(__pyx_args); __pyx_v_args = __pyx_args; __pyx_v_messages = Py_None; __Pyx_INCREF(Py_None); __pyx_v_m = Py_None; __Pyx_INCREF(Py_None); __pyx_v_message = ((struct __pyx_obj_5liblo_Message *)Py_None); __Pyx_INCREF(Py_None); /* "/home/das/src/pyliblo/src/liblo.pyx":847 * Adds one or more messages to the bundle. * """ * if isinstance(args[0], Message): # <<<<<<<<<<<<<< * # args is already a list of Messages * messages = args */ __pyx_t_1 = __Pyx_GetItemInt_Tuple(((PyObject *)__pyx_v_args), 0, sizeof(long), PyInt_FromLong); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = PyObject_TypeCheck(__pyx_t_1, ((PyTypeObject *)((PyObject*)__pyx_ptype_5liblo_Message))); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { /* "/home/das/src/pyliblo/src/liblo.pyx":849 * if isinstance(args[0], Message): * # args is already a list of Messages * messages = args # <<<<<<<<<<<<<< * else: * # make a single Message from all arguments */ __Pyx_INCREF(((PyObject *)__pyx_v_args)); __Pyx_DECREF(__pyx_v_messages); __pyx_v_messages = ((PyObject *)__pyx_v_args); goto __pyx_L5; } /*else*/ { /* "/home/das/src/pyliblo/src/liblo.pyx":852 * else: * # make a single Message from all arguments * messages = [Message(*args)] # <<<<<<<<<<<<<< * * # add all messages */ __pyx_t_1 = PySequence_Tuple(((PyObject *)__pyx_v_args)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5liblo_Message)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_v_messages); __pyx_v_messages = ((PyObject *)__pyx_t_1); __pyx_t_1 = 0; } __pyx_L5:; /* "/home/das/src/pyliblo/src/liblo.pyx":855 * * # add all messages * for m in messages: # <<<<<<<<<<<<<< * self._keep_refs.append(m) * message = m */ if (PyList_CheckExact(__pyx_v_messages) || PyTuple_CheckExact(__pyx_v_messages)) { __pyx_t_4 = 0; __pyx_t_1 = __pyx_v_messages; __Pyx_INCREF(__pyx_t_1); } else { __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_messages); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 855; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); } for (;;) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break; __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; } else if (likely(PyTuple_CheckExact(__pyx_t_1))) { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break; __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; } else { __pyx_t_3 = PyIter_Next(__pyx_t_1); if (!__pyx_t_3) { if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 855; __pyx_clineno = __LINE__; goto __pyx_L1_error;} break; } __Pyx_GOTREF(__pyx_t_3); } __Pyx_DECREF(__pyx_v_m); __pyx_v_m = __pyx_t_3; __pyx_t_3 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":856 * # add all messages * for m in messages: * self._keep_refs.append(m) # <<<<<<<<<<<<<< * message = m * lo_bundle_add_message(self._bundle, message._path, message._message) */ if (unlikely(((struct __pyx_obj_5liblo_Bundle *)__pyx_v_self)->_keep_refs == Py_None)) { PyErr_SetString(PyExc_AttributeError, "'NoneType' object has no attribute 'append'"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_5 = PyList_Append(((struct __pyx_obj_5liblo_Bundle *)__pyx_v_self)->_keep_refs, __pyx_v_m); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "/home/das/src/pyliblo/src/liblo.pyx":857 * for m in messages: * self._keep_refs.append(m) * message = m # <<<<<<<<<<<<<< * lo_bundle_add_message(self._bundle, message._path, message._message) */ __Pyx_INCREF(((PyObject *)((struct __pyx_obj_5liblo_Message *)__pyx_v_m))); __Pyx_DECREF(((PyObject *)__pyx_v_message)); __pyx_v_message = ((struct __pyx_obj_5liblo_Message *)__pyx_v_m); /* "/home/das/src/pyliblo/src/liblo.pyx":858 * self._keep_refs.append(m) * message = m * lo_bundle_add_message(self._bundle, message._path, message._message) # <<<<<<<<<<<<<< */ __pyx_t_6 = PyBytes_AsString(((PyObject *)__pyx_v_message->_path)); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; __pyx_clineno = __LINE__; goto __pyx_L1_error;} lo_bundle_add_message(((struct __pyx_obj_5liblo_Bundle *)__pyx_v_self)->_bundle, __pyx_t_6, __pyx_v_message->_message); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("liblo.Bundle.add"); __pyx_r = NULL; __pyx_L0:; __Pyx_DECREF(__pyx_v_args); __Pyx_DECREF(__pyx_v_messages); __Pyx_DECREF(__pyx_v_m); __Pyx_DECREF((PyObject *)__pyx_v_message); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } static PyObject *__pyx_tp_new_5liblo__ServerBase(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_5liblo__ServerBase *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; p = ((struct __pyx_obj_5liblo__ServerBase *)o); p->_keep_refs = ((PyObject*)Py_None); Py_INCREF(Py_None); return o; } static void __pyx_tp_dealloc_5liblo__ServerBase(PyObject *o) { struct __pyx_obj_5liblo__ServerBase *p = (struct __pyx_obj_5liblo__ServerBase *)o; Py_XDECREF(((PyObject *)p->_keep_refs)); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_5liblo__ServerBase(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_5liblo__ServerBase *p = (struct __pyx_obj_5liblo__ServerBase *)o; if (p->_keep_refs) { e = (*v)(p->_keep_refs, a); if (e) return e; } return 0; } static int __pyx_tp_clear_5liblo__ServerBase(PyObject *o) { struct __pyx_obj_5liblo__ServerBase *p = (struct __pyx_obj_5liblo__ServerBase *)o; PyObject* tmp; tmp = ((PyObject*)p->_keep_refs); p->_keep_refs = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyObject *__pyx_getprop_5liblo_11_ServerBase_url(PyObject *o, void *x) { return __pyx_pf_5liblo_11_ServerBase_3url_0__get__(o); } static PyObject *__pyx_getprop_5liblo_11_ServerBase_port(PyObject *o, void *x) { return __pyx_pf_5liblo_11_ServerBase_4port_0__get__(o); } static PyObject *__pyx_getprop_5liblo_11_ServerBase_protocol(PyObject *o, void *x) { return __pyx_pf_5liblo_11_ServerBase_8protocol_0__get__(o); } static PyMethodDef __pyx_methods_5liblo__ServerBase[] = { {__Pyx_NAMESTR("register_methods"), (PyCFunction)__pyx_pf_5liblo_11_ServerBase_1register_methods, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5liblo_11_ServerBase_1register_methods)}, {__Pyx_NAMESTR("get_url"), (PyCFunction)__pyx_pf_5liblo_11_ServerBase_2get_url, METH_NOARGS, __Pyx_DOCSTR(0)}, {__Pyx_NAMESTR("get_port"), (PyCFunction)__pyx_pf_5liblo_11_ServerBase_3get_port, METH_NOARGS, __Pyx_DOCSTR(0)}, {__Pyx_NAMESTR("get_protocol"), (PyCFunction)__pyx_pf_5liblo_11_ServerBase_4get_protocol, METH_NOARGS, __Pyx_DOCSTR(0)}, {__Pyx_NAMESTR("fileno"), (PyCFunction)__pyx_pf_5liblo_11_ServerBase_5fileno, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5liblo_11_ServerBase_5fileno)}, {__Pyx_NAMESTR("add_method"), (PyCFunction)__pyx_pf_5liblo_11_ServerBase_6add_method, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5liblo_11_ServerBase_6add_method)}, {__Pyx_NAMESTR("send"), (PyCFunction)__pyx_pf_5liblo_11_ServerBase_7send, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5liblo_11_ServerBase_7send)}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_5liblo__ServerBase[] = { {(char *)"url", __pyx_getprop_5liblo_11_ServerBase_url, 0, __Pyx_DOCSTR(__pyx_k_23), 0}, {(char *)"port", __pyx_getprop_5liblo_11_ServerBase_port, 0, __Pyx_DOCSTR(__pyx_k_24), 0}, {(char *)"protocol", __pyx_getprop_5liblo_11_ServerBase_protocol, 0, __Pyx_DOCSTR(__pyx_k_25), 0}, {0, 0, 0, 0, 0} }; static PyNumberMethods __pyx_tp_as_number__ServerBase = { 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ #if PY_MAJOR_VERSION < 3 0, /*nb_divide*/ #endif 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ 0, /*nb_negative*/ 0, /*nb_positive*/ 0, /*nb_absolute*/ 0, /*nb_nonzero*/ 0, /*nb_invert*/ 0, /*nb_lshift*/ 0, /*nb_rshift*/ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ #if PY_MAJOR_VERSION < 3 0, /*nb_coerce*/ #endif 0, /*nb_int*/ #if PY_MAJOR_VERSION < 3 0, /*nb_long*/ #else 0, /*reserved*/ #endif 0, /*nb_float*/ #if PY_MAJOR_VERSION < 3 0, /*nb_oct*/ #endif #if PY_MAJOR_VERSION < 3 0, /*nb_hex*/ #endif 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ #if PY_MAJOR_VERSION < 3 0, /*nb_inplace_divide*/ #endif 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ 0, /*nb_inplace_rshift*/ 0, /*nb_inplace_and*/ 0, /*nb_inplace_xor*/ 0, /*nb_inplace_or*/ 0, /*nb_floor_divide*/ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ #if PY_VERSION_HEX >= 0x02050000 0, /*nb_index*/ #endif }; static PySequenceMethods __pyx_tp_as_sequence__ServerBase = { 0, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ 0, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ 0, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping__ServerBase = { 0, /*mp_length*/ 0, /*mp_subscript*/ 0, /*mp_ass_subscript*/ }; static PyBufferProcs __pyx_tp_as_buffer__ServerBase = { #if PY_MAJOR_VERSION < 3 0, /*bf_getreadbuffer*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getwritebuffer*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getsegcount*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getcharbuffer*/ #endif #if PY_VERSION_HEX >= 0x02060000 0, /*bf_getbuffer*/ #endif #if PY_VERSION_HEX >= 0x02060000 0, /*bf_releasebuffer*/ #endif }; PyTypeObject __pyx_type_5liblo__ServerBase = { PyVarObject_HEAD_INIT(0, 0) __Pyx_NAMESTR("liblo._ServerBase"), /*tp_name*/ sizeof(struct __pyx_obj_5liblo__ServerBase), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_5liblo__ServerBase, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #else 0, /*reserved*/ #endif 0, /*tp_repr*/ &__pyx_tp_as_number__ServerBase, /*tp_as_number*/ &__pyx_tp_as_sequence__ServerBase, /*tp_as_sequence*/ &__pyx_tp_as_mapping__ServerBase, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer__ServerBase, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ 0, /*tp_doc*/ __pyx_tp_traverse_5liblo__ServerBase, /*tp_traverse*/ __pyx_tp_clear_5liblo__ServerBase, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_5liblo__ServerBase, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_5liblo__ServerBase, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_pf_5liblo_11_ServerBase_0__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_5liblo__ServerBase, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif }; static PyObject *__pyx_tp_new_5liblo_Address(PyTypeObject *t, PyObject *a, PyObject *k) { PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; return o; } static void __pyx_tp_dealloc_5liblo_Address(PyObject *o) { { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); ++Py_REFCNT(o); __pyx_pf_5liblo_7Address_1__dealloc__(o); if (PyErr_Occurred()) PyErr_WriteUnraisable(o); --Py_REFCNT(o); PyErr_Restore(etype, eval, etb); } (*Py_TYPE(o)->tp_free)(o); } static PyObject *__pyx_getprop_5liblo_7Address_url(PyObject *o, void *x) { return __pyx_pf_5liblo_7Address_3url_0__get__(o); } static PyObject *__pyx_getprop_5liblo_7Address_hostname(PyObject *o, void *x) { return __pyx_pf_5liblo_7Address_8hostname_0__get__(o); } static PyObject *__pyx_getprop_5liblo_7Address_port(PyObject *o, void *x) { return __pyx_pf_5liblo_7Address_4port_0__get__(o); } static PyObject *__pyx_getprop_5liblo_7Address_protocol(PyObject *o, void *x) { return __pyx_pf_5liblo_7Address_8protocol_0__get__(o); } static PyMethodDef __pyx_methods_5liblo_Address[] = { {__Pyx_NAMESTR("get_url"), (PyCFunction)__pyx_pf_5liblo_7Address_2get_url, METH_NOARGS, __Pyx_DOCSTR(0)}, {__Pyx_NAMESTR("get_hostname"), (PyCFunction)__pyx_pf_5liblo_7Address_3get_hostname, METH_NOARGS, __Pyx_DOCSTR(0)}, {__Pyx_NAMESTR("get_port"), (PyCFunction)__pyx_pf_5liblo_7Address_4get_port, METH_NOARGS, __Pyx_DOCSTR(0)}, {__Pyx_NAMESTR("get_protocol"), (PyCFunction)__pyx_pf_5liblo_7Address_5get_protocol, METH_NOARGS, __Pyx_DOCSTR(0)}, {0, 0, 0, 0} }; static struct PyGetSetDef __pyx_getsets_5liblo_Address[] = { {(char *)"url", __pyx_getprop_5liblo_7Address_url, 0, __Pyx_DOCSTR(__pyx_k_26), 0}, {(char *)"hostname", __pyx_getprop_5liblo_7Address_hostname, 0, __Pyx_DOCSTR(__pyx_k_27), 0}, {(char *)"port", __pyx_getprop_5liblo_7Address_port, 0, __Pyx_DOCSTR(__pyx_k_28), 0}, {(char *)"protocol", __pyx_getprop_5liblo_7Address_protocol, 0, __Pyx_DOCSTR(__pyx_k_29), 0}, {0, 0, 0, 0, 0} }; static PyNumberMethods __pyx_tp_as_number_Address = { 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ #if PY_MAJOR_VERSION < 3 0, /*nb_divide*/ #endif 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ 0, /*nb_negative*/ 0, /*nb_positive*/ 0, /*nb_absolute*/ 0, /*nb_nonzero*/ 0, /*nb_invert*/ 0, /*nb_lshift*/ 0, /*nb_rshift*/ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ #if PY_MAJOR_VERSION < 3 0, /*nb_coerce*/ #endif 0, /*nb_int*/ #if PY_MAJOR_VERSION < 3 0, /*nb_long*/ #else 0, /*reserved*/ #endif 0, /*nb_float*/ #if PY_MAJOR_VERSION < 3 0, /*nb_oct*/ #endif #if PY_MAJOR_VERSION < 3 0, /*nb_hex*/ #endif 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ #if PY_MAJOR_VERSION < 3 0, /*nb_inplace_divide*/ #endif 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ 0, /*nb_inplace_rshift*/ 0, /*nb_inplace_and*/ 0, /*nb_inplace_xor*/ 0, /*nb_inplace_or*/ 0, /*nb_floor_divide*/ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ #if PY_VERSION_HEX >= 0x02050000 0, /*nb_index*/ #endif }; static PySequenceMethods __pyx_tp_as_sequence_Address = { 0, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ 0, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ 0, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_Address = { 0, /*mp_length*/ 0, /*mp_subscript*/ 0, /*mp_ass_subscript*/ }; static PyBufferProcs __pyx_tp_as_buffer_Address = { #if PY_MAJOR_VERSION < 3 0, /*bf_getreadbuffer*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getwritebuffer*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getsegcount*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getcharbuffer*/ #endif #if PY_VERSION_HEX >= 0x02060000 0, /*bf_getbuffer*/ #endif #if PY_VERSION_HEX >= 0x02060000 0, /*bf_releasebuffer*/ #endif }; PyTypeObject __pyx_type_5liblo_Address = { PyVarObject_HEAD_INIT(0, 0) __Pyx_NAMESTR("liblo.Address"), /*tp_name*/ sizeof(struct __pyx_obj_5liblo_Address), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_5liblo_Address, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #else 0, /*reserved*/ #endif 0, /*tp_repr*/ &__pyx_tp_as_number_Address, /*tp_as_number*/ &__pyx_tp_as_sequence_Address, /*tp_as_sequence*/ &__pyx_tp_as_mapping_Address, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_Address, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ __Pyx_DOCSTR("\n Address(hostname, port[, proto])\n Address(port)\n Address(url)\n\n Creates a new Address object from the given hostname/port or URL.\n proto can be one of the constants UDP, TCP, UNIX.\n Exceptions: AddressError\n "), /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_5liblo_Address, /*tp_methods*/ 0, /*tp_members*/ __pyx_getsets_5liblo_Address, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_pf_5liblo_7Address_0__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_5liblo_Address, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif }; static struct __pyx_vtabstruct_5liblo_Message __pyx_vtable_5liblo_Message; static PyObject *__pyx_tp_new_5liblo_Message(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_5liblo_Message *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; p = ((struct __pyx_obj_5liblo_Message *)o); p->__pyx_vtab = __pyx_vtabptr_5liblo_Message; p->_path = ((PyObject*)Py_None); Py_INCREF(Py_None); p->_keep_refs = ((PyObject*)Py_None); Py_INCREF(Py_None); return o; } static void __pyx_tp_dealloc_5liblo_Message(PyObject *o) { struct __pyx_obj_5liblo_Message *p = (struct __pyx_obj_5liblo_Message *)o; { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); ++Py_REFCNT(o); __pyx_pf_5liblo_7Message_1__dealloc__(o); if (PyErr_Occurred()) PyErr_WriteUnraisable(o); --Py_REFCNT(o); PyErr_Restore(etype, eval, etb); } Py_XDECREF(((PyObject *)p->_path)); Py_XDECREF(((PyObject *)p->_keep_refs)); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_5liblo_Message(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_5liblo_Message *p = (struct __pyx_obj_5liblo_Message *)o; if (p->_path) { e = (*v)(p->_path, a); if (e) return e; } if (p->_keep_refs) { e = (*v)(p->_keep_refs, a); if (e) return e; } return 0; } static int __pyx_tp_clear_5liblo_Message(PyObject *o) { struct __pyx_obj_5liblo_Message *p = (struct __pyx_obj_5liblo_Message *)o; PyObject* tmp; tmp = ((PyObject*)p->_path); p->_path = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); tmp = ((PyObject*)p->_keep_refs); p->_keep_refs = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyMethodDef __pyx_methods_5liblo_Message[] = { {__Pyx_NAMESTR("add"), (PyCFunction)__pyx_pf_5liblo_7Message_2add, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5liblo_7Message_2add)}, {0, 0, 0, 0} }; static PyNumberMethods __pyx_tp_as_number_Message = { 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ #if PY_MAJOR_VERSION < 3 0, /*nb_divide*/ #endif 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ 0, /*nb_negative*/ 0, /*nb_positive*/ 0, /*nb_absolute*/ 0, /*nb_nonzero*/ 0, /*nb_invert*/ 0, /*nb_lshift*/ 0, /*nb_rshift*/ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ #if PY_MAJOR_VERSION < 3 0, /*nb_coerce*/ #endif 0, /*nb_int*/ #if PY_MAJOR_VERSION < 3 0, /*nb_long*/ #else 0, /*reserved*/ #endif 0, /*nb_float*/ #if PY_MAJOR_VERSION < 3 0, /*nb_oct*/ #endif #if PY_MAJOR_VERSION < 3 0, /*nb_hex*/ #endif 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ #if PY_MAJOR_VERSION < 3 0, /*nb_inplace_divide*/ #endif 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ 0, /*nb_inplace_rshift*/ 0, /*nb_inplace_and*/ 0, /*nb_inplace_xor*/ 0, /*nb_inplace_or*/ 0, /*nb_floor_divide*/ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ #if PY_VERSION_HEX >= 0x02050000 0, /*nb_index*/ #endif }; static PySequenceMethods __pyx_tp_as_sequence_Message = { 0, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ 0, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ 0, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_Message = { 0, /*mp_length*/ 0, /*mp_subscript*/ 0, /*mp_ass_subscript*/ }; static PyBufferProcs __pyx_tp_as_buffer_Message = { #if PY_MAJOR_VERSION < 3 0, /*bf_getreadbuffer*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getwritebuffer*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getsegcount*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getcharbuffer*/ #endif #if PY_VERSION_HEX >= 0x02060000 0, /*bf_getbuffer*/ #endif #if PY_VERSION_HEX >= 0x02060000 0, /*bf_releasebuffer*/ #endif }; PyTypeObject __pyx_type_5liblo_Message = { PyVarObject_HEAD_INIT(0, 0) __Pyx_NAMESTR("liblo.Message"), /*tp_name*/ sizeof(struct __pyx_obj_5liblo_Message), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_5liblo_Message, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #else 0, /*reserved*/ #endif 0, /*tp_repr*/ &__pyx_tp_as_number_Message, /*tp_as_number*/ &__pyx_tp_as_sequence_Message, /*tp_as_sequence*/ &__pyx_tp_as_mapping_Message, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_Message, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ __Pyx_DOCSTR("\n Message(path[, arg, ...])\n\n Creates a new Message object.\n "), /*tp_doc*/ __pyx_tp_traverse_5liblo_Message, /*tp_traverse*/ __pyx_tp_clear_5liblo_Message, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_5liblo_Message, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_pf_5liblo_7Message_0__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_5liblo_Message, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif }; static PyObject *__pyx_tp_new_5liblo_Bundle(PyTypeObject *t, PyObject *a, PyObject *k) { struct __pyx_obj_5liblo_Bundle *p; PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; p = ((struct __pyx_obj_5liblo_Bundle *)o); p->_keep_refs = ((PyObject*)Py_None); Py_INCREF(Py_None); return o; } static void __pyx_tp_dealloc_5liblo_Bundle(PyObject *o) { struct __pyx_obj_5liblo_Bundle *p = (struct __pyx_obj_5liblo_Bundle *)o; { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); ++Py_REFCNT(o); __pyx_pf_5liblo_6Bundle_1__dealloc__(o); if (PyErr_Occurred()) PyErr_WriteUnraisable(o); --Py_REFCNT(o); PyErr_Restore(etype, eval, etb); } Py_XDECREF(((PyObject *)p->_keep_refs)); (*Py_TYPE(o)->tp_free)(o); } static int __pyx_tp_traverse_5liblo_Bundle(PyObject *o, visitproc v, void *a) { int e; struct __pyx_obj_5liblo_Bundle *p = (struct __pyx_obj_5liblo_Bundle *)o; if (p->_keep_refs) { e = (*v)(p->_keep_refs, a); if (e) return e; } return 0; } static int __pyx_tp_clear_5liblo_Bundle(PyObject *o) { struct __pyx_obj_5liblo_Bundle *p = (struct __pyx_obj_5liblo_Bundle *)o; PyObject* tmp; tmp = ((PyObject*)p->_keep_refs); p->_keep_refs = ((PyObject*)Py_None); Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } static PyMethodDef __pyx_methods_5liblo_Bundle[] = { {__Pyx_NAMESTR("add"), (PyCFunction)__pyx_pf_5liblo_6Bundle_2add, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5liblo_6Bundle_2add)}, {0, 0, 0, 0} }; static PyNumberMethods __pyx_tp_as_number_Bundle = { 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ #if PY_MAJOR_VERSION < 3 0, /*nb_divide*/ #endif 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ 0, /*nb_negative*/ 0, /*nb_positive*/ 0, /*nb_absolute*/ 0, /*nb_nonzero*/ 0, /*nb_invert*/ 0, /*nb_lshift*/ 0, /*nb_rshift*/ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ #if PY_MAJOR_VERSION < 3 0, /*nb_coerce*/ #endif 0, /*nb_int*/ #if PY_MAJOR_VERSION < 3 0, /*nb_long*/ #else 0, /*reserved*/ #endif 0, /*nb_float*/ #if PY_MAJOR_VERSION < 3 0, /*nb_oct*/ #endif #if PY_MAJOR_VERSION < 3 0, /*nb_hex*/ #endif 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ #if PY_MAJOR_VERSION < 3 0, /*nb_inplace_divide*/ #endif 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ 0, /*nb_inplace_rshift*/ 0, /*nb_inplace_and*/ 0, /*nb_inplace_xor*/ 0, /*nb_inplace_or*/ 0, /*nb_floor_divide*/ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ #if PY_VERSION_HEX >= 0x02050000 0, /*nb_index*/ #endif }; static PySequenceMethods __pyx_tp_as_sequence_Bundle = { 0, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ 0, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ 0, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_Bundle = { 0, /*mp_length*/ 0, /*mp_subscript*/ 0, /*mp_ass_subscript*/ }; static PyBufferProcs __pyx_tp_as_buffer_Bundle = { #if PY_MAJOR_VERSION < 3 0, /*bf_getreadbuffer*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getwritebuffer*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getsegcount*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getcharbuffer*/ #endif #if PY_VERSION_HEX >= 0x02060000 0, /*bf_getbuffer*/ #endif #if PY_VERSION_HEX >= 0x02060000 0, /*bf_releasebuffer*/ #endif }; PyTypeObject __pyx_type_5liblo_Bundle = { PyVarObject_HEAD_INIT(0, 0) __Pyx_NAMESTR("liblo.Bundle"), /*tp_name*/ sizeof(struct __pyx_obj_5liblo_Bundle), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_5liblo_Bundle, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #else 0, /*reserved*/ #endif 0, /*tp_repr*/ &__pyx_tp_as_number_Bundle, /*tp_as_number*/ &__pyx_tp_as_sequence_Bundle, /*tp_as_sequence*/ &__pyx_tp_as_mapping_Bundle, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_Bundle, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ __Pyx_DOCSTR("\n Bundle([timetag, ][message, ...])\n\n Creates a new Bundle object. You can optionally specify a time at which the\n messages should be dispatched (as an OSC timetag float), and any number of\n messages to be included in the bundle.\n "), /*tp_doc*/ __pyx_tp_traverse_5liblo_Bundle, /*tp_traverse*/ __pyx_tp_clear_5liblo_Bundle, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_5liblo_Bundle, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_pf_5liblo_6Bundle_0__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_5liblo_Bundle, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif }; static PyObject *__pyx_tp_new_5liblo_Server(PyTypeObject *t, PyObject *a, PyObject *k) { PyObject *o = __pyx_tp_new_5liblo__ServerBase(t, a, k); if (!o) return 0; return o; } static void __pyx_tp_dealloc_5liblo_Server(PyObject *o) { { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); ++Py_REFCNT(o); __pyx_pf_5liblo_6Server_1__dealloc__(o); if (PyErr_Occurred()) PyErr_WriteUnraisable(o); --Py_REFCNT(o); PyErr_Restore(etype, eval, etb); } __pyx_tp_dealloc_5liblo__ServerBase(o); } static PyMethodDef __pyx_methods_5liblo_Server[] = { {__Pyx_NAMESTR("free"), (PyCFunction)__pyx_pf_5liblo_6Server_2free, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5liblo_6Server_2free)}, {__Pyx_NAMESTR("recv"), (PyCFunction)__pyx_pf_5liblo_6Server_3recv, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5liblo_6Server_3recv)}, {0, 0, 0, 0} }; static PyNumberMethods __pyx_tp_as_number_Server = { 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ #if PY_MAJOR_VERSION < 3 0, /*nb_divide*/ #endif 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ 0, /*nb_negative*/ 0, /*nb_positive*/ 0, /*nb_absolute*/ 0, /*nb_nonzero*/ 0, /*nb_invert*/ 0, /*nb_lshift*/ 0, /*nb_rshift*/ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ #if PY_MAJOR_VERSION < 3 0, /*nb_coerce*/ #endif 0, /*nb_int*/ #if PY_MAJOR_VERSION < 3 0, /*nb_long*/ #else 0, /*reserved*/ #endif 0, /*nb_float*/ #if PY_MAJOR_VERSION < 3 0, /*nb_oct*/ #endif #if PY_MAJOR_VERSION < 3 0, /*nb_hex*/ #endif 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ #if PY_MAJOR_VERSION < 3 0, /*nb_inplace_divide*/ #endif 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ 0, /*nb_inplace_rshift*/ 0, /*nb_inplace_and*/ 0, /*nb_inplace_xor*/ 0, /*nb_inplace_or*/ 0, /*nb_floor_divide*/ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ #if PY_VERSION_HEX >= 0x02050000 0, /*nb_index*/ #endif }; static PySequenceMethods __pyx_tp_as_sequence_Server = { 0, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ 0, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ 0, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_Server = { 0, /*mp_length*/ 0, /*mp_subscript*/ 0, /*mp_ass_subscript*/ }; static PyBufferProcs __pyx_tp_as_buffer_Server = { #if PY_MAJOR_VERSION < 3 0, /*bf_getreadbuffer*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getwritebuffer*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getsegcount*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getcharbuffer*/ #endif #if PY_VERSION_HEX >= 0x02060000 0, /*bf_getbuffer*/ #endif #if PY_VERSION_HEX >= 0x02060000 0, /*bf_releasebuffer*/ #endif }; PyTypeObject __pyx_type_5liblo_Server = { PyVarObject_HEAD_INIT(0, 0) __Pyx_NAMESTR("liblo.Server"), /*tp_name*/ sizeof(struct __pyx_obj_5liblo_Server), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_5liblo_Server, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #else 0, /*reserved*/ #endif 0, /*tp_repr*/ &__pyx_tp_as_number_Server, /*tp_as_number*/ &__pyx_tp_as_sequence_Server, /*tp_as_sequence*/ &__pyx_tp_as_mapping_Server, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_Server, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ __Pyx_DOCSTR("\n Server([port[, proto[, **kwargs]]])\n\n Creates a new Server object, which can receive OSC messages. port may be a\n decimal port number or a UNIX socket path. If omitted, an arbitrary free\n UDP port will be used. proto can be one of the constants UDP, TCP, UNIX.\n Optional keyword arguments:\n reg_methods: False if you don't want the init function to automatically\n register callbacks defined with the @make_method decorator.\n Exceptions: ServerError\n "), /*tp_doc*/ __pyx_tp_traverse_5liblo__ServerBase, /*tp_traverse*/ __pyx_tp_clear_5liblo__ServerBase, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_5liblo_Server, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_pf_5liblo_6Server_0__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_5liblo_Server, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif }; static PyObject *__pyx_tp_new_5liblo_ServerThread(PyTypeObject *t, PyObject *a, PyObject *k) { PyObject *o = __pyx_tp_new_5liblo__ServerBase(t, a, k); if (!o) return 0; return o; } static void __pyx_tp_dealloc_5liblo_ServerThread(PyObject *o) { { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); ++Py_REFCNT(o); __pyx_pf_5liblo_12ServerThread_1__dealloc__(o); if (PyErr_Occurred()) PyErr_WriteUnraisable(o); --Py_REFCNT(o); PyErr_Restore(etype, eval, etb); } __pyx_tp_dealloc_5liblo__ServerBase(o); } static PyMethodDef __pyx_methods_5liblo_ServerThread[] = { {__Pyx_NAMESTR("free"), (PyCFunction)__pyx_pf_5liblo_12ServerThread_2free, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5liblo_12ServerThread_2free)}, {__Pyx_NAMESTR("start"), (PyCFunction)__pyx_pf_5liblo_12ServerThread_3start, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5liblo_12ServerThread_3start)}, {__Pyx_NAMESTR("stop"), (PyCFunction)__pyx_pf_5liblo_12ServerThread_4stop, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5liblo_12ServerThread_4stop)}, {0, 0, 0, 0} }; static PyNumberMethods __pyx_tp_as_number_ServerThread = { 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ #if PY_MAJOR_VERSION < 3 0, /*nb_divide*/ #endif 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ 0, /*nb_negative*/ 0, /*nb_positive*/ 0, /*nb_absolute*/ 0, /*nb_nonzero*/ 0, /*nb_invert*/ 0, /*nb_lshift*/ 0, /*nb_rshift*/ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ #if PY_MAJOR_VERSION < 3 0, /*nb_coerce*/ #endif 0, /*nb_int*/ #if PY_MAJOR_VERSION < 3 0, /*nb_long*/ #else 0, /*reserved*/ #endif 0, /*nb_float*/ #if PY_MAJOR_VERSION < 3 0, /*nb_oct*/ #endif #if PY_MAJOR_VERSION < 3 0, /*nb_hex*/ #endif 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ #if PY_MAJOR_VERSION < 3 0, /*nb_inplace_divide*/ #endif 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ 0, /*nb_inplace_rshift*/ 0, /*nb_inplace_and*/ 0, /*nb_inplace_xor*/ 0, /*nb_inplace_or*/ 0, /*nb_floor_divide*/ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ #if PY_VERSION_HEX >= 0x02050000 0, /*nb_index*/ #endif }; static PySequenceMethods __pyx_tp_as_sequence_ServerThread = { 0, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ 0, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ 0, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping_ServerThread = { 0, /*mp_length*/ 0, /*mp_subscript*/ 0, /*mp_ass_subscript*/ }; static PyBufferProcs __pyx_tp_as_buffer_ServerThread = { #if PY_MAJOR_VERSION < 3 0, /*bf_getreadbuffer*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getwritebuffer*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getsegcount*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getcharbuffer*/ #endif #if PY_VERSION_HEX >= 0x02060000 0, /*bf_getbuffer*/ #endif #if PY_VERSION_HEX >= 0x02060000 0, /*bf_releasebuffer*/ #endif }; PyTypeObject __pyx_type_5liblo_ServerThread = { PyVarObject_HEAD_INIT(0, 0) __Pyx_NAMESTR("liblo.ServerThread"), /*tp_name*/ sizeof(struct __pyx_obj_5liblo_ServerThread), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_5liblo_ServerThread, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #else 0, /*reserved*/ #endif 0, /*tp_repr*/ &__pyx_tp_as_number_ServerThread, /*tp_as_number*/ &__pyx_tp_as_sequence_ServerThread, /*tp_as_sequence*/ &__pyx_tp_as_mapping_ServerThread, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_ServerThread, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ __Pyx_DOCSTR("\n ServerThread([port[, proto[, **kwargs]]])\n\n Creates a new ServerThread object, which can receive OSC messages. Unlike\n Server, ServerThread uses its own thread which runs in the background to\n dispatch messages. Note that callback methods will not be run in the main\n Python thread!\n port may be a decimal port number or a UNIX socket path. If omitted, an\n arbitrary free UDP port will be used. proto can be one of the constants\n UDP, TCP, UNIX.\n Optional keyword arguments:\n reg_methods: False if you don't want the init function to automatically\n register callbacks defined with the @make_method decorator.\n Exceptions: ServerError\n "), /*tp_doc*/ __pyx_tp_traverse_5liblo__ServerBase, /*tp_traverse*/ __pyx_tp_clear_5liblo__ServerBase, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_5liblo_ServerThread, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_pf_5liblo_12ServerThread_0__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_5liblo_ServerThread, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif }; static PyObject *__pyx_tp_new_5liblo__Blob(PyTypeObject *t, PyObject *a, PyObject *k) { PyObject *o = (*t->tp_alloc)(t, 0); if (!o) return 0; return o; } static void __pyx_tp_dealloc_5liblo__Blob(PyObject *o) { { PyObject *etype, *eval, *etb; PyErr_Fetch(&etype, &eval, &etb); ++Py_REFCNT(o); __pyx_pf_5liblo_5_Blob_1__dealloc__(o); if (PyErr_Occurred()) PyErr_WriteUnraisable(o); --Py_REFCNT(o); PyErr_Restore(etype, eval, etb); } (*Py_TYPE(o)->tp_free)(o); } static PyMethodDef __pyx_methods_5liblo__Blob[] = { {0, 0, 0, 0} }; static PyNumberMethods __pyx_tp_as_number__Blob = { 0, /*nb_add*/ 0, /*nb_subtract*/ 0, /*nb_multiply*/ #if PY_MAJOR_VERSION < 3 0, /*nb_divide*/ #endif 0, /*nb_remainder*/ 0, /*nb_divmod*/ 0, /*nb_power*/ 0, /*nb_negative*/ 0, /*nb_positive*/ 0, /*nb_absolute*/ 0, /*nb_nonzero*/ 0, /*nb_invert*/ 0, /*nb_lshift*/ 0, /*nb_rshift*/ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ #if PY_MAJOR_VERSION < 3 0, /*nb_coerce*/ #endif 0, /*nb_int*/ #if PY_MAJOR_VERSION < 3 0, /*nb_long*/ #else 0, /*reserved*/ #endif 0, /*nb_float*/ #if PY_MAJOR_VERSION < 3 0, /*nb_oct*/ #endif #if PY_MAJOR_VERSION < 3 0, /*nb_hex*/ #endif 0, /*nb_inplace_add*/ 0, /*nb_inplace_subtract*/ 0, /*nb_inplace_multiply*/ #if PY_MAJOR_VERSION < 3 0, /*nb_inplace_divide*/ #endif 0, /*nb_inplace_remainder*/ 0, /*nb_inplace_power*/ 0, /*nb_inplace_lshift*/ 0, /*nb_inplace_rshift*/ 0, /*nb_inplace_and*/ 0, /*nb_inplace_xor*/ 0, /*nb_inplace_or*/ 0, /*nb_floor_divide*/ 0, /*nb_true_divide*/ 0, /*nb_inplace_floor_divide*/ 0, /*nb_inplace_true_divide*/ #if PY_VERSION_HEX >= 0x02050000 0, /*nb_index*/ #endif }; static PySequenceMethods __pyx_tp_as_sequence__Blob = { 0, /*sq_length*/ 0, /*sq_concat*/ 0, /*sq_repeat*/ 0, /*sq_item*/ 0, /*sq_slice*/ 0, /*sq_ass_item*/ 0, /*sq_ass_slice*/ 0, /*sq_contains*/ 0, /*sq_inplace_concat*/ 0, /*sq_inplace_repeat*/ }; static PyMappingMethods __pyx_tp_as_mapping__Blob = { 0, /*mp_length*/ 0, /*mp_subscript*/ 0, /*mp_ass_subscript*/ }; static PyBufferProcs __pyx_tp_as_buffer__Blob = { #if PY_MAJOR_VERSION < 3 0, /*bf_getreadbuffer*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getwritebuffer*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getsegcount*/ #endif #if PY_MAJOR_VERSION < 3 0, /*bf_getcharbuffer*/ #endif #if PY_VERSION_HEX >= 0x02060000 0, /*bf_getbuffer*/ #endif #if PY_VERSION_HEX >= 0x02060000 0, /*bf_releasebuffer*/ #endif }; PyTypeObject __pyx_type_5liblo__Blob = { PyVarObject_HEAD_INIT(0, 0) __Pyx_NAMESTR("liblo._Blob"), /*tp_name*/ sizeof(struct __pyx_obj_5liblo__Blob), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_5liblo__Blob, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ #if PY_MAJOR_VERSION < 3 0, /*tp_compare*/ #else 0, /*reserved*/ #endif 0, /*tp_repr*/ &__pyx_tp_as_number__Blob, /*tp_as_number*/ &__pyx_tp_as_sequence__Blob, /*tp_as_sequence*/ &__pyx_tp_as_mapping__Blob, /*tp_as_mapping*/ 0, /*tp_hash*/ 0, /*tp_call*/ 0, /*tp_str*/ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer__Blob, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/ 0, /*tp_doc*/ 0, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ __pyx_methods_5liblo__Blob, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ 0, /*tp_dict*/ 0, /*tp_descr_get*/ 0, /*tp_descr_set*/ 0, /*tp_dictoffset*/ __pyx_pf_5liblo_5_Blob_0__init__, /*tp_init*/ 0, /*tp_alloc*/ __pyx_tp_new_5liblo__Blob, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ 0, /*tp_mro*/ 0, /*tp_cache*/ 0, /*tp_subclasses*/ 0, /*tp_weaklist*/ 0, /*tp_del*/ #if PY_VERSION_HEX >= 0x02060000 0, /*tp_version_tag*/ #endif }; static PyMethodDef __pyx_methods[] = { {0, 0, 0, 0} }; #if PY_MAJOR_VERSION >= 3 static struct PyModuleDef __pyx_moduledef = { PyModuleDef_HEAD_INIT, __Pyx_NAMESTR("liblo"), 0, /* m_doc */ -1, /* m_size */ __pyx_methods /* m_methods */, NULL, /* m_reload */ NULL, /* m_traverse */ NULL, /* m_clear */ NULL /* m_free */ }; #endif static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0}, {&__pyx_kp_s_11, __pyx_k_11, sizeof(__pyx_k_11), 0, 0, 1, 0}, {&__pyx_kp_s_13, __pyx_k_13, sizeof(__pyx_k_13), 0, 0, 1, 0}, {&__pyx_kp_s_15, __pyx_k_15, sizeof(__pyx_k_15), 0, 0, 1, 0}, {&__pyx_kp_s_16, __pyx_k_16, sizeof(__pyx_k_16), 0, 0, 1, 0}, {&__pyx_kp_s_18, __pyx_k_18, sizeof(__pyx_k_18), 0, 0, 1, 0}, {&__pyx_kp_s_19, __pyx_k_19, sizeof(__pyx_k_19), 0, 0, 1, 0}, {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0}, {&__pyx_kp_s_21, __pyx_k_21, sizeof(__pyx_k_21), 0, 0, 1, 0}, {&__pyx_kp_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 0}, {&__pyx_kp_s_30, __pyx_k_30, sizeof(__pyx_k_30), 0, 0, 1, 0}, {&__pyx_kp_s_31, __pyx_k_31, sizeof(__pyx_k_31), 0, 0, 1, 0}, {&__pyx_kp_s_32, __pyx_k_32, sizeof(__pyx_k_32), 0, 0, 1, 0}, {&__pyx_kp_s_33, __pyx_k_33, sizeof(__pyx_k_33), 0, 0, 1, 0}, {&__pyx_kp_s_34, __pyx_k_34, sizeof(__pyx_k_34), 0, 0, 1, 0}, {&__pyx_kp_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 0}, {&__pyx_kp_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 0}, {&__pyx_kp_s_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 0, 1, 0}, {&__pyx_n_s__AddressError, __pyx_k__AddressError, sizeof(__pyx_k__AddressError), 0, 0, 1, 1}, {&__pyx_n_s__Exception, __pyx_k__Exception, sizeof(__pyx_k__Exception), 0, 0, 1, 1}, {&__pyx_n_s__IOError, __pyx_k__IOError, sizeof(__pyx_k__IOError), 0, 0, 1, 1}, {&__pyx_n_s__ServerError, __pyx_k__ServerError, sizeof(__pyx_k__ServerError), 0, 0, 1, 1}, {&__pyx_n_s__TCP, __pyx_k__TCP, sizeof(__pyx_k__TCP), 0, 0, 1, 1}, {&__pyx_n_s__TypeError, __pyx_k__TypeError, sizeof(__pyx_k__TypeError), 0, 0, 1, 1}, {&__pyx_n_s__UDP, __pyx_k__UDP, sizeof(__pyx_k__UDP), 0, 0, 1, 1}, {&__pyx_n_s__UNIX, __pyx_k__UNIX, sizeof(__pyx_k__UNIX), 0, 0, 1, 1}, {&__pyx_n_s__ValueError, __pyx_k__ValueError, sizeof(__pyx_k__ValueError), 0, 0, 1, 1}, {&__pyx_n_s____call__, __pyx_k____call__, sizeof(__pyx_k____call__), 0, 0, 1, 1}, {&__pyx_n_s____class__, __pyx_k____class__, sizeof(__pyx_k____class__), 0, 0, 1, 1}, {&__pyx_n_s____exception, __pyx_k____exception, sizeof(__pyx_k____exception), 0, 0, 1, 1}, {&__pyx_n_s____func__, __pyx_k____func__, sizeof(__pyx_k____func__), 0, 0, 1, 1}, {&__pyx_n_s____get__, __pyx_k____get__, sizeof(__pyx_k____get__), 0, 0, 1, 1}, {&__pyx_n_s____init__, __pyx_k____init__, sizeof(__pyx_k____init__), 0, 0, 1, 1}, {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1}, {&__pyx_n_s____self__, __pyx_k____self__, sizeof(__pyx_k____self__), 0, 0, 1, 1}, {&__pyx_n_s____str__, __pyx_k____str__, sizeof(__pyx_k____str__), 0, 0, 1, 1}, {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1}, {&__pyx_n_s____version__, __pyx_k____version__, sizeof(__pyx_k____version__), 0, 0, 1, 1}, {&__pyx_n_s___add, __pyx_k___add, sizeof(__pyx_k___add), 0, 0, 1, 1}, {&__pyx_n_s___add_auto, __pyx_k___add_auto, sizeof(__pyx_k___add_auto), 0, 0, 1, 1}, {&__pyx_n_s___address, __pyx_k___address, sizeof(__pyx_k___address), 0, 0, 1, 1}, {&__pyx_n_s___blob, __pyx_k___blob, sizeof(__pyx_k___blob), 0, 0, 1, 1}, {&__pyx_n_s___bundle, __pyx_k___bundle, sizeof(__pyx_k___bundle), 0, 0, 1, 1}, {&__pyx_n_s___counter, __pyx_k___counter, sizeof(__pyx_k___counter), 0, 0, 1, 1}, {&__pyx_n_s___inspect, __pyx_k___inspect, sizeof(__pyx_k___inspect), 0, 0, 1, 1}, {&__pyx_n_s___keep_refs, __pyx_k___keep_refs, sizeof(__pyx_k___keep_refs), 0, 0, 1, 1}, {&__pyx_n_s___message, __pyx_k___message, sizeof(__pyx_k___message), 0, 0, 1, 1}, {&__pyx_n_s___method_spec, __pyx_k___method_spec, sizeof(__pyx_k___method_spec), 0, 0, 1, 1}, {&__pyx_n_s___path, __pyx_k___path, sizeof(__pyx_k___path), 0, 0, 1, 1}, {&__pyx_n_s___server, __pyx_k___server, sizeof(__pyx_k___server), 0, 0, 1, 1}, {&__pyx_n_s___server_thread, __pyx_k___server_thread, sizeof(__pyx_k___server_thread), 0, 0, 1, 1}, {&__pyx_n_s___weakref, __pyx_k___weakref, sizeof(__pyx_k___weakref), 0, 0, 1, 1}, {&__pyx_n_s___weakref_method, __pyx_k___weakref_method, sizeof(__pyx_k___weakref_method), 0, 0, 1, 1}, {&__pyx_n_s__add, __pyx_k__add, sizeof(__pyx_k__add), 0, 0, 1, 1}, {&__pyx_n_s__add_method, __pyx_k__add_method, sizeof(__pyx_k__add_method), 0, 0, 1, 1}, {&__pyx_n_s__addr, __pyx_k__addr, sizeof(__pyx_k__addr), 0, 0, 1, 1}, {&__pyx_n_s__addr2, __pyx_k__addr2, sizeof(__pyx_k__addr2), 0, 0, 1, 1}, {&__pyx_n_s__append, __pyx_k__append, sizeof(__pyx_k__append), 0, 0, 1, 1}, {&__pyx_n_s__arr, __pyx_k__arr, sizeof(__pyx_k__arr), 0, 0, 1, 1}, {&__pyx_n_s__b, __pyx_k__b, sizeof(__pyx_k__b), 0, 0, 1, 1}, {&__pyx_n_s__c, __pyx_k__c, sizeof(__pyx_k__c), 0, 0, 1, 1}, {&__pyx_n_s__chr, __pyx_k__chr, sizeof(__pyx_k__chr), 0, 0, 1, 1}, {&__pyx_n_s__counter, __pyx_k__counter, sizeof(__pyx_k__counter), 0, 0, 1, 1}, {&__pyx_n_s__d, __pyx_k__d, sizeof(__pyx_k__d), 0, 0, 1, 1}, {&__pyx_n_s__decode, __pyx_k__decode, sizeof(__pyx_k__decode), 0, 0, 1, 1}, {&__pyx_n_s__encode, __pyx_k__encode, sizeof(__pyx_k__encode), 0, 0, 1, 1}, {&__pyx_n_s__f, __pyx_k__f, sizeof(__pyx_k__f), 0, 0, 1, 1}, {&__pyx_n_s__frac, __pyx_k__frac, sizeof(__pyx_k__frac), 0, 0, 1, 1}, {&__pyx_n_s__free, __pyx_k__free, sizeof(__pyx_k__free), 0, 0, 1, 1}, {&__pyx_n_s__func, __pyx_k__func, sizeof(__pyx_k__func), 0, 0, 1, 1}, {&__pyx_n_s__get_hostname, __pyx_k__get_hostname, sizeof(__pyx_k__get_hostname), 0, 0, 1, 1}, {&__pyx_n_s__get_port, __pyx_k__get_port, sizeof(__pyx_k__get_port), 0, 0, 1, 1}, {&__pyx_n_s__get_protocol, __pyx_k__get_protocol, sizeof(__pyx_k__get_protocol), 0, 0, 1, 1}, {&__pyx_n_s__get_url, __pyx_k__get_url, sizeof(__pyx_k__get_url), 0, 0, 1, 1}, {&__pyx_n_s__getargspec, __pyx_k__getargspec, sizeof(__pyx_k__getargspec), 0, 0, 1, 1}, {&__pyx_n_s__getmembers, __pyx_k__getmembers, sizeof(__pyx_k__getmembers), 0, 0, 1, 1}, {&__pyx_n_s__h, __pyx_k__h, sizeof(__pyx_k__h), 0, 0, 1, 1}, {&__pyx_n_s__i, __pyx_k__i, sizeof(__pyx_k__i), 0, 0, 1, 1}, {&__pyx_n_s__im_func, __pyx_k__im_func, sizeof(__pyx_k__im_func), 0, 0, 1, 1}, {&__pyx_n_s__im_self, __pyx_k__im_self, sizeof(__pyx_k__im_self), 0, 0, 1, 1}, {&__pyx_n_s__inf, __pyx_k__inf, sizeof(__pyx_k__inf), 0, 0, 1, 1}, {&__pyx_n_s__inspect, __pyx_k__inspect, sizeof(__pyx_k__inspect), 0, 0, 1, 1}, {&__pyx_n_s__isdigit, __pyx_k__isdigit, sizeof(__pyx_k__isdigit), 0, 0, 1, 1}, {&__pyx_n_s__ismethod, __pyx_k__ismethod, sizeof(__pyx_k__ismethod), 0, 0, 1, 1}, {&__pyx_n_s__items, __pyx_k__items, sizeof(__pyx_k__items), 0, 0, 1, 1}, {&__pyx_n_s__key, __pyx_k__key, sizeof(__pyx_k__key), 0, 0, 1, 1}, {&__pyx_n_s__liblo, __pyx_k__liblo, sizeof(__pyx_k__liblo), 0, 0, 1, 1}, {&__pyx_n_s__m, __pyx_k__m, sizeof(__pyx_k__m), 0, 0, 1, 1}, {&__pyx_n_s__make_method, __pyx_k__make_method, sizeof(__pyx_k__make_method), 0, 0, 1, 1}, {&__pyx_n_s__msg, __pyx_k__msg, sizeof(__pyx_k__msg), 0, 0, 1, 1}, {&__pyx_n_s__name, __pyx_k__name, sizeof(__pyx_k__name), 0, 0, 1, 1}, {&__pyx_n_s__num, __pyx_k__num, sizeof(__pyx_k__num), 0, 0, 1, 1}, {&__pyx_n_s__obj, __pyx_k__obj, sizeof(__pyx_k__obj), 0, 0, 1, 1}, {&__pyx_n_s__ord, __pyx_k__ord, sizeof(__pyx_k__ord), 0, 0, 1, 1}, {&__pyx_n_s__path, __pyx_k__path, sizeof(__pyx_k__path), 0, 0, 1, 1}, {&__pyx_n_s__port, __pyx_k__port, sizeof(__pyx_k__port), 0, 0, 1, 1}, {&__pyx_n_s__proto, __pyx_k__proto, sizeof(__pyx_k__proto), 0, 0, 1, 1}, {&__pyx_n_s__ref, __pyx_k__ref, sizeof(__pyx_k__ref), 0, 0, 1, 1}, {&__pyx_n_s__reg_methods, __pyx_k__reg_methods, sizeof(__pyx_k__reg_methods), 0, 0, 1, 1}, {&__pyx_n_s__register_methods, __pyx_k__register_methods, sizeof(__pyx_k__register_methods), 0, 0, 1, 1}, {&__pyx_n_s__s, __pyx_k__s, sizeof(__pyx_k__s), 0, 0, 1, 1}, {&__pyx_n_s__sec, __pyx_k__sec, sizeof(__pyx_k__sec), 0, 0, 1, 1}, {&__pyx_n_s__self, __pyx_k__self, sizeof(__pyx_k__self), 0, 0, 1, 1}, {&__pyx_n_s__send, __pyx_k__send, sizeof(__pyx_k__send), 0, 0, 1, 1}, {&__pyx_n_s__sort, __pyx_k__sort, sizeof(__pyx_k__sort), 0, 0, 1, 1}, {&__pyx_n_s__spec, __pyx_k__spec, sizeof(__pyx_k__spec), 0, 0, 1, 1}, {&__pyx_n_s__struct, __pyx_k__struct, sizeof(__pyx_k__struct), 0, 0, 1, 1}, {&__pyx_n_s__t, __pyx_k__t, sizeof(__pyx_k__t), 0, 0, 1, 1}, {&__pyx_n_s__target, __pyx_k__target, sizeof(__pyx_k__target), 0, 0, 1, 1}, {&__pyx_n_s__time, __pyx_k__time, sizeof(__pyx_k__time), 0, 0, 1, 1}, {&__pyx_n_s__timeout, __pyx_k__timeout, sizeof(__pyx_k__timeout), 0, 0, 1, 1}, {&__pyx_n_s__types, __pyx_k__types, sizeof(__pyx_k__types), 0, 0, 1, 1}, {&__pyx_n_s__typespec, __pyx_k__typespec, sizeof(__pyx_k__typespec), 0, 0, 1, 1}, {&__pyx_n_s__user_data, __pyx_k__user_data, sizeof(__pyx_k__user_data), 0, 0, 1, 1}, {&__pyx_n_s__weakref, __pyx_k__weakref, sizeof(__pyx_k__weakref), 0, 0, 1, 1}, {&__pyx_n_s__where, __pyx_k__where, sizeof(__pyx_k__where), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; static int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_Exception = __Pyx_GetName(__pyx_b, __pyx_n_s__Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_IOError = __Pyx_GetName(__pyx_b, __pyx_n_s__IOError); if (!__pyx_builtin_IOError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_chr = __Pyx_GetName(__pyx_b, __pyx_n_s__chr); if (!__pyx_builtin_chr) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_TypeError = __Pyx_GetName(__pyx_b, __pyx_n_s__TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_builtin_ord = __Pyx_GetName(__pyx_b, __pyx_n_s__ord); if (!__pyx_builtin_ord) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; __pyx_clineno = __LINE__; goto __pyx_L1_error;} return 0; __pyx_L1_error:; return -1; } static int __Pyx_InitCachedConstants(void) { __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants"); /* "/home/das/src/pyliblo/src/liblo.pyx":370 * p = NULL * else: * raise TypeError("path must be a string or None") # <<<<<<<<<<<<<< * * if isinstance(typespec, (bytes, unicode)): */ __pyx_k_tuple_6 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_6)); __Pyx_INCREF(((PyObject *)__pyx_kp_s_5)); PyTuple_SET_ITEM(__pyx_k_tuple_6, 0, ((PyObject *)__pyx_kp_s_5)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_6)); /* "/home/das/src/pyliblo/src/liblo.pyx":378 * t = NULL * else: * raise TypeError("typespec must be a string or None") # <<<<<<<<<<<<<< * * # use a weak reference if func is a method, to avoid circular references */ __pyx_k_tuple_8 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_8)); __Pyx_INCREF(((PyObject *)__pyx_kp_s_7)); PyTuple_SET_ITEM(__pyx_k_tuple_8, 0, ((PyObject *)__pyx_kp_s_7)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_7)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_8)); /* "/home/das/src/pyliblo/src/liblo.pyx":594 * self._address = lo_address_new_with_proto(proto, s, s2) * if not self._address: * raise AddressError("invalid protocol") # <<<<<<<<<<<<<< * elif isinstance(addr, int) or (isinstance(addr, str) and addr.isdigit()): * # Address(port) */ __pyx_k_tuple_14 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_14)); __Pyx_INCREF(((PyObject *)__pyx_kp_s_13)); PyTuple_SET_ITEM(__pyx_k_tuple_14, 0, ((PyObject *)__pyx_kp_s_13)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_13)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_14)); /* "/home/das/src/pyliblo/src/liblo.pyx":671 * size = len(arr) * if size < 1: * raise ValueError("blob is empty") # <<<<<<<<<<<<<< * # copy each element of arr to a C array * p = malloc(size) */ __pyx_k_tuple_17 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 671; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_17)); __Pyx_INCREF(((PyObject *)__pyx_kp_s_16)); PyTuple_SET_ITEM(__pyx_k_tuple_17, 0, ((PyObject *)__pyx_kp_s_16)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_16)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_17)); /* "/home/das/src/pyliblo/src/liblo.pyx":798 * iter(value) * except TypeError: * raise TypeError("unsupported message argument type") # <<<<<<<<<<<<<< * self._add('b', value) * */ __pyx_k_tuple_20 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_20)); __Pyx_INCREF(((PyObject *)__pyx_kp_s_19)); PyTuple_SET_ITEM(__pyx_k_tuple_20, 0, ((PyObject *)__pyx_kp_s_19)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_19)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_20)); /* "/home/das/src/pyliblo/src/liblo.pyx":829 * tt.sec, tt.frac = t * else: * raise TypeError("invalid timetag") # <<<<<<<<<<<<<< * # first argument was timetag, so continue with second * messages = messages[1:] */ __pyx_k_tuple_22 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_22)); __Pyx_INCREF(((PyObject *)__pyx_kp_s_21)); PyTuple_SET_ITEM(__pyx_k_tuple_22, 0, ((PyObject *)__pyx_kp_s_21)); __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_21)); __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_22)); __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; __Pyx_RefNannyFinishContext(); return -1; } static int __Pyx_InitGlobals(void) { if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; return 0; __pyx_L1_error:; return -1; } #if PY_MAJOR_VERSION < 3 PyMODINIT_FUNC initliblo(void); /*proto*/ PyMODINIT_FUNC initliblo(void) #else PyMODINIT_FUNC PyInit_liblo(void); /*proto*/ PyMODINIT_FUNC PyInit_liblo(void) #endif { PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; #if CYTHON_REFNANNY void* __pyx_refnanny = NULL; __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); if (!__Pyx_RefNanny) Py_FatalError("failed to import 'refnanny' module"); } __pyx_refnanny = __Pyx_RefNanny->SetupContext("PyMODINIT_FUNC PyInit_liblo(void)", __LINE__, __FILE__); #endif __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #ifdef __pyx_binding_PyCFunctionType_USED if (__pyx_binding_PyCFunctionType_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} #endif /*--- Library function declarations ---*/ /*--- Threads initialization code ---*/ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS #ifdef WITH_THREAD /* Python build with threading support? */ PyEval_InitThreads(); #endif #endif /*--- Module creation code ---*/ #if PY_MAJOR_VERSION < 3 __pyx_m = Py_InitModule4(__Pyx_NAMESTR("liblo"), __pyx_methods, 0, 0, PYTHON_API_VERSION); #else __pyx_m = PyModule_Create(&__pyx_moduledef); #endif if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; #if PY_MAJOR_VERSION < 3 Py_INCREF(__pyx_m); #endif __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; /*--- Initialize various global constants etc. ---*/ if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__pyx_module_is_main_liblo) { if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; } /*--- Builtin init code ---*/ if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Constants init code ---*/ if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Global init code ---*/ /*--- Function export code ---*/ /*--- Type init code ---*/ if (PyType_Ready(&__pyx_type_5liblo__ServerBase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_SetAttrString(__pyx_m, "_ServerBase", (PyObject *)&__pyx_type_5liblo__ServerBase) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_5liblo__ServerBase = &__pyx_type_5liblo__ServerBase; if (PyType_Ready(&__pyx_type_5liblo_Address) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_SetAttrString(__pyx_m, "Address", (PyObject *)&__pyx_type_5liblo_Address) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_5liblo_Address = &__pyx_type_5liblo_Address; __pyx_vtabptr_5liblo_Message = &__pyx_vtable_5liblo_Message; __pyx_vtable_5liblo_Message._add = (PyObject *(*)(struct __pyx_obj_5liblo_Message *, PyObject *, PyObject *))__pyx_f_5liblo_7Message__add; __pyx_vtable_5liblo_Message._add_auto = (PyObject *(*)(struct __pyx_obj_5liblo_Message *, PyObject *))__pyx_f_5liblo_7Message__add_auto; if (PyType_Ready(&__pyx_type_5liblo_Message) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_SetVtable(__pyx_type_5liblo_Message.tp_dict, __pyx_vtabptr_5liblo_Message) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_SetAttrString(__pyx_m, "Message", (PyObject *)&__pyx_type_5liblo_Message) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_5liblo_Message = &__pyx_type_5liblo_Message; if (PyType_Ready(&__pyx_type_5liblo_Bundle) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_SetAttrString(__pyx_m, "Bundle", (PyObject *)&__pyx_type_5liblo_Bundle) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_5liblo_Bundle = &__pyx_type_5liblo_Bundle; __pyx_type_5liblo_Server.tp_base = __pyx_ptype_5liblo__ServerBase; if (PyType_Ready(&__pyx_type_5liblo_Server) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_SetAttrString(__pyx_m, "Server", (PyObject *)&__pyx_type_5liblo_Server) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_5liblo_Server = &__pyx_type_5liblo_Server; __pyx_type_5liblo_ServerThread.tp_base = __pyx_ptype_5liblo__ServerBase; if (PyType_Ready(&__pyx_type_5liblo_ServerThread) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_SetAttrString(__pyx_m, "ServerThread", (PyObject *)&__pyx_type_5liblo_ServerThread) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_5liblo_ServerThread = &__pyx_type_5liblo_ServerThread; if (PyType_Ready(&__pyx_type_5liblo__Blob) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;} if (__Pyx_SetAttrString(__pyx_m, "_Blob", (PyObject *)&__pyx_type_5liblo__Blob) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_5liblo__Blob = &__pyx_type_5liblo__Blob; /*--- Type import code ---*/ __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), 0); if (unlikely(!__pyx_ptype_7cpython_4bool_bool)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), 0); if (unlikely(!__pyx_ptype_7cpython_7complex_complex)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /*--- Function import code ---*/ /*--- Execution code ---*/ /* "/home/das/src/pyliblo/src/liblo.pyx":12 * # * * __version__ = '0.9.1' # <<<<<<<<<<<<<< * * */ if (PyObject_SetAttr(__pyx_m, __pyx_n_s____version__, ((PyObject *)__pyx_kp_s_30)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "/home/das/src/pyliblo/src/liblo.pyx":25 * from liblo cimport * * * import inspect as _inspect # <<<<<<<<<<<<<< * import weakref as _weakref * */ __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__inspect), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyObject_SetAttr(__pyx_m, __pyx_n_s___inspect, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":26 * * import inspect as _inspect * import weakref as _weakref # <<<<<<<<<<<<<< * * */ __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__weakref), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyObject_SetAttr(__pyx_m, __pyx_n_s___weakref, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":29 * * * class _weakref_method: # <<<<<<<<<<<<<< * """ * Weak reference to a bound method. */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); /* "/home/das/src/pyliblo/src/liblo.pyx":33 * Weak reference to a bound method. * """ * def __init__(self, f): # <<<<<<<<<<<<<< * if PY_VERSION_HEX >= 0x03000000: * self.func = f.__func__ */ __pyx_t_2 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_5liblo_15_weakref_method_0__init__, NULL, __pyx_n_s__liblo); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyObject_SetItem(__pyx_t_1, __pyx_n_s____init__, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":40 * self.func = f.im_func * self.obj = _weakref.ref(f.im_self) * def __call__(self): # <<<<<<<<<<<<<< * return self.func.__get__(self.obj(), self.obj().__class__) * */ __pyx_t_2 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_5liblo_15_weakref_method_1__call__, NULL, __pyx_n_s__liblo); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyObject_SetItem(__pyx_t_1, __pyx_n_s____call__, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":29 * * * class _weakref_method: # <<<<<<<<<<<<<< * """ * Weak reference to a bound method. */ if (PyDict_SetItemString(((PyObject *)__pyx_t_1), "__doc__", ((PyObject *)__pyx_kp_s_31)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = __Pyx_CreateClass(((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1), __pyx_n_s___weakref_method, __pyx_n_s__liblo); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyObject_SetAttr(__pyx_m, __pyx_n_s___weakref_method, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":44 * * * class struct: # <<<<<<<<<<<<<< * def __init__(self, **kwargs): * for k, v in kwargs.items(): */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); /* "/home/das/src/pyliblo/src/liblo.pyx":45 * * class struct: * def __init__(self, **kwargs): # <<<<<<<<<<<<<< * for k, v in kwargs.items(): * setattr(self, k, v) */ __pyx_t_2 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_5liblo_6struct_0__init__, NULL, __pyx_n_s__liblo); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyObject_SetItem(__pyx_t_1, __pyx_n_s____init__, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":44 * * * class struct: # <<<<<<<<<<<<<< * def __init__(self, **kwargs): * for k, v in kwargs.items(): */ __pyx_t_2 = __Pyx_CreateClass(((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1), __pyx_n_s__struct, __pyx_n_s__liblo); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyObject_SetAttr(__pyx_m, __pyx_n_s__struct, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":73 * * # liblo protocol constants * UDP = LO_UDP # <<<<<<<<<<<<<< * TCP = LO_TCP * UNIX = LO_UNIX */ __pyx_t_1 = PyInt_FromLong(LO_UDP); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyObject_SetAttr(__pyx_m, __pyx_n_s__UDP, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":74 * # liblo protocol constants * UDP = LO_UDP * TCP = LO_TCP # <<<<<<<<<<<<<< * UNIX = LO_UNIX * */ __pyx_t_1 = PyInt_FromLong(LO_TCP); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyObject_SetAttr(__pyx_m, __pyx_n_s__TCP, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":75 * UDP = LO_UDP * TCP = LO_TCP * UNIX = LO_UNIX # <<<<<<<<<<<<<< * * */ __pyx_t_1 = PyInt_FromLong(LO_UNIX); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyObject_SetAttr(__pyx_m, __pyx_n_s__UNIX, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":93 * return tt.sec + ((tt.frac) / 4294967296.0) * * def time(): # <<<<<<<<<<<<<< * """ * time() */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5liblo_0time, NULL, __pyx_n_s__liblo); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyObject_SetAttr(__pyx_m, __pyx_n_s__time, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":152 * * * def send(target, *args): # <<<<<<<<<<<<<< * """ * send(target, message) */ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5liblo_1send, NULL, __pyx_n_s__liblo); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); if (PyObject_SetAttr(__pyx_m, __pyx_n_s__send, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":170 * ################################################################################ * * class ServerError(Exception): # <<<<<<<<<<<<<< * """ * Exception raised when creating a liblo OSC server fails. */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); /* "/home/das/src/pyliblo/src/liblo.pyx":174 * Exception raised when creating a liblo OSC server fails. * """ * def __init__(self, num, msg, where): # <<<<<<<<<<<<<< * self.num = num * self.msg = msg */ __pyx_t_2 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_5liblo_11ServerError_0__init__, NULL, __pyx_n_s__liblo); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyObject_SetItem(__pyx_t_1, __pyx_n_s____init__, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":178 * self.msg = msg * self.where = where * def __str__(self): # <<<<<<<<<<<<<< * s = "server error %d" % self.num * if self.where: s += " in %s" % self.where */ __pyx_t_2 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_5liblo_11ServerError_1__str__, NULL, __pyx_n_s__liblo); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); if (PyObject_SetItem(__pyx_t_1, __pyx_n_s____str__, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":170 * ################################################################################ * * class ServerError(Exception): # <<<<<<<<<<<<<< * """ * Exception raised when creating a liblo OSC server fails. */ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_2)); __Pyx_INCREF(__pyx_builtin_Exception); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_Exception); __Pyx_GIVEREF(__pyx_builtin_Exception); if (PyDict_SetItemString(((PyObject *)__pyx_t_1), "__doc__", ((PyObject *)__pyx_kp_s_32)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = __Pyx_CreateClass(((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_1), __pyx_n_s__ServerError, __pyx_n_s__liblo); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_s__ServerError, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":268 * # decorator to register callbacks * * class make_method: # <<<<<<<<<<<<<< * """ * @make_method(path, typespec[, user_data]) */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); /* "/home/das/src/pyliblo/src/liblo.pyx":277 * # counter to keep track of the order in which the callback functions where * # defined * _counter = 0 # <<<<<<<<<<<<<< * * def __init__(self, path, types, user_data=None): */ if (PyObject_SetItem(__pyx_t_1, __pyx_n_s___counter, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;} /* "/home/das/src/pyliblo/src/liblo.pyx":279 * _counter = 0 * * def __init__(self, path, types, user_data=None): # <<<<<<<<<<<<<< * self.spec = struct(counter=make_method._counter, * path=path, */ __pyx_t_3 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_5liblo_11make_method_0__init__, NULL, __pyx_n_s__liblo); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyObject_SetItem(__pyx_t_1, __pyx_n_s____init__, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":286 * make_method._counter += 1 * * def __call__(self, f): # <<<<<<<<<<<<<< * # we can't access the Server object here, because at the time the * # decorator is run it doesn't even exist yet, so we store the */ __pyx_t_3 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_5liblo_11make_method_1__call__, NULL, __pyx_n_s__liblo); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyObject_SetItem(__pyx_t_1, __pyx_n_s____call__, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":268 * # decorator to register callbacks * * class make_method: # <<<<<<<<<<<<<< * """ * @make_method(path, typespec[, user_data]) */ if (PyDict_SetItemString(((PyObject *)__pyx_t_1), "__doc__", ((PyObject *)__pyx_kp_s_33)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_3 = __Pyx_CreateClass(((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_1), __pyx_n_s__make_method, __pyx_n_s__liblo); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyObject_SetAttr(__pyx_m, __pyx_n_s__make_method, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":437 * Exceptions: ServerError * """ * def __init__(self, port=None, proto=LO_DEFAULT, **kwargs): # <<<<<<<<<<<<<< * cdef char *cs * */ __pyx_t_1 = PyInt_FromLong(LO_DEFAULT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_k_9 = __pyx_t_1; __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":507 * cdef lo_server_thread _server_thread * * def __init__(self, port=None, proto=LO_DEFAULT, **kwargs): # <<<<<<<<<<<<<< * cdef char *cs * */ __pyx_t_1 = PyInt_FromLong(LO_DEFAULT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_k_10 = __pyx_t_1; __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":565 * ################################################################################ * * class AddressError(Exception): # <<<<<<<<<<<<<< * """ * Exception raised when trying to create an invalid Address object. */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); /* "/home/das/src/pyliblo/src/liblo.pyx":569 * Exception raised when trying to create an invalid Address object. * """ * def __init__(self, msg): # <<<<<<<<<<<<<< * self.msg = msg * def __str__(self): */ __pyx_t_3 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_5liblo_12AddressError_0__init__, NULL, __pyx_n_s__liblo); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyObject_SetItem(__pyx_t_1, __pyx_n_s____init__, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":571 * def __init__(self, msg): * self.msg = msg * def __str__(self): # <<<<<<<<<<<<<< * return "address error: %s" % self.msg * */ __pyx_t_3 = __pyx_binding_PyCFunctionType_NewEx(&__pyx_mdef_5liblo_12AddressError_1__str__, NULL, __pyx_n_s__liblo); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_3); if (PyObject_SetItem(__pyx_t_1, __pyx_n_s____str__, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":565 * ################################################################################ * * class AddressError(Exception): # <<<<<<<<<<<<<< * """ * Exception raised when trying to create an invalid Address object. */ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_3)); __Pyx_INCREF(__pyx_builtin_Exception); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_builtin_Exception); __Pyx_GIVEREF(__pyx_builtin_Exception); if (PyDict_SetItemString(((PyObject *)__pyx_t_1), "__doc__", ((PyObject *)__pyx_kp_s_34)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_2 = __Pyx_CreateClass(((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_1), __pyx_n_s__AddressError, __pyx_n_s__liblo); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_s__AddressError, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":587 * cdef lo_address _address * * def __init__(self, addr, addr2=None, proto=LO_UDP): # <<<<<<<<<<<<<< * if addr2: * # Address(host, port[, proto]) */ __pyx_t_1 = PyInt_FromLong(LO_UDP); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(__pyx_t_1); __pyx_k_12 = __pyx_t_1; __Pyx_GIVEREF(__pyx_t_1); __pyx_t_1 = 0; /* "/home/das/src/pyliblo/src/liblo.pyx":1 * # # <<<<<<<<<<<<<< * # pyliblo - Python bindings for the liblo OSC library * # */ __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF(((PyObject *)__pyx_t_1)); if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; /* "/usr/local/lib/python2.6/dist-packages/Cython/Includes/cpython/type.pxd":2 * * cdef extern from "Python.h": # <<<<<<<<<<<<<< * # The C structure of the objects used to describe built-in types. * */ goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); if (__pyx_m) { __Pyx_AddTraceback("init liblo"); Py_DECREF(__pyx_m); __pyx_m = 0; } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_ImportError, "init liblo"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); #if PY_MAJOR_VERSION < 3 return; #else return __pyx_m; #endif } /* Runtime support code */ static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) { PyObject *result; result = PyObject_GetAttr(dict, name); if (!result) PyErr_SetObject(PyExc_NameError, name); return result; } static void __Pyx_RaiseDoubleKeywordsError( const char* func_name, PyObject* kw_name) { PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION >= 3 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); #else "%s() got multiple values for keyword argument '%s'", func_name, PyString_AS_STRING(kw_name)); #endif } static void __Pyx_RaiseArgtupleInvalid( const char* func_name, int exact, Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found) { Py_ssize_t num_expected; const char *number, *more_or_less; if (num_found < num_min) { num_expected = num_min; more_or_less = "at least"; } else { num_expected = num_max; more_or_less = "at most"; } if (exact) { more_or_less = "exactly"; } number = (num_expected == 1) ? "" : "s"; PyErr_Format(PyExc_TypeError, #if PY_VERSION_HEX < 0x02050000 "%s() takes %s %d positional argument%s (%d given)", #else "%s() takes %s %zd positional argument%s (%zd given)", #endif func_name, more_or_less, num_expected, number, num_found); } static int __Pyx_ParseOptionalKeywords( PyObject *kwds, PyObject **argnames[], PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, const char* function_name) { PyObject *key = 0, *value = 0; Py_ssize_t pos = 0; PyObject*** name; PyObject*** first_kw_arg = argnames + num_pos_args; while (PyDict_Next(kwds, &pos, &key, &value)) { name = first_kw_arg; while (*name && (**name != key)) name++; if (*name) { values[name-argnames] = value; } else { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) { #else if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key))) { #endif goto invalid_keyword_type; } else { for (name = first_kw_arg; *name; name++) { #if PY_MAJOR_VERSION >= 3 if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) && PyUnicode_Compare(**name, key) == 0) break; #else if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) && _PyString_Eq(**name, key)) break; #endif } if (*name) { values[name-argnames] = value; } else { /* unexpected keyword found */ for (name=argnames; name != first_kw_arg; name++) { if (**name == key) goto arg_passed_twice; #if PY_MAJOR_VERSION >= 3 if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) && PyUnicode_Compare(**name, key) == 0) goto arg_passed_twice; #else if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) && _PyString_Eq(**name, key)) goto arg_passed_twice; #endif } if (kwds2) { if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; } else { goto invalid_keyword; } } } } } return 0; arg_passed_twice: __Pyx_RaiseDoubleKeywordsError(function_name, **name); goto bad; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%s() keywords must be strings", function_name); goto bad; invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%s() got an unexpected keyword argument '%s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif bad: return -1; } static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { PyErr_Format(PyExc_ValueError, #if PY_VERSION_HEX < 0x02050000 "need more than %d value%s to unpack", (int)index, #else "need more than %zd value%s to unpack", index, #endif (index == 1) ? "" : "s"); } static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { PyErr_Format(PyExc_ValueError, #if PY_VERSION_HEX < 0x02050000 "too many values to unpack (expected %d)", (int)expected); #else "too many values to unpack (expected %zd)", expected); #endif } static PyObject *__Pyx_UnpackItem(PyObject *iter, Py_ssize_t index) { PyObject *item; if (!(item = PyIter_Next(iter))) { if (!PyErr_Occurred()) { __Pyx_RaiseNeedMoreValuesError(index); } } return item; } static int __Pyx_EndUnpack(PyObject *iter, Py_ssize_t expected) { PyObject *item; if ((item = PyIter_Next(iter))) { Py_DECREF(item); __Pyx_RaiseTooManyValuesError(expected); return -1; } else if (!PyErr_Occurred()) return 0; else return -1; } static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { if (unlikely(!type)) { PyErr_Format(PyExc_SystemError, "Missing type object"); return 0; } if (likely(PyObject_TypeCheck(obj, type))) return 1; PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", Py_TYPE(obj)->tp_name, type->tp_name); return 0; } static double __Pyx__PyObject_AsDouble(PyObject* obj) { PyObject* float_value; if (Py_TYPE(obj)->tp_as_number && Py_TYPE(obj)->tp_as_number->nb_float) { return PyFloat_AsDouble(obj); } else if (PyUnicode_CheckExact(obj) || PyBytes_CheckExact(obj)) { #if PY_MAJOR_VERSION >= 3 float_value = PyFloat_FromString(obj); #else float_value = PyFloat_FromString(obj, 0); #endif } else { PyObject* args = PyTuple_New(1); if (unlikely(!args)) goto bad; PyTuple_SET_ITEM(args, 0, obj); float_value = PyObject_Call((PyObject*)&PyFloat_Type, args, 0); PyTuple_SET_ITEM(args, 0, 0); Py_DECREF(args); } if (likely(float_value)) { double value = PyFloat_AS_DOUBLE(float_value); Py_DECREF(float_value); return value; } bad: return (double)-1; } static CYTHON_INLINE int __Pyx_CheckKeywordStrings( PyObject *kwdict, const char* function_name, int kw_allowed) { PyObject* key = 0; Py_ssize_t pos = 0; while (PyDict_Next(kwdict, &pos, &key, 0)) { #if PY_MAJOR_VERSION < 3 if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) #else if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key))) #endif goto invalid_keyword_type; } if ((!kw_allowed) && unlikely(key)) goto invalid_keyword; return 1; invalid_keyword_type: PyErr_Format(PyExc_TypeError, "%s() keywords must be strings", function_name); return 0; invalid_keyword: PyErr_Format(PyExc_TypeError, #if PY_MAJOR_VERSION < 3 "%s() got an unexpected keyword argument '%s'", function_name, PyString_AsString(key)); #else "%s() got an unexpected keyword argument '%U'", function_name, key); #endif return 0; } static CYTHON_INLINE void __Pyx_RaiseNoneIndexingError(void) { PyErr_SetString(PyExc_TypeError, "'NoneType' object is unsubscriptable"); } static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); tmp_type = tstate->curexc_type; tmp_value = tstate->curexc_value; tmp_tb = tstate->curexc_traceback; tstate->curexc_type = type; tstate->curexc_value = value; tstate->curexc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); } static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { PyThreadState *tstate = PyThreadState_GET(); *type = tstate->curexc_type; *value = tstate->curexc_value; *tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; } static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { PyObject *local_type, *local_value, *local_tb; PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); local_type = tstate->curexc_type; local_value = tstate->curexc_value; local_tb = tstate->curexc_traceback; tstate->curexc_type = 0; tstate->curexc_value = 0; tstate->curexc_traceback = 0; PyErr_NormalizeException(&local_type, &local_value, &local_tb); if (unlikely(tstate->curexc_type)) goto bad; #if PY_MAJOR_VERSION >= 3 if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) goto bad; #endif *type = local_type; *value = local_value; *tb = local_tb; Py_INCREF(local_type); Py_INCREF(local_value); Py_INCREF(local_tb); tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = local_type; tstate->exc_value = local_value; tstate->exc_traceback = local_tb; /* Make sure tstate is in a consistent state when we XDECREF these objects (XDECREF may run arbitrary code). */ Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); return 0; bad: *type = 0; *value = 0; *tb = 0; Py_XDECREF(local_type); Py_XDECREF(local_value); Py_XDECREF(local_tb); return -1; } static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { PyThreadState *tstate = PyThreadState_GET(); *type = tstate->exc_type; *value = tstate->exc_value; *tb = tstate->exc_traceback; Py_XINCREF(*type); Py_XINCREF(*value); Py_XINCREF(*tb); } static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) { PyObject *tmp_type, *tmp_value, *tmp_tb; PyThreadState *tstate = PyThreadState_GET(); tmp_type = tstate->exc_type; tmp_value = tstate->exc_value; tmp_tb = tstate->exc_traceback; tstate->exc_type = type; tstate->exc_value = value; tstate->exc_traceback = tb; Py_XDECREF(tmp_type); Py_XDECREF(tmp_value); Py_XDECREF(tmp_tb); } static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) { PyObject *py_import = 0; PyObject *empty_list = 0; PyObject *module = 0; PyObject *global_dict = 0; PyObject *empty_dict = 0; PyObject *list; py_import = __Pyx_GetAttrString(__pyx_b, "__import__"); if (!py_import) goto bad; if (from_list) list = from_list; else { empty_list = PyList_New(0); if (!empty_list) goto bad; list = empty_list; } global_dict = PyModule_GetDict(__pyx_m); if (!global_dict) goto bad; empty_dict = PyDict_New(); if (!empty_dict) goto bad; module = PyObject_CallFunctionObjArgs(py_import, name, global_dict, empty_dict, list, NULL); bad: Py_XDECREF(empty_list); Py_XDECREF(py_import); Py_XDECREF(empty_dict); return module; } static PyObject *__Pyx_FindPy2Metaclass(PyObject *bases) { PyObject *metaclass; /* Default metaclass */ #if PY_MAJOR_VERSION < 3 if (PyTuple_Check(bases) && PyTuple_GET_SIZE(bases) > 0) { PyObject *base = PyTuple_GET_ITEM(bases, 0); metaclass = PyObject_GetAttrString(base, "__class__"); if (!metaclass) { PyErr_Clear(); metaclass = (PyObject*) Py_TYPE(base); } } else { metaclass = (PyObject *) &PyClass_Type; } #else if (PyTuple_Check(bases) && PyTuple_GET_SIZE(bases) > 0) { PyObject *base = PyTuple_GET_ITEM(bases, 0); metaclass = (PyObject*) Py_TYPE(base); } else { metaclass = (PyObject *) &PyType_Type; } #endif Py_INCREF(metaclass); return metaclass; } static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, PyObject *modname) { PyObject *result; PyObject *metaclass; if (PyDict_SetItemString(dict, "__module__", modname) < 0) return NULL; /* Python2 __metaclass__ */ metaclass = PyDict_GetItemString(dict, "__metaclass__"); if (metaclass) { Py_INCREF(metaclass); } else { metaclass = __Pyx_FindPy2Metaclass(bases); } result = PyObject_CallFunctionObjArgs(metaclass, name, bases, dict, NULL); Py_DECREF(metaclass); return result; } PyObject *__pyx_binding_PyCFunctionType_NewEx(PyMethodDef *ml, PyObject *self, PyObject *module) { __pyx_binding_PyCFunctionType_object *op = PyObject_GC_New(__pyx_binding_PyCFunctionType_object, __pyx_binding_PyCFunctionType); if (op == NULL) return NULL; op->func.m_ml = ml; Py_XINCREF(self); op->func.m_self = self; Py_XINCREF(module); op->func.m_module = module; PyObject_GC_Track(op); return (PyObject *)op; } static void __pyx_binding_PyCFunctionType_dealloc(__pyx_binding_PyCFunctionType_object *m) { PyObject_GC_UnTrack(m); Py_XDECREF(m->func.m_self); Py_XDECREF(m->func.m_module); PyObject_GC_Del(m); } static PyObject *__pyx_binding_PyCFunctionType_descr_get(PyObject *func, PyObject *obj, PyObject *type) { if (obj == Py_None) obj = NULL; return PyMethod_New(func, obj, type); } int __pyx_binding_PyCFunctionType_init(void) { __pyx_binding_PyCFunctionType_type = PyCFunction_Type; __pyx_binding_PyCFunctionType_type.tp_name = __Pyx_NAMESTR("cython_binding_builtin_function_or_method"); __pyx_binding_PyCFunctionType_type.tp_dealloc = (destructor)__pyx_binding_PyCFunctionType_dealloc; __pyx_binding_PyCFunctionType_type.tp_descr_get = __pyx_binding_PyCFunctionType_descr_get; if (PyType_Ready(&__pyx_binding_PyCFunctionType_type) < 0) { return -1; } __pyx_binding_PyCFunctionType = &__pyx_binding_PyCFunctionType_type; return 0; } #if PY_MAJOR_VERSION < 3 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { Py_XINCREF(type); Py_XINCREF(value); Py_XINCREF(tb); /* First, check the traceback argument, replacing None with NULL. */ if (tb == Py_None) { Py_DECREF(tb); tb = 0; } else if (tb != NULL && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto raise_error; } /* Next, replace a missing value with None */ if (value == NULL) { value = Py_None; Py_INCREF(value); } #if PY_VERSION_HEX < 0x02050000 if (!PyClass_Check(type)) #else if (!PyType_Check(type)) #endif { /* Raising an instance. The value should be a dummy. */ if (value != Py_None) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto raise_error; } /* Normalize to raise , */ Py_DECREF(value); value = type; #if PY_VERSION_HEX < 0x02050000 if (PyInstance_Check(type)) { type = (PyObject*) ((PyInstanceObject*)type)->in_class; Py_INCREF(type); } else { type = 0; PyErr_SetString(PyExc_TypeError, "raise: exception must be an old-style class or instance"); goto raise_error; } #else type = (PyObject*) Py_TYPE(type); Py_INCREF(type); if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto raise_error; } #endif } __Pyx_ErrRestore(type, value, tb); return; raise_error: Py_XDECREF(value); Py_XDECREF(type); Py_XDECREF(tb); return; } #else /* Python 3+ */ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) { if (tb == Py_None) { tb = 0; } else if (tb && !PyTraceBack_Check(tb)) { PyErr_SetString(PyExc_TypeError, "raise: arg 3 must be a traceback or None"); goto bad; } if (value == Py_None) value = 0; if (PyExceptionInstance_Check(type)) { if (value) { PyErr_SetString(PyExc_TypeError, "instance exception may not have a separate value"); goto bad; } value = type; type = (PyObject*) Py_TYPE(value); } else if (!PyExceptionClass_Check(type)) { PyErr_SetString(PyExc_TypeError, "raise: exception class must be a subclass of BaseException"); goto bad; } PyErr_SetObject(type, value); if (tb) { PyThreadState *tstate = PyThreadState_GET(); PyObject* tmp_tb = tstate->curexc_traceback; if (tb != tmp_tb) { Py_INCREF(tb); tstate->curexc_traceback = tb; Py_XDECREF(tmp_tb); } } bad: return; } #endif static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_int32_t(int32_t val) { const int32_t neg_one = (int32_t)-1, const_zero = (int32_t)0; const int is_unsigned = const_zero < neg_one; if ((sizeof(int32_t) == sizeof(char)) || (sizeof(int32_t) == sizeof(short))) { return PyInt_FromLong((long)val); } else if ((sizeof(int32_t) == sizeof(int)) || (sizeof(int32_t) == sizeof(long))) { if (is_unsigned) return PyLong_FromUnsignedLong((unsigned long)val); else return PyInt_FromLong((long)val); } else if (sizeof(int32_t) == sizeof(PY_LONG_LONG)) { if (is_unsigned) return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val); else return PyLong_FromLongLong((PY_LONG_LONG)val); } else { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; return _PyLong_FromByteArray(bytes, sizeof(int32_t), little, !is_unsigned); } } static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_int64_t(int64_t val) { const int64_t neg_one = (int64_t)-1, const_zero = (int64_t)0; const int is_unsigned = const_zero < neg_one; if ((sizeof(int64_t) == sizeof(char)) || (sizeof(int64_t) == sizeof(short))) { return PyInt_FromLong((long)val); } else if ((sizeof(int64_t) == sizeof(int)) || (sizeof(int64_t) == sizeof(long))) { if (is_unsigned) return PyLong_FromUnsignedLong((unsigned long)val); else return PyInt_FromLong((long)val); } else if (sizeof(int64_t) == sizeof(PY_LONG_LONG)) { if (is_unsigned) return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val); else return PyLong_FromLongLong((PY_LONG_LONG)val); } else { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; return _PyLong_FromByteArray(bytes, sizeof(int64_t), little, !is_unsigned); } } static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_uint8_t(uint8_t val) { const uint8_t neg_one = (uint8_t)-1, const_zero = (uint8_t)0; const int is_unsigned = const_zero < neg_one; if ((sizeof(uint8_t) == sizeof(char)) || (sizeof(uint8_t) == sizeof(short))) { return PyInt_FromLong((long)val); } else if ((sizeof(uint8_t) == sizeof(int)) || (sizeof(uint8_t) == sizeof(long))) { if (is_unsigned) return PyLong_FromUnsignedLong((unsigned long)val); else return PyInt_FromLong((long)val); } else if (sizeof(uint8_t) == sizeof(PY_LONG_LONG)) { if (is_unsigned) return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val); else return PyLong_FromLongLong((PY_LONG_LONG)val); } else { int one = 1; int little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; return _PyLong_FromByteArray(bytes, sizeof(uint8_t), little, !is_unsigned); } } static CYTHON_INLINE int32_t __Pyx_PyInt_from_py_int32_t(PyObject* x) { const int32_t neg_one = (int32_t)-1, const_zero = (int32_t)0; const int is_unsigned = const_zero < neg_one; if (sizeof(int32_t) == sizeof(char)) { if (is_unsigned) return (int32_t)__Pyx_PyInt_AsUnsignedChar(x); else return (int32_t)__Pyx_PyInt_AsSignedChar(x); } else if (sizeof(int32_t) == sizeof(short)) { if (is_unsigned) return (int32_t)__Pyx_PyInt_AsUnsignedShort(x); else return (int32_t)__Pyx_PyInt_AsSignedShort(x); } else if (sizeof(int32_t) == sizeof(int)) { if (is_unsigned) return (int32_t)__Pyx_PyInt_AsUnsignedInt(x); else return (int32_t)__Pyx_PyInt_AsSignedInt(x); } else if (sizeof(int32_t) == sizeof(long)) { if (is_unsigned) return (int32_t)__Pyx_PyInt_AsUnsignedLong(x); else return (int32_t)__Pyx_PyInt_AsSignedLong(x); } else if (sizeof(int32_t) == sizeof(PY_LONG_LONG)) { if (is_unsigned) return (int32_t)__Pyx_PyInt_AsUnsignedLongLong(x); else return (int32_t)__Pyx_PyInt_AsSignedLongLong(x); } else { int32_t val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_VERSION_HEX < 0x03000000 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } return (int32_t)-1; } } static CYTHON_INLINE int64_t __Pyx_PyInt_from_py_int64_t(PyObject* x) { const int64_t neg_one = (int64_t)-1, const_zero = (int64_t)0; const int is_unsigned = const_zero < neg_one; if (sizeof(int64_t) == sizeof(char)) { if (is_unsigned) return (int64_t)__Pyx_PyInt_AsUnsignedChar(x); else return (int64_t)__Pyx_PyInt_AsSignedChar(x); } else if (sizeof(int64_t) == sizeof(short)) { if (is_unsigned) return (int64_t)__Pyx_PyInt_AsUnsignedShort(x); else return (int64_t)__Pyx_PyInt_AsSignedShort(x); } else if (sizeof(int64_t) == sizeof(int)) { if (is_unsigned) return (int64_t)__Pyx_PyInt_AsUnsignedInt(x); else return (int64_t)__Pyx_PyInt_AsSignedInt(x); } else if (sizeof(int64_t) == sizeof(long)) { if (is_unsigned) return (int64_t)__Pyx_PyInt_AsUnsignedLong(x); else return (int64_t)__Pyx_PyInt_AsSignedLong(x); } else if (sizeof(int64_t) == sizeof(PY_LONG_LONG)) { if (is_unsigned) return (int64_t)__Pyx_PyInt_AsUnsignedLongLong(x); else return (int64_t)__Pyx_PyInt_AsSignedLongLong(x); } else { int64_t val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_VERSION_HEX < 0x03000000 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } return (int64_t)-1; } } static CYTHON_INLINE uint8_t __Pyx_PyInt_from_py_uint8_t(PyObject* x) { const uint8_t neg_one = (uint8_t)-1, const_zero = (uint8_t)0; const int is_unsigned = const_zero < neg_one; if (sizeof(uint8_t) == sizeof(char)) { if (is_unsigned) return (uint8_t)__Pyx_PyInt_AsUnsignedChar(x); else return (uint8_t)__Pyx_PyInt_AsSignedChar(x); } else if (sizeof(uint8_t) == sizeof(short)) { if (is_unsigned) return (uint8_t)__Pyx_PyInt_AsUnsignedShort(x); else return (uint8_t)__Pyx_PyInt_AsSignedShort(x); } else if (sizeof(uint8_t) == sizeof(int)) { if (is_unsigned) return (uint8_t)__Pyx_PyInt_AsUnsignedInt(x); else return (uint8_t)__Pyx_PyInt_AsSignedInt(x); } else if (sizeof(uint8_t) == sizeof(long)) { if (is_unsigned) return (uint8_t)__Pyx_PyInt_AsUnsignedLong(x); else return (uint8_t)__Pyx_PyInt_AsSignedLong(x); } else if (sizeof(uint8_t) == sizeof(PY_LONG_LONG)) { if (is_unsigned) return (uint8_t)__Pyx_PyInt_AsUnsignedLongLong(x); else return (uint8_t)__Pyx_PyInt_AsSignedLongLong(x); } else { uint8_t val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_VERSION_HEX < 0x03000000 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } return (uint8_t)-1; } } static CYTHON_INLINE uint32_t __Pyx_PyInt_from_py_uint32_t(PyObject* x) { const uint32_t neg_one = (uint32_t)-1, const_zero = (uint32_t)0; const int is_unsigned = const_zero < neg_one; if (sizeof(uint32_t) == sizeof(char)) { if (is_unsigned) return (uint32_t)__Pyx_PyInt_AsUnsignedChar(x); else return (uint32_t)__Pyx_PyInt_AsSignedChar(x); } else if (sizeof(uint32_t) == sizeof(short)) { if (is_unsigned) return (uint32_t)__Pyx_PyInt_AsUnsignedShort(x); else return (uint32_t)__Pyx_PyInt_AsSignedShort(x); } else if (sizeof(uint32_t) == sizeof(int)) { if (is_unsigned) return (uint32_t)__Pyx_PyInt_AsUnsignedInt(x); else return (uint32_t)__Pyx_PyInt_AsSignedInt(x); } else if (sizeof(uint32_t) == sizeof(long)) { if (is_unsigned) return (uint32_t)__Pyx_PyInt_AsUnsignedLong(x); else return (uint32_t)__Pyx_PyInt_AsSignedLong(x); } else if (sizeof(uint32_t) == sizeof(PY_LONG_LONG)) { if (is_unsigned) return (uint32_t)__Pyx_PyInt_AsUnsignedLongLong(x); else return (uint32_t)__Pyx_PyInt_AsSignedLongLong(x); } else { uint32_t val; PyObject *v = __Pyx_PyNumber_Int(x); #if PY_VERSION_HEX < 0x03000000 if (likely(v) && !PyLong_Check(v)) { PyObject *tmp = v; v = PyNumber_Long(tmp); Py_DECREF(tmp); } #endif if (likely(v)) { int one = 1; int is_little = (int)*(unsigned char *)&one; unsigned char *bytes = (unsigned char *)&val; int ret = _PyLong_AsByteArray((PyLongObject *)v, bytes, sizeof(val), is_little, !is_unsigned); Py_DECREF(v); if (likely(!ret)) return val; } return (uint32_t)-1; } } static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) { const unsigned char neg_one = (unsigned char)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (sizeof(unsigned char) < sizeof(long)) { long val = __Pyx_PyInt_AsLong(x); if (unlikely(val != (long)(unsigned char)val)) { if (!unlikely(val == -1 && PyErr_Occurred())) { PyErr_SetString(PyExc_OverflowError, (is_unsigned && unlikely(val < 0)) ? "can't convert negative value to unsigned char" : "value too large to convert to unsigned char"); } return (unsigned char)-1; } return (unsigned char)val; } return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x); } static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) { const unsigned short neg_one = (unsigned short)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (sizeof(unsigned short) < sizeof(long)) { long val = __Pyx_PyInt_AsLong(x); if (unlikely(val != (long)(unsigned short)val)) { if (!unlikely(val == -1 && PyErr_Occurred())) { PyErr_SetString(PyExc_OverflowError, (is_unsigned && unlikely(val < 0)) ? "can't convert negative value to unsigned short" : "value too large to convert to unsigned short"); } return (unsigned short)-1; } return (unsigned short)val; } return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x); } static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) { const unsigned int neg_one = (unsigned int)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (sizeof(unsigned int) < sizeof(long)) { long val = __Pyx_PyInt_AsLong(x); if (unlikely(val != (long)(unsigned int)val)) { if (!unlikely(val == -1 && PyErr_Occurred())) { PyErr_SetString(PyExc_OverflowError, (is_unsigned && unlikely(val < 0)) ? "can't convert negative value to unsigned int" : "value too large to convert to unsigned int"); } return (unsigned int)-1; } return (unsigned int)val; } return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x); } static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) { const char neg_one = (char)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (sizeof(char) < sizeof(long)) { long val = __Pyx_PyInt_AsLong(x); if (unlikely(val != (long)(char)val)) { if (!unlikely(val == -1 && PyErr_Occurred())) { PyErr_SetString(PyExc_OverflowError, (is_unsigned && unlikely(val < 0)) ? "can't convert negative value to char" : "value too large to convert to char"); } return (char)-1; } return (char)val; } return (char)__Pyx_PyInt_AsLong(x); } static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) { const short neg_one = (short)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (sizeof(short) < sizeof(long)) { long val = __Pyx_PyInt_AsLong(x); if (unlikely(val != (long)(short)val)) { if (!unlikely(val == -1 && PyErr_Occurred())) { PyErr_SetString(PyExc_OverflowError, (is_unsigned && unlikely(val < 0)) ? "can't convert negative value to short" : "value too large to convert to short"); } return (short)-1; } return (short)val; } return (short)__Pyx_PyInt_AsLong(x); } static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) { const int neg_one = (int)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (sizeof(int) < sizeof(long)) { long val = __Pyx_PyInt_AsLong(x); if (unlikely(val != (long)(int)val)) { if (!unlikely(val == -1 && PyErr_Occurred())) { PyErr_SetString(PyExc_OverflowError, (is_unsigned && unlikely(val < 0)) ? "can't convert negative value to int" : "value too large to convert to int"); } return (int)-1; } return (int)val; } return (int)__Pyx_PyInt_AsLong(x); } static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) { const signed char neg_one = (signed char)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (sizeof(signed char) < sizeof(long)) { long val = __Pyx_PyInt_AsLong(x); if (unlikely(val != (long)(signed char)val)) { if (!unlikely(val == -1 && PyErr_Occurred())) { PyErr_SetString(PyExc_OverflowError, (is_unsigned && unlikely(val < 0)) ? "can't convert negative value to signed char" : "value too large to convert to signed char"); } return (signed char)-1; } return (signed char)val; } return (signed char)__Pyx_PyInt_AsSignedLong(x); } static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) { const signed short neg_one = (signed short)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (sizeof(signed short) < sizeof(long)) { long val = __Pyx_PyInt_AsLong(x); if (unlikely(val != (long)(signed short)val)) { if (!unlikely(val == -1 && PyErr_Occurred())) { PyErr_SetString(PyExc_OverflowError, (is_unsigned && unlikely(val < 0)) ? "can't convert negative value to signed short" : "value too large to convert to signed short"); } return (signed short)-1; } return (signed short)val; } return (signed short)__Pyx_PyInt_AsSignedLong(x); } static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) { const signed int neg_one = (signed int)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (sizeof(signed int) < sizeof(long)) { long val = __Pyx_PyInt_AsLong(x); if (unlikely(val != (long)(signed int)val)) { if (!unlikely(val == -1 && PyErr_Occurred())) { PyErr_SetString(PyExc_OverflowError, (is_unsigned && unlikely(val < 0)) ? "can't convert negative value to signed int" : "value too large to convert to signed int"); } return (signed int)-1; } return (signed int)val; } return (signed int)__Pyx_PyInt_AsSignedLong(x); } static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) { const int neg_one = (int)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; if (sizeof(int) < sizeof(long)) { long val = __Pyx_PyInt_AsLong(x); if (unlikely(val != (long)(int)val)) { if (!unlikely(val == -1 && PyErr_Occurred())) { PyErr_SetString(PyExc_OverflowError, (is_unsigned && unlikely(val < 0)) ? "can't convert negative value to int" : "value too large to convert to int"); } return (int)-1; } return (int)val; } return (int)__Pyx_PyInt_AsLong(x); } static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) { const unsigned long neg_one = (unsigned long)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; #if PY_VERSION_HEX < 0x03000000 if (likely(PyInt_Check(x))) { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { PyErr_SetString(PyExc_OverflowError, "can't convert negative value to unsigned long"); return (unsigned long)-1; } return (unsigned long)val; } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { if (unlikely(Py_SIZE(x) < 0)) { PyErr_SetString(PyExc_OverflowError, "can't convert negative value to unsigned long"); return (unsigned long)-1; } return PyLong_AsUnsignedLong(x); } else { return PyLong_AsLong(x); } } else { unsigned long val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (unsigned long)-1; val = __Pyx_PyInt_AsUnsignedLong(tmp); Py_DECREF(tmp); return val; } } static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) { const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; #if PY_VERSION_HEX < 0x03000000 if (likely(PyInt_Check(x))) { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { PyErr_SetString(PyExc_OverflowError, "can't convert negative value to unsigned PY_LONG_LONG"); return (unsigned PY_LONG_LONG)-1; } return (unsigned PY_LONG_LONG)val; } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { if (unlikely(Py_SIZE(x) < 0)) { PyErr_SetString(PyExc_OverflowError, "can't convert negative value to unsigned PY_LONG_LONG"); return (unsigned PY_LONG_LONG)-1; } return PyLong_AsUnsignedLongLong(x); } else { return PyLong_AsLongLong(x); } } else { unsigned PY_LONG_LONG val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (unsigned PY_LONG_LONG)-1; val = __Pyx_PyInt_AsUnsignedLongLong(tmp); Py_DECREF(tmp); return val; } } static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) { const long neg_one = (long)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; #if PY_VERSION_HEX < 0x03000000 if (likely(PyInt_Check(x))) { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long)-1; } return (long)val; } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { if (unlikely(Py_SIZE(x) < 0)) { PyErr_SetString(PyExc_OverflowError, "can't convert negative value to long"); return (long)-1; } return PyLong_AsUnsignedLong(x); } else { return PyLong_AsLong(x); } } else { long val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (long)-1; val = __Pyx_PyInt_AsLong(tmp); Py_DECREF(tmp); return val; } } static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) { const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; #if PY_VERSION_HEX < 0x03000000 if (likely(PyInt_Check(x))) { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { PyErr_SetString(PyExc_OverflowError, "can't convert negative value to PY_LONG_LONG"); return (PY_LONG_LONG)-1; } return (PY_LONG_LONG)val; } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { if (unlikely(Py_SIZE(x) < 0)) { PyErr_SetString(PyExc_OverflowError, "can't convert negative value to PY_LONG_LONG"); return (PY_LONG_LONG)-1; } return PyLong_AsUnsignedLongLong(x); } else { return PyLong_AsLongLong(x); } } else { PY_LONG_LONG val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (PY_LONG_LONG)-1; val = __Pyx_PyInt_AsLongLong(tmp); Py_DECREF(tmp); return val; } } static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) { const signed long neg_one = (signed long)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; #if PY_VERSION_HEX < 0x03000000 if (likely(PyInt_Check(x))) { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { PyErr_SetString(PyExc_OverflowError, "can't convert negative value to signed long"); return (signed long)-1; } return (signed long)val; } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { if (unlikely(Py_SIZE(x) < 0)) { PyErr_SetString(PyExc_OverflowError, "can't convert negative value to signed long"); return (signed long)-1; } return PyLong_AsUnsignedLong(x); } else { return PyLong_AsLong(x); } } else { signed long val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (signed long)-1; val = __Pyx_PyInt_AsSignedLong(tmp); Py_DECREF(tmp); return val; } } static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) { const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0; const int is_unsigned = neg_one > const_zero; #if PY_VERSION_HEX < 0x03000000 if (likely(PyInt_Check(x))) { long val = PyInt_AS_LONG(x); if (is_unsigned && unlikely(val < 0)) { PyErr_SetString(PyExc_OverflowError, "can't convert negative value to signed PY_LONG_LONG"); return (signed PY_LONG_LONG)-1; } return (signed PY_LONG_LONG)val; } else #endif if (likely(PyLong_Check(x))) { if (is_unsigned) { if (unlikely(Py_SIZE(x) < 0)) { PyErr_SetString(PyExc_OverflowError, "can't convert negative value to signed PY_LONG_LONG"); return (signed PY_LONG_LONG)-1; } return PyLong_AsUnsignedLongLong(x); } else { return PyLong_AsLongLong(x); } } else { signed PY_LONG_LONG val; PyObject *tmp = __Pyx_PyNumber_Int(x); if (!tmp) return (signed PY_LONG_LONG)-1; val = __Pyx_PyInt_AsSignedLongLong(tmp); Py_DECREF(tmp); return val; } } static void __Pyx_WriteUnraisable(const char *name) { PyObject *old_exc, *old_val, *old_tb; PyObject *ctx; __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); #if PY_MAJOR_VERSION < 3 ctx = PyString_FromString(name); #else ctx = PyUnicode_FromString(name); #endif __Pyx_ErrRestore(old_exc, old_val, old_tb); if (!ctx) { PyErr_WriteUnraisable(Py_None); } else { PyErr_WriteUnraisable(ctx); Py_DECREF(ctx); } } static int __Pyx_SetVtable(PyObject *dict, void *vtable) { #if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0) PyObject *ob = PyCapsule_New(vtable, 0, 0); #else PyObject *ob = PyCObject_FromVoidPtr(vtable, 0); #endif if (!ob) goto bad; if (PyDict_SetItemString(dict, "__pyx_vtable__", ob) < 0) goto bad; Py_DECREF(ob); return 0; bad: Py_XDECREF(ob); return -1; } #ifndef __PYX_HAVE_RT_ImportType #define __PYX_HAVE_RT_ImportType static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, long size, int strict) { PyObject *py_module = 0; PyObject *result = 0; PyObject *py_name = 0; char warning[200]; py_module = __Pyx_ImportModule(module_name); if (!py_module) goto bad; #if PY_MAJOR_VERSION < 3 py_name = PyString_FromString(class_name); #else py_name = PyUnicode_FromString(class_name); #endif if (!py_name) goto bad; result = PyObject_GetAttr(py_module, py_name); Py_DECREF(py_name); py_name = 0; Py_DECREF(py_module); py_module = 0; if (!result) goto bad; if (!PyType_Check(result)) { PyErr_Format(PyExc_TypeError, "%s.%s is not a type object", module_name, class_name); goto bad; } if (!strict && ((PyTypeObject *)result)->tp_basicsize > size) { PyOS_snprintf(warning, sizeof(warning), "%s.%s size changed, may indicate binary incompatibility", module_name, class_name); #if PY_VERSION_HEX < 0x02050000 PyErr_Warn(NULL, warning); #else PyErr_WarnEx(NULL, warning, 0); #endif } else if (((PyTypeObject *)result)->tp_basicsize != size) { PyErr_Format(PyExc_ValueError, "%s.%s has the wrong size, try recompiling", module_name, class_name); goto bad; } return (PyTypeObject *)result; bad: Py_XDECREF(py_module); Py_XDECREF(result); return 0; } #endif #ifndef __PYX_HAVE_RT_ImportModule #define __PYX_HAVE_RT_ImportModule static PyObject *__Pyx_ImportModule(const char *name) { PyObject *py_name = 0; PyObject *py_module = 0; #if PY_MAJOR_VERSION < 3 py_name = PyString_FromString(name); #else py_name = PyUnicode_FromString(name); #endif if (!py_name) goto bad; py_module = PyImport_Import(py_name); Py_DECREF(py_name); return py_module; bad: Py_XDECREF(py_name); return 0; } #endif #include "compile.h" #include "frameobject.h" #include "traceback.h" static void __Pyx_AddTraceback(const char *funcname) { PyObject *py_srcfile = 0; PyObject *py_funcname = 0; PyObject *py_globals = 0; PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; #if PY_MAJOR_VERSION < 3 py_srcfile = PyString_FromString(__pyx_filename); #else py_srcfile = PyUnicode_FromString(__pyx_filename); #endif if (!py_srcfile) goto bad; if (__pyx_clineno) { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno); #else py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno); #endif } else { #if PY_MAJOR_VERSION < 3 py_funcname = PyString_FromString(funcname); #else py_funcname = PyUnicode_FromString(funcname); #endif } if (!py_funcname) goto bad; py_globals = PyModule_GetDict(__pyx_m); if (!py_globals) goto bad; py_code = PyCode_New( 0, /*int argcount,*/ #if PY_MAJOR_VERSION >= 3 0, /*int kwonlyargcount,*/ #endif 0, /*int nlocals,*/ 0, /*int stacksize,*/ 0, /*int flags,*/ __pyx_empty_bytes, /*PyObject *code,*/ __pyx_empty_tuple, /*PyObject *consts,*/ __pyx_empty_tuple, /*PyObject *names,*/ __pyx_empty_tuple, /*PyObject *varnames,*/ __pyx_empty_tuple, /*PyObject *freevars,*/ __pyx_empty_tuple, /*PyObject *cellvars,*/ py_srcfile, /*PyObject *filename,*/ py_funcname, /*PyObject *name,*/ __pyx_lineno, /*int firstlineno,*/ __pyx_empty_bytes /*PyObject *lnotab*/ ); if (!py_code) goto bad; py_frame = PyFrame_New( PyThreadState_GET(), /*PyThreadState *tstate,*/ py_code, /*PyCodeObject *code,*/ py_globals, /*PyObject *globals,*/ 0 /*PyObject *locals*/ ); if (!py_frame) goto bad; py_frame->f_lineno = __pyx_lineno; PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_srcfile); Py_XDECREF(py_funcname); Py_XDECREF(py_code); Py_XDECREF(py_frame); } static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { while (t->p) { #if PY_MAJOR_VERSION < 3 if (t->is_unicode) { *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); } else if (t->intern) { *t->p = PyString_InternFromString(t->s); } else { *t->p = PyString_FromStringAndSize(t->s, t->n - 1); } #else /* Python 3+ has unicode identifiers */ if (t->is_unicode | t->is_str) { if (t->intern) { *t->p = PyUnicode_InternFromString(t->s); } else if (t->encoding) { *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); } else { *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); } } else { *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); } #endif if (!*t->p) return -1; ++t; } return 0; } /* Type Conversion Functions */ static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { int is_true = x == Py_True; if (is_true | (x == Py_False) | (x == Py_None)) return is_true; else return PyObject_IsTrue(x); } static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { PyNumberMethods *m; const char *name = NULL; PyObject *res = NULL; #if PY_VERSION_HEX < 0x03000000 if (PyInt_Check(x) || PyLong_Check(x)) #else if (PyLong_Check(x)) #endif return Py_INCREF(x), x; m = Py_TYPE(x)->tp_as_number; #if PY_VERSION_HEX < 0x03000000 if (m && m->nb_int) { name = "int"; res = PyNumber_Int(x); } else if (m && m->nb_long) { name = "long"; res = PyNumber_Long(x); } #else if (m && m->nb_int) { name = "int"; res = PyNumber_Long(x); } #endif if (res) { #if PY_VERSION_HEX < 0x03000000 if (!PyInt_Check(res) && !PyLong_Check(res)) { #else if (!PyLong_Check(res)) { #endif PyErr_Format(PyExc_TypeError, "__%s__ returned non-%s (type %.200s)", name, name, Py_TYPE(res)->tp_name); Py_DECREF(res); return NULL; } } else if (!PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "an integer is required"); } return res; } static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { Py_ssize_t ival; PyObject* x = PyNumber_Index(b); if (!x) return -1; ival = PyInt_AsSsize_t(x); Py_DECREF(x); return ival; } static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { #if PY_VERSION_HEX < 0x02050000 if (ival <= LONG_MAX) return PyInt_FromLong((long)ival); else { unsigned char *bytes = (unsigned char *) &ival; int one = 1; int little = (int)*(unsigned char*)&one; return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); } #else return PyInt_FromSize_t(ival); #endif } static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) { unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x); if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) { return (size_t)-1; } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) { PyErr_SetString(PyExc_OverflowError, "value too large to convert to size_t"); return (size_t)-1; } return (size_t)val; } #endif /* Py_PYTHON_H */ pyliblo-0.9.1/src/liblo.pxd0000644000175000017500000000771411521043407013706 0ustar dasdas# # pyliblo - Python bindings for the liblo OSC library # # Copyright (C) 2007-2011 Dominic Sacré # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation; either version 2.1 of the # License, or (at your option) any later version. # from libc.stdint cimport int32_t, uint32_t, int64_t, uint8_t from libc.stdio cimport const_char cdef extern from 'lo/lo.h': # type definitions ctypedef void *lo_server ctypedef void *lo_server_thread ctypedef void *lo_method ctypedef void *lo_address ctypedef void *lo_message ctypedef void *lo_blob ctypedef void *lo_bundle ctypedef struct lo_timetag: uint32_t sec uint32_t frac ctypedef union lo_arg: int32_t i int64_t h float f double d unsigned char c char s uint8_t m[4] lo_timetag t cdef enum: LO_DEFAULT LO_UDP LO_UNIX LO_TCP ctypedef void(*lo_err_handler)(int num, const_char *msg, const_char *where) ctypedef int(*lo_method_handler)(const_char *path, const_char *types, lo_arg **argv, int argc, lo_message msg, void *user_data) # send int lo_send_message_from(lo_address targ, lo_server serv, char *path, lo_message msg) int lo_send_bundle_from(lo_address targ, lo_server serv, lo_bundle b) # server lo_server lo_server_new_with_proto(char *port, int proto, lo_err_handler err_h) void lo_server_free(lo_server s) char *lo_server_get_url(lo_server s) int lo_server_get_port(lo_server s) int lo_server_get_protocol(lo_server s) lo_method lo_server_add_method(lo_server s, char *path, char *typespec, lo_method_handler h, void *user_data) int lo_server_recv(lo_server s) nogil int lo_server_recv_noblock(lo_server s, int timeout) nogil int lo_server_get_socket_fd(lo_server s) # server thread lo_server_thread lo_server_thread_new_with_proto(char *port, int proto, lo_err_handler err_h) void lo_server_thread_free(lo_server_thread st) lo_server lo_server_thread_get_server(lo_server_thread st) void lo_server_thread_start(lo_server_thread st) void lo_server_thread_stop(lo_server_thread st) # address lo_address lo_address_new(char *host, char *port) lo_address lo_address_new_with_proto(int proto, char *host, char *port) lo_address lo_address_new_from_url(char *url) void lo_address_free(lo_address) char *lo_address_get_url(lo_address a) char *lo_address_get_hostname(lo_address a) char *lo_address_get_port(lo_address a) int lo_address_get_protocol(lo_address a) const_char* lo_address_errstr(lo_address a) # message lo_message lo_message_new() void lo_message_free(lo_message) void lo_message_add_int32(lo_message m, int32_t a) void lo_message_add_int64(lo_message m, int64_t a) void lo_message_add_float(lo_message m, float a) void lo_message_add_double(lo_message m, double a) void lo_message_add_char(lo_message m, char a) void lo_message_add_string(lo_message m, char *a) void lo_message_add_symbol(lo_message m, char *a) void lo_message_add_true(lo_message m) void lo_message_add_false(lo_message m) void lo_message_add_nil(lo_message m) void lo_message_add_infinitum(lo_message m) void lo_message_add_midi(lo_message m, uint8_t a[4]) void lo_message_add_timetag(lo_message m, lo_timetag a) void lo_message_add_blob(lo_message m, lo_blob a) lo_address lo_message_get_source(lo_message m) # blob lo_blob lo_blob_new(int32_t size, void *data) void lo_blob_free(lo_blob b) void *lo_blob_dataptr(lo_blob b) uint32_t lo_blob_datasize(lo_blob b) # bundle lo_bundle lo_bundle_new(lo_timetag tt) void lo_bundle_free(lo_bundle b) void lo_bundle_add_message(lo_bundle b, char *path, lo_message m) # timetag void lo_timetag_now(lo_timetag *t) pyliblo-0.9.1/src/liblo.pyx0000644000175000017500000006265211521044745013743 0ustar dasdas# # pyliblo - Python bindings for the liblo OSC library # # Copyright (C) 2007-2011 Dominic Sacré # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation; either version 2.1 of the # License, or (at your option) any later version. # __version__ = '0.9.1' from cpython cimport PY_VERSION_HEX cdef extern from 'Python.h': void PyEval_InitThreads() from libc.stdlib cimport malloc, free cdef extern from 'math.h': double modf(double x, double *iptr) from liblo cimport * import inspect as _inspect import weakref as _weakref class _weakref_method: """ Weak reference to a bound method. """ def __init__(self, f): if PY_VERSION_HEX >= 0x03000000: self.func = f.__func__ self.obj = _weakref.ref(f.__self__) else: self.func = f.im_func self.obj = _weakref.ref(f.im_self) def __call__(self): return self.func.__get__(self.obj(), self.obj().__class__) class struct: def __init__(self, **kwargs): for k, v in kwargs.items(): setattr(self, k, v) cdef str _decode(s): # convert to standard string type, depending on python version if PY_VERSION_HEX >= 0x03000000 and isinstance(s, bytes): return s.decode() else: return s cdef bytes _encode(s): # convert unicode to bytestring if isinstance(s, unicode): return s.encode() else: return s # forward declarations cdef class _ServerBase cdef class Address cdef class Message cdef class Bundle # liblo protocol constants UDP = LO_UDP TCP = LO_TCP UNIX = LO_UNIX ################################################################################ # timetag ################################################################################ cdef lo_timetag _double_to_timetag(double f): cdef lo_timetag tt cdef double intr, frac frac = modf(f, &intr) tt.sec = intr tt.frac = (frac * 4294967296.0) return tt cdef double _timetag_to_double(lo_timetag tt): return tt.sec + ((tt.frac) / 4294967296.0) def time(): """ time() Returns the current time as a float in OSC format, that is, the number of seconds since the epoch (January 1, 1900). """ cdef lo_timetag tt lo_timetag_now(&tt) return _timetag_to_double(tt) ################################################################################ # send ################################################################################ cdef _send(target, _ServerBase src, args): cdef lo_server from_server cdef Address target_address cdef int r # convert target to Address object, if necessary if isinstance(target, Address): target_address = target elif isinstance(target, tuple): # unpack tuple target_address = Address(*target) else: target_address = Address(target) # 'from' parameter is NULL if no server was specified from_server = src._server if src else NULL if isinstance(args[0], (Message, Bundle)): # args is already a list of Messages/Bundles packets = args else: # make a single Message from all arguments packets = [Message(*args)] # send all packets for p in packets: if isinstance(p, Message): message = p r = lo_send_message_from(target_address._address, from_server, message._path, message._message) else: bundle = p r = lo_send_bundle_from(target_address._address, from_server, bundle._bundle) if r == -1: raise IOError("sending failed: %s" % lo_address_errstr(target_address._address)) def send(target, *args): """ send(target, message) send(target, bundle) send(target, path[, arg, ...]) Sends a message or bundle to the the given target, without requiring a server. target may be an Address object, a port number, a (hostname, port) tuple, or a URL. Exceptions: AddressError, IOError """ _send(target, None, args) ################################################################################ # Server ################################################################################ class ServerError(Exception): """ Exception raised when creating a liblo OSC server fails. """ def __init__(self, num, msg, where): self.num = num self.msg = msg self.where = where def __str__(self): s = "server error %d" % self.num if self.where: s += " in %s" % self.where s += ": %s" % self.msg return s cdef int _callback(const_char *path, const_char *types, lo_arg **argv, int argc, lo_message msg, void *cb_data) with gil: cdef int i cdef char t cdef unsigned char *ptr cdef uint32_t size, j args = [] for i from 0 <= i < argc: t = types[i] if t == 'i': v = argv[i].i elif t == 'h': v = argv[i].h elif t == 'f': v = argv[i].f elif t == 'd': v = argv[i].d elif t == 'c': v = chr(argv[i].c) elif t == 's': v = _decode(&argv[i].s) elif t == 'S': v = _decode(&argv[i].s) elif t == 'T': v = True elif t == 'F': v = False elif t == 'N': v = None elif t == 'I': v = float('inf') elif t == 'm': v = (argv[i].m[0], argv[i].m[1], argv[i].m[2], argv[i].m[3]) elif t == 't': v = _timetag_to_double(argv[i].t) elif t == 'b': if PY_VERSION_HEX >= 0x03000000: v = bytes(lo_blob_dataptr(argv[i])) else: # convert binary data to python list v = [] ptr = lo_blob_dataptr(argv[i]) size = lo_blob_datasize(argv[i]) for j from 0 <= j < size: v.append(ptr[j]) else: v = None # unhandled data type args.append(v) cdef char *url = lo_address_get_url(lo_message_get_source(msg)) src = Address(url) free(url) cb = cb_data if isinstance(cb.func, _weakref_method): func = cb.func() else: func = cb.func func_args = (_decode(path), args, _decode(types), src, cb.user_data) # call function if _inspect.getargspec(func)[1] == None: # determine number of arguments to call the function with n = len(_inspect.getargspec(func)[0]) if _inspect.ismethod(func): n -= 1 # self doesn't count r = func(*func_args[0:n]) else: # function has argument list, pass all arguments r = func(*func_args) if r == None: return 0 else: return r cdef void _err_handler(int num, const_char *msg, const_char *where) with gil: # can't raise exception in cdef callback function, so use a global variable # instead global __exception __exception = ServerError(num, msg, None) if where: __exception.where = where # decorator to register callbacks class make_method: """ @make_method(path, typespec[, user_data]) Decorator that basically serves the same purpose as add_method(). Note that @make_method is defined at module scope, and not a member of class Server. """ # counter to keep track of the order in which the callback functions where # defined _counter = 0 def __init__(self, path, types, user_data=None): self.spec = struct(counter=make_method._counter, path=path, types=types, user_data=user_data) make_method._counter += 1 def __call__(self, f): # we can't access the Server object here, because at the time the # decorator is run it doesn't even exist yet, so we store the # path/typespec in the function object instead... if not hasattr(f, '_method_spec'): f._method_spec = [] f._method_spec.append(self.spec) return f # common base class for both Server and ServerThread cdef class _ServerBase: cdef lo_server _server cdef list _keep_refs def __init__(self, **kwargs): self._keep_refs = [] if 'reg_methods' not in kwargs or kwargs['reg_methods']: self.register_methods() def register_methods(self, obj=None): """ register_methods([obj]) Calls add_method() for all methods of obj decorated with @make_method. obj defaults to the Server object itself. This function is called automatically by the Server's init function, unless its reg_methods parameter is False. """ if obj == None: obj = self # find and register methods that were defined using decorators methods = [] for m in _inspect.getmembers(obj): if hasattr(m[1], '_method_spec'): for spec in m[1]._method_spec: methods.append(struct(spec=spec, name=m[1])) # sort by counter methods.sort(key=lambda x: x.spec.counter) for e in methods: self.add_method(e.spec.path, e.spec.types, e.name, e.spec.user_data) def get_url(self): cdef char *tmp = lo_server_get_url(self._server) cdef object r = tmp free(tmp) return _decode(r) def get_port(self): return lo_server_get_port(self._server) def get_protocol(self): return lo_server_get_protocol(self._server) def fileno(self): """ fileno() Returns the file descriptor of the server socket, or -1 if not supported by the underlying server protocol. """ return lo_server_get_socket_fd(self._server) def add_method(self, path, typespec, func, user_data=None): """ add_method(path, typespec, callback_func[, user_data]) Registers a callback function for OSC messages with matching path and argument types. For both path and typespec, None may be used as a wildcard. The optional user_data will be passed on to the callback function. callback_func may be a global function or a class method, pyliblo will know what to do either way. """ cdef char *p cdef char *t if isinstance(path, (bytes, unicode)): s = _encode(path) p = s elif path == None: p = NULL else: raise TypeError("path must be a string or None") if isinstance(typespec, (bytes, unicode)): s2 = _encode(typespec) t = s2 elif typespec == None: t = NULL else: raise TypeError("typespec must be a string or None") # use a weak reference if func is a method, to avoid circular references # in cases where func is a method an object that also has a reference to # the server (e.g. when deriving from the Server class) if _inspect.ismethod(func): func = _weakref_method(func) cb = struct(func=func, user_data=user_data) self._keep_refs.append(cb) lo_server_add_method(self._server, p, t, _callback, cb) def send(self, target, *args): """ send(target, message) send(target, bundle) send(target, path[, arg, ...]) Sends a message or bundle from this server to the the given target. target may be an Address object, a port number, a (hostname, port) tuple, or a URL. Exceptions: AddressError, IOError """ _send(target, self, args) property url: """ The server's URL. """ def __get__(self): return self.get_url() property port: """ The server's port number. """ def __get__(self): return self.get_port() property protocol: """ The server's protocol (one of the constants UDP, TCP, UNIX). """ def __get__(self): return self.get_protocol() cdef class Server(_ServerBase): """ Server([port[, proto[, **kwargs]]]) Creates a new Server object, which can receive OSC messages. port may be a decimal port number or a UNIX socket path. If omitted, an arbitrary free UDP port will be used. proto can be one of the constants UDP, TCP, UNIX. Optional keyword arguments: reg_methods: False if you don't want the init function to automatically register callbacks defined with the @make_method decorator. Exceptions: ServerError """ def __init__(self, port=None, proto=LO_DEFAULT, **kwargs): cdef char *cs if port != None: p = _encode(str(port)); cs = p else: cs = NULL global __exception __exception = None self._server = lo_server_new_with_proto(cs, proto, _err_handler) if __exception: raise __exception _ServerBase.__init__(self, **kwargs) def __dealloc__(self): self.free() def free(self): """ free() Frees the underlying server object and closes its port. Note that this will also happen automatically when the server is garbage-collected. """ if self._server: lo_server_free(self._server) self._server = NULL def recv(self, timeout=None): """ recv([timeout]) Receives and dispatches one OSC message. Blocking by default, unless timeout (in ms) is specified. timeout may be 0, in which case recv() returns immediately. Returns True if a message was received, False otherwise. """ cdef int t, r if timeout != None: t = timeout with nogil: r = lo_server_recv_noblock(self._server, t) return r and True or False else: with nogil: lo_server_recv(self._server) return True cdef class ServerThread(_ServerBase): """ ServerThread([port[, proto[, **kwargs]]]) Creates a new ServerThread object, which can receive OSC messages. Unlike Server, ServerThread uses its own thread which runs in the background to dispatch messages. Note that callback methods will not be run in the main Python thread! port may be a decimal port number or a UNIX socket path. If omitted, an arbitrary free UDP port will be used. proto can be one of the constants UDP, TCP, UNIX. Optional keyword arguments: reg_methods: False if you don't want the init function to automatically register callbacks defined with the @make_method decorator. Exceptions: ServerError """ cdef lo_server_thread _server_thread def __init__(self, port=None, proto=LO_DEFAULT, **kwargs): cdef char *cs if port != None: p = _encode(str(port)); cs = p else: cs = NULL # make sure python can handle threading PyEval_InitThreads() global __exception __exception = None self._server_thread = lo_server_thread_new_with_proto(cs, proto, _err_handler) if __exception: raise __exception self._server = lo_server_thread_get_server(self._server_thread) _ServerBase.__init__(self, **kwargs) def __dealloc__(self): self.free() def free(self): """ free() Frees the underlying server object and closes its port. Note that this will also happen automatically when the server is garbage-collected. """ if self._server_thread: lo_server_thread_free(self._server_thread) self._server_thread = NULL self._server = NULL def start(self): """ start() Starts the server thread, liblo will now start to dispatch any messages it receives. """ lo_server_thread_start(self._server_thread) def stop(self): """ stop() Stops the server thread. """ lo_server_thread_stop(self._server_thread) ################################################################################ # Address ################################################################################ class AddressError(Exception): """ Exception raised when trying to create an invalid Address object. """ def __init__(self, msg): self.msg = msg def __str__(self): return "address error: %s" % self.msg cdef class Address: """ Address(hostname, port[, proto]) Address(port) Address(url) Creates a new Address object from the given hostname/port or URL. proto can be one of the constants UDP, TCP, UNIX. Exceptions: AddressError """ cdef lo_address _address def __init__(self, addr, addr2=None, proto=LO_UDP): if addr2: # Address(host, port[, proto]) s = _encode(addr) s2 = _encode(str(addr2)) self._address = lo_address_new_with_proto(proto, s, s2) if not self._address: raise AddressError("invalid protocol") elif isinstance(addr, int) or (isinstance(addr, str) and addr.isdigit()): # Address(port) s = str(addr).encode() self._address = lo_address_new(NULL, s) else: # Address(url) s = _encode(addr) self._address = lo_address_new_from_url(s) # lo_address_errno() is of no use if self._addr == NULL if not self._address: raise AddressError("invalid URL '%s'" % str(addr)) def __dealloc__(self): lo_address_free(self._address) def get_url(self): cdef char *tmp = lo_address_get_url(self._address) cdef object r = tmp free(tmp) return _decode(r) def get_hostname(self): return _decode(lo_address_get_hostname(self._address)) def get_port(self): cdef bytes s = lo_address_get_port(self._address) if s.isdigit(): return int(s) else: return _decode(s) def get_protocol(self): return lo_address_get_protocol(self._address) property url: """ The address' URL. """ def __get__(self): return self.get_url() property hostname: """ The address' hostname. """ def __get__(self): return self.get_hostname() property port: """ The address' port number. """ def __get__(self): return self.get_port() property protocol: """ The address' protocol (one of the constants UDP, TCP, UNIX). """ def __get__(self): return self.get_protocol() ################################################################################ # Message ################################################################################ cdef class _Blob: cdef lo_blob _blob def __init__(self, arr): # arr can by any sequence type cdef unsigned char *p cdef uint32_t size, i size = len(arr) if size < 1: raise ValueError("blob is empty") # copy each element of arr to a C array p = malloc(size) try: if isinstance(arr[0], (str, unicode)): # use ord() if arr is a string (but not bytes) for i from 0 <= i < size: p[i] = ord(arr[i]) else: for i from 0 <= i < size: p[i] = arr[i] # build blob self._blob = lo_blob_new(size, p) finally: free(p) def __dealloc__(self): lo_blob_free(self._blob) cdef class Message: """ Message(path[, arg, ...]) Creates a new Message object. """ cdef bytes _path cdef lo_message _message cdef list _keep_refs def __init__(self, path, *args): self._keep_refs = [] # encode path to bytestring if necessary self._path = _encode(path) self._message = lo_message_new() self.add(*args) def __dealloc__(self): lo_message_free(self._message) def add(self, *args): """ add(arg[, ...]) Appends the given argument(s) to the message. """ for arg in args: if (isinstance(arg, tuple) and len(arg) <= 2 and isinstance(arg[0], (bytes, unicode)) and len(arg[0]) == 1): # type explicitly specified if len(arg) == 2: self._add(arg[0], arg[1]) else: self._add(arg[0], None) else: # detect type automatically self._add_auto(arg) cdef _add(self, type, value): cdef uint8_t midi[4] # accept both bytes and unicode as type specifier cdef char t = ord(_decode(type)[0]) if t == 'i': lo_message_add_int32(self._message, int(value)) elif t == 'h': lo_message_add_int64(self._message, long(value)) elif t == 'f': lo_message_add_float(self._message, float(value)) elif t == 'd': lo_message_add_double(self._message, float(value)) elif t == 'c': lo_message_add_char(self._message, ord(value)) elif t == 's': s = _encode(value) lo_message_add_string(self._message, s) elif t == 'S': s = _encode(value) lo_message_add_symbol(self._message, s) elif t == 'T': lo_message_add_true(self._message) elif t == 'F': lo_message_add_false(self._message) elif t == 'N': lo_message_add_nil(self._message) elif t == 'I': lo_message_add_infinitum(self._message) elif t == 'm': for n from 0 <= n < 4: midi[n] = value[n] lo_message_add_midi(self._message, midi) elif t == 't': lo_message_add_timetag(self._message, _double_to_timetag(value)) elif t == 'b': b = _Blob(value) # make sure the blob is not deleted as long as this message exists self._keep_refs.append(b) lo_message_add_blob(self._message, (<_Blob>b)._blob) else: raise TypeError("unknown OSC data type '%c'" % t) cdef _add_auto(self, value): # bool is a subclass of int, so check those first if value is True: lo_message_add_true(self._message) elif value is False: lo_message_add_false(self._message) elif isinstance(value, int): lo_message_add_int32(self._message, int(value)) elif isinstance(value, long): lo_message_add_int64(self._message, long(value)) elif isinstance(value, float): lo_message_add_float(self._message, float(value)) elif isinstance(value, (bytes, unicode)): s = _encode(value) lo_message_add_string(self._message, s) elif value == None: lo_message_add_nil(self._message) elif value == float('inf'): lo_message_add_infinitum(self._message) else: # last chance: could be a blob try: iter(value) except TypeError: raise TypeError("unsupported message argument type") self._add('b', value) ################################################################################ # Bundle ################################################################################ cdef class Bundle: """ Bundle([timetag, ][message, ...]) Creates a new Bundle object. You can optionally specify a time at which the messages should be dispatched (as an OSC timetag float), and any number of messages to be included in the bundle. """ cdef lo_bundle _bundle cdef list _keep_refs def __init__(self, *messages): cdef lo_timetag tt tt.sec, tt.frac = 0, 0 self._keep_refs = [] if len(messages) and not isinstance(messages[0], Message): t = messages[0] if isinstance(t, (float, int, long)): tt = _double_to_timetag(t) elif isinstance(t, tuple) and len(t) == 2: tt.sec, tt.frac = t else: raise TypeError("invalid timetag") # first argument was timetag, so continue with second messages = messages[1:] self._bundle = lo_bundle_new(tt) if len(messages): self.add(*messages) def __dealloc__(self): lo_bundle_free(self._bundle) def add(self, *args): """ add(message[, ...]) add(path[, arg, ...]) Adds one or more messages to the bundle. """ if isinstance(args[0], Message): # args is already a list of Messages messages = args else: # make a single Message from all arguments messages = [Message(*args)] # add all messages for m in messages: self._keep_refs.append(m) message = m lo_bundle_add_message(self._bundle, message._path, message._message) pyliblo-0.9.1/NEWS0000644000175000017500000000653411521046720012000 0ustar dasdas2011-01-29: pyliblo 0.9.1 * Changed send functions to raise an IOError if sending failed (probaby most useful with TCP connections). * Lots of code cleanup and deobfuscation. * Included unit tests in release tarball. 2010-10-22: pyliblo 0.9.0 * Support Python 3.x. As a result, pyliblo can no longer be built with Pyrex, and requires Cython >= 0.12 instead. * Added free() method to Server and ServerThread classes. * Added fileno() method to Server and ServerThread classes (thanks to Edward George). * Prefer read-only properties over getter methods (which still exist, but are now deprecated). * Added proper docstrings (copied from the HTML docs). * The minimum version of liblo required by pyliblo is now 0.26. 2009-11-30: pyliblo 0.8.1 * Release the Python GIL inside Server.recv(). * Fixed a possible segfault when the error handler was called from the * liblo server thread. 2009-09-13: pyliblo 0.8.0 * Changed license from GPL 2 to LGPL 2.1 (as did liblo in version 0.26). * Added protocol parameter to the Server class. Among other things, this allows TCP connections. * The minumum version of liblo required by pyliblo is now 0.24. * pyliblo can now be built with either Pyrex or Cython. 2009-01-19: pyliblo 0.7.2 * Fixed all compiler warnings properly in Pyrex, without patching the generated C code. * Return values of callback functions are no longer ignored, but handled as in liblo. * The send_osc script can now be run with an explicit type string, instead of trying to determine the argument types automatically. 2008-08-03: pyliblo 0.7.1 * Added manpages for send_osc and dump_osc. 2008-03-03: pyliblo 0.7.0 * Fixed memory leaks, caused by failure to free() the result of lo_server_get_url() and lo_address_get_url(). * Added parameter to Server.register_methods() to allow registering functions of an object other than the server itself. * Allow callback functions to have a variable number of arguments (*args). 2007-12-14: pyliblo 0.6.4 * Avoid creating circular references when using methods as callback functions, which in some cases prevented the server object from being deleted properly. 2007-08-10: pyliblo 0.6.3 * Patched the Pyrex-generated code to make it compile without warnings. * Always build from the existing C source by default. 2007-07-29: pyliblo 0.6.2 * Minor code cleanup, hopefully not breaking anything. * Somewhat faster conversion of blob data from and to Python lists. 2007-07-07: pyliblo 0.6.1 * Fixed a bug that caused the floats 0.0 and 1.0 to be sent as boolean. Thanks to Jesse Chappell for the patch. 2007-05-20: pyliblo 0.6 * Added support for sending bundles, optionally with timestamps. * Added previously unsupported OSC data types (timetag, midi, symbol, true/false/nil/infinitum). * New @make_method decorator. * Various bugfixes. 2007-04-28: pyliblo 0.5.1 * Fixed a stupid typo in Server.send(). 2007-04-26: pyliblo 0.5 * Simplified the way arguments are passed to callback functions. For the server side, this release is therefore incompatible with previous versions! * Some more cleanup. 2007-04-02: pyliblo 0.3 * Added class ServerThread for asynchronous dispatching of incoming messages. 2007-04-01: pyliblo 0.2 * Minor improvements. 2007-02-20: pyliblo 0.1 * Initial release. pyliblo-0.9.1/setup.py0000755000175000017500000000360511521044773013020 0ustar dasdas#!/usr/bin/env python # -*- coding: utf-8 -*- from distutils.core import setup, Extension from distutils.command.build_scripts import build_scripts from distutils import util, log import os, sys if '--with-cython' in sys.argv: from Cython.Distutils import build_ext sys.argv.remove('--with-cython') use_cython = True else: use_cython = False class build_scripts_rename(build_scripts): def copy_scripts(self): build_scripts.copy_scripts(self) # remove the .py extension from scripts for s in self.scripts: f = util.convert_path(s) before = os.path.join(self.build_dir, os.path.basename(f)) after = os.path.splitext(before)[0] log.info("renaming %s -> %s" % (before, after)) os.rename(before, after) cmdclass = { 'build_scripts': build_scripts_rename } ext_modules = [ Extension( 'liblo', [use_cython and 'src/liblo.pyx' or 'src/liblo.c'], extra_compile_args = [ '-fno-strict-aliasing', '-Werror-implicit-function-declaration', '-Wfatal-errors', ], libraries = ['lo'] ) ] if use_cython: cmdclass['build_ext'] = build_ext if sys.hexversion < 0x03000000: scripts = [ 'scripts/send_osc.py', 'scripts/dump_osc.py', ] data_files = [ ('share/man/man1', [ 'scripts/send_osc.1', 'scripts/dump_osc.1', ]), ] else: # doesn't work with Python 3.x yet scripts = [] data_files = [] setup ( name = 'pyliblo', version = '0.9.1', author = 'Dominic Sacre', author_email = 'dominic.sacre@gmx.de', url = 'http://das.nasophon.de/pyliblo/', description = 'Python bindings for the liblo OSC library', license = 'LGPL', scripts = scripts, data_files = data_files, cmdclass = cmdclass, ext_modules = ext_modules ) pyliblo-0.9.1/README0000644000175000017500000000117511520673167012167 0ustar dasdaspyliblo - Python bindings for the liblo OSC library Copyright (C) 2007-2011 Dominic Sacré http://das.nasophon.de/pyliblo/ To install, run "./setup.py build", followed by "./setup.py install". This will install both the python module and the send_osc/dump_osc scripts. The C source file generated by Cython is included in the distribution, so it's not necessary to have Cython installed in order to build pyliblo. To build from the original Cython source anyway, remove src/liblo.c, then pass '--with-cython' to setup.py. See doc/API.html and doc/examples.html for API documentation and some example code. pyliblo-0.9.1/doc/0000755000175000017500000000000011345273303012041 5ustar dasdaspyliblo-0.9.1/doc/examples.html0000644000175000017500000000716211345273303014553 0ustar dasdas pyliblo - Example Code

pyliblo - Example Code

Just some useless code to show what you can do with pyliblo.

Also take a look at the send_osc and dump_osc scripts, for tiny but functional examples.

Example Client

#!/usr/bin/env python

import liblo, sys

# send all messages to port 1234 on the local machine
try:
    target = liblo.Address(1234)
except liblo.AddressError, err:
    print str(err)
    sys.exit()

# send message "/foo/message1" with int, float and string arguments
liblo.send(target, "/foo/message1", 123, 456.789, "test")

# send double, int64 and char
liblo.send(target, "/foo/message2", ('d', 3.1415), ('h', 2**42), ('c', 'x'))

# we can also build a message object first...
msg = liblo.Message("/foo/blah")
# ... append arguments later...
msg.add(123, "foo")
# ... and then send it
liblo.send(target, msg)

# send a list of bytes as a blob
blob = [4, 8, 15, 16, 23, 42]
liblo.send(target, "/foo/blob", blob)

# wrap a message in a bundle, to be dispatched after 2 seconds
bundle = liblo.Bundle(liblo.time() + 2.0, liblo.Message("/blubb", 123))
liblo.send(target, bundle)

Example Server

#!/usr/bin/env python

import liblo, sys

# create server, listening on port 1234
try:
    server = liblo.Server(1234)
except liblo.ServerError, err:
    print str(err)
    sys.exit()

def foo_bar_callback(path, args):
    i, f = args
    print "received message '%s' with arguments '%d' and '%f'" % (path, i, f)

def foo_baz_callback(path, args, types, src, data):
    print "received message '%s'" % path
    print "blob contains %d bytes, user data was '%s'" % (len(args[0]), data)

def fallback(path, args, types, src):
    print "got unknown message '%s' from '%s'" % (path, src.url)
    for a, t in zip(args, types):
        print "argument of type '%s': %s" % (t, a)

# register method taking an int and a float
server.add_method("/foo/bar", 'if', foo_bar_callback)

# register method taking a blob, and passing user data to the callback
server.add_method("/foo/baz", 'b', foo_baz_callback, "blah")

# register a fallback for unhandled messages
server.add_method(None, None, fallback)

# loop and dispatch messages every 100ms
while True:
    server.recv(100)

Example ServerThread, using the @make_method decorator

#!/usr/bin/env python

from liblo import *
import sys

class MyServer(ServerThread):
    def __init__(self):
        ServerThread.__init__(self, 1234)

    @make_method('/foo', 'ifs')
    def foo_callback(self, path, args):
        i, f, s = args
        print "received message '%s' with arguments: %d, %f, %s" % (path, i, f, s)

    @make_method(None, None)
    def fallback(self, path, args):
        print "received unknown message '%s'" % path

try:
    server = MyServer()
except ServerError, err:
    print str(err)
    sys.exit()

server.start()
raw_input("press enter to quit...\n")
pyliblo-0.9.1/doc/API.html0000644000175000017500000001767311521022736013354 0ustar dasdas pyliblo - API Documentation

pyliblo 0.9 - API Documentation

For the most part, pyliblo is just a thin wrapper around liblo, which does all the real work. For questions not answered here, also see the liblo documentation.

The Python module is simply called liblo.

functions

send(target, message)
send(target, bundle)
send(target, path[, arg, ...])

Sends a message or bundle to the the given target, without requiring a server.
target may be an Address object, a port number, a (hostname, port) tuple, or a URL.
Exceptions: AddressError, IOError

time()

Returns the current time as a float in OSC format, that is, the number of seconds since the epoch (January 1, 1900).

class Server

Server([port[, proto[, **kwargs]]])

Creates a new Server object, which can receive OSC messages.
port may be a decimal port number or a UNIX socket path. If omitted, an arbitrary free UDP port will be used.
proto can be one of the constants UDP, TCP, UNIX.
Optional keyword arguments:
reg_methods: False if you don't want the init function to automatically register callbacks defined with the @make_method decorator.
Exceptions: ServerError

add_method(path, typespec, callback_func[, user_data])

Registers a callback function for OSC messages with matching path and argument types.
For both path and typespec, None may be used as a wildcard.
The optional user_data will be passed on to the callback function. callback_func may be a global function or a class method, pyliblo will know what to do either way.

@make_method(path, typespec[, user_data])

Decorator that basically serves the same purpose as add_method().
Note that @make_method is defined at module scope, and not a member of class Server.

register_methods([obj])

Calls add_method() for all methods of obj decorated with @make_method. obj defaults to the Server object itself.
This function is called automatically by the Server's init function, unless its reg_methods parameter is False.

my_callback(path, args[, types[, src[, user_data]]])
my_callback(self, path, args[, types[, src[, user_data]]])

User-defined callback function, to be registered using add_method() or @make_method; called when a matching OSC message is received.
args will be a list of message arguments, using appropriate built-in Python data types. types is a string with the typespec of the message. src is an Address object, containing the address the message came from. types, src and user_data may be omitted if not needed.
The callback should return zero (or nothing/None) if the message has been dealt with correctly, or non-zero to look for another matching message handler.

recv([timeout])

Receives and dispatches one OSC message. Blocking by default, unless timeout (in ms) is specified.
timeout may be 0, in which case recv() returns immediately. Returns True if a message was received, False otherwise.

send(target, message)
send(target, bundle)
send(target, path[, arg, ...])

Sends a message or bundle from this server to the the given target.
target may be an Address object, a port number, a (hostname, port) tuple, or a URL.
Exceptions: AddressError, IOError

url
get_url()

The server's URL.

port
get_port()

The server's port number.

protocol
get_protocol()

The server's protocol (one of the constants UDP, TCP, UNIX).

fileno()

Returns the file descriptor of the server socket, or -1 if not supported by the underlying server protocol.

free()

Frees the underlying server object and closes its port. Note that this will also happen automatically when the server is garbage-collected.

class ServerThread

Unlike Server, ServerThread uses its own thread which runs in the background to dispatch messages. Note that callback methods will not be run in the main Python thread!
ServerThread has the same methods as Server, with the exception of recv(). Instead, it defines these two methods:

start()

Starts the server thread, liblo will now start to dispatch any messages it receives.

stop()

Stops the server thread.

class Address

Address(hostname, port[, proto])
Address(port)
Address(url)

Creates a new Address object from the given hostname/port or URL.
proto can be one of the constants UDP, TCP, UNIX.
Exceptions: AddressError

url
get_url()

The address' URL.

hostname
get_hostname()

The address' hostname.

port
get_port()

The address' port number.

protocol
get_protocol()

The address' protocol (one of the constants UDP, TCP, UNIX).

class Message

Message(path[, arg, ...])

Creates a new Message object.

add(arg[, ...])

Appends the given argument(s) to the message.

class Bundle

Bundle([timetag, ][message, ...])

Creates a new Bundle object. You can optionally specify a time at which the messages should be dispatched (as an OSC timetag float), and any number of messages to be included in the bundle.

add(message[, ...])
add(path[, arg, ...])

Adds one or more messages to the bundle.

constants

UDP
TCP
UNIX

Specifies the protocol of a server or address object.

mapping between OSC and Python data types

When constructing a message, pyliblo tries to automatically convert arguments to an appropriate OSC data type, depending on the Python argument. To explicitly specify the OSC data type to be transmitted, pass a (typetag, data) tuple. Some types can't be unambiguously recognized, so they can only be sent that way.
Callback functions always receive their arguments according to the following table:

typetagOSC data typePython data type
'i'int32int
'h'int64long (Python 2.x), int (Python 3.x)
'f'floatfloat
'd'doublefloat
'c'charsingle-character string
's'stringstring
'S'symbolstring
'm'midi4-tuple of ints
't'timetagfloat
'T'true-
'F'false-
'N'nil-
'I'infinitum-
'b'bloblist of ints (Python 2.x), bytes (Python 3.x)
pyliblo-0.9.1/scripts/0000755000175000017500000000000011122311610012746 5ustar dasdaspyliblo-0.9.1/scripts/dump_osc.py0000755000175000017500000000411611520670646015161 0ustar dasdas#!/usr/bin/env python # -*- coding: utf-8 -*- # # pyliblo - Python bindings for the liblo OSC library # # Copyright (C) 2007-2011 Dominic Sacré # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # import sys import liblo class DumpOSC: def blob_to_hex(self, b): return " ".join([ (hex(v/16).upper()[-1] + hex(v%16).upper()[-1]) for v in b ]) def callback(self, path, args, types, src): write = sys.stdout.write ## print source #write("from " + src.get_url() + ": ") # print path write(path + " ,") # print typespec write(types) # loop through arguments and print them for a, t in zip(args, types): write(" ") if t == None: #unknown type write("[unknown type]") elif t == 'b': # it's a blob write("[" + self.blob_to_hex(a) + "]") else: # anything else write(str(a)) write('\n') def __init__(self, port = None): # create server object try: self.server = liblo.Server(port) except liblo.ServerError, err: sys.exit(str(err)) print "listening on URL: " + self.server.get_url() # register callback function for all messages self.server.add_method(None, None, self.callback) def run(self): # just loop and dispatch messages every 10ms while True: self.server.recv(10) if __name__ == '__main__': # display help if len(sys.argv) == 1 or sys.argv[1] in ("-h", "--help"): sys.exit("Usage: " + sys.argv[0] + " port") # require one argument (port number) if len(sys.argv) < 2: sys.exit("please specify a port or URL") app = DumpOSC(sys.argv[1]) try: app.run() except KeyboardInterrupt: del app pyliblo-0.9.1/scripts/send_osc.py0000755000175000017500000000334111520670724015141 0ustar dasdas#!/usr/bin/env python # -*- coding: utf-8 -*- # # pyliblo - Python bindings for the liblo OSC library # # Copyright (C) 2007-2011 Dominic Sacré # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # import sys import liblo def make_message_auto(path, *args): msg = liblo.Message(path) for a in args: try: v = int(a) except ValueError: try: v = float(a) except ValueError: v = a msg.add(v) return msg def make_message_manual(path, types, *args): if len(types) != len(args): sys.exit("length of type string doesn't match number of arguments") msg = liblo.Message(path) try: for a, t in zip(args, types): msg.add((t, a)) except Exception, e: sys.exit(str(e)) return msg if __name__ == '__main__': # display help if len(sys.argv) == 1 or sys.argv[1] in ("-h", "--help"): sys.exit("Usage: " + sys.argv[0] + " port path [,types] [args...]") # require at least two arguments (target port/url and message path) if len(sys.argv) < 2: sys.exit("please specify a port or URL") if len(sys.argv) < 3: sys.exit("please specify a message path") if len(sys.argv) > 3 and sys.argv[3].startswith(','): msg = make_message_manual(sys.argv[2], sys.argv[3][1:], *sys.argv[4:]) else: msg = make_message_auto(*sys.argv[2:]) try: liblo.send(sys.argv[1], msg) except IOError, e: sys.exit(str(e)) else: sys.exit(0) pyliblo-0.9.1/scripts/send_osc.10000644000175000017500000000133311122311610014625 0ustar dasdas.TH send_osc 1 .SH NAME send_osc \- Sends a single OSC message .SH SYNOPSIS .B send_osc \fIport\fP \fIpath\fP [,\fItypes\fP] [\fIargs\fP...] .SH DESCRIPTION .B send_osc sends an OSC message to the specified \fIport\fP (UDP port number, or any other address string supported by liblo). The message is delivered to \fIpath\fP. If the first argument following the path starts with a comma, it's interpreted as a type string, specifying the OSC data types to be used for sending the message arguments. Otherwise, send_osc automatically tries to use appropriate data types. Valid integer and float values are sent as such, anything else is sent as a string. .SH AUTHOR Dominic Sacre .SH SEE ALSO dump_osc(1) pyliblo-0.9.1/scripts/dump_osc.10000644000175000017500000000050111122311602014636 0ustar dasdas.TH dump_osc 1 .SH NAME dump_osc \- Prints incoming OSC messages .SH SYNOPSIS .B dump_osc \fIport\fP .SH DESCRIPTION .B dump_osc prints all OSC messages received on \fIport\fP (UDP port number, or any other address string supported by liblo). .SH AUTHOR Dominic Sacre .SH SEE ALSO send_osc(1) pyliblo-0.9.1/test/0000755000175000017500000000000011520670656012262 5ustar dasdaspyliblo-0.9.1/test/unit.py0000755000175000017500000002114611520670656013622 0ustar dasdas#!/usr/bin/env python # -*- coding: utf-8 -*- # # pyliblo - Python bindings for the liblo OSC library # # Copyright (C) 2007-2011 Dominic Sacré # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # import unittest import re import time import sys import liblo def approx(a, b, e = 0.0002): return abs(a - b) < e def matchHost(host, regex): r = re.compile(regex) return r.match(host) != None class Arguments: def __init__(self, path, args, types, src, data): self.path = path self.args = args self.types = types self.src = src self.data = data class ServerTestCaseBase(unittest.TestCase): def setUp(self): self.cb = None def callback(self, path, args, types, src, data): self.cb = Arguments(path, args, types, src, data) def callback_dict(self, path, args, types, src, data): if self.cb == None: self.cb = { } self.cb[path] = Arguments(path, args, types, src, data) class ServerTestCase(ServerTestCaseBase): def setUp(self): ServerTestCaseBase.setUp(self) self.server = liblo.Server('1234') def tearDown(self): del self.server def testPort(self): assert self.server.get_port() == 1234 def testURL(self): assert matchHost(self.server.get_url(), 'osc\.udp://.*:1234/') def testSendInt(self): self.server.add_method('/foo', 'i', self.callback, "data") self.server.send('1234', '/foo', 123) assert self.server.recv() == True assert self.cb.path == '/foo' assert self.cb.args[0] == 123 assert self.cb.types == 'i' assert self.cb.data == "data" assert matchHost(self.cb.src.get_url(), 'osc\.udp://.*:1234/') def testSendBlob(self): self.server.add_method('/blob', 'b', self.callback) self.server.send('1234', '/blob', [4, 8, 15, 16, 23, 42]) assert self.server.recv() == True if sys.hexversion < 0x03000000: assert self.cb.args[0] == [4, 8, 15, 16, 23, 42] else: assert self.cb.args[0] == b'\x04\x08\x0f\x10\x17\x2a' def testSendVarious(self): self.server.add_method('/blah', 'ihfdscb', self.callback) if sys.hexversion < 0x03000000: self.server.send(1234, '/blah', 123, 2**42, 123.456, 666.666, "hello", ('c', 'x'), (12, 34, 56)) else: self.server.send(1234, '/blah', 123, ('h', 2**42), 123.456, 666.666, "hello", ('c', 'x'), (12, 34, 56)) assert self.server.recv() == True assert self.cb.types == 'ihfdscb' assert len(self.cb.args) == len(self.cb.types) assert self.cb.args[0] == 123 assert self.cb.args[1] == 2**42 assert approx(self.cb.args[2], 123.456) assert approx(self.cb.args[3], 666.666) assert self.cb.args[4] == "hello" assert self.cb.args[5] == 'x' if sys.hexversion < 0x03000000: assert self.cb.args[6] == [12, 34, 56] else: assert self.cb.args[6] == b'\x0c\x22\x38' def testSendOthers(self): self.server.add_method('/blubb', 'tmSTFNI', self.callback) self.server.send(1234, '/blubb', ('t', 666666.666), ('m', (1, 2, 3, 4)), ('S', 'foo'), True, ('F',), None, ('I',)) assert self.server.recv() == True assert self.cb.types == 'tmSTFNI' assert approx(self.cb.args[0], 666666.666) assert self.cb.args[1] == (1, 2, 3, 4) assert self.cb.args[2] == 'foo' assert self.cb.args[3] == True assert self.cb.args[4] == False assert self.cb.args[5] == None assert self.cb.args[6] == float('inf') def testSendMessage(self): self.server.add_method('/blah', 'is', self.callback) m = liblo.Message('/blah', 42, 'foo') self.server.send(1234, m) assert self.server.recv() == True assert self.cb.types == 'is' assert self.cb.args[0] == 42 assert self.cb.args[1] == 'foo' def testSendBundle(self): self.server.add_method('/foo', 'i', self.callback_dict) self.server.add_method('/bar', 's', self.callback_dict) self.server.send(1234, liblo.Bundle( liblo.Message('/foo', 123), liblo.Message('/bar', "blubb") )) assert self.server.recv(100) == True assert self.cb['/foo'].args[0] == 123 assert self.cb['/bar'].args[0] == "blubb" def testSendTimestamped(self): self.server.add_method('/blubb', 'i', self.callback) d = 1.23 t1 = time.time() b = liblo.Bundle(liblo.time() + d) b.add('/blubb', 42) self.server.send(1234, b) while not self.cb: self.server.recv(1) t2 = time.time() assert approx(t2 - t1, d, 0.01) def testSendInvalid(self): try: self.server.send(1234, '/blubb', ('x', 'y')) except TypeError as e: pass else: assert False def testRecvTimeout(self): t1 = time.time() assert self.server.recv(500) == False t2 = time.time() assert t2 - t1 < 0.666 def testRecvImmediate(self): t1 = time.time() assert self.server.recv(0) == False t2 = time.time() assert t2 - t1 < 0.01 class ServerCreationTestCase(unittest.TestCase): def testNoPermission(self): try: s = liblo.Server('22') except liblo.ServerError as e: pass else: assert False def testRandomPort(self): s = liblo.Server() assert 1024 <= s.get_port() <= 65535 def testPort(self): s = liblo.Server(1234) t = liblo.Server('5678') assert s.port == 1234 assert t.port == 5678 assert matchHost(s.url, 'osc\.udp://.*:1234/') def testPortProto(self): s = liblo.Server(1234, liblo.TCP) assert matchHost(s.url, 'osc\.tcp://.*:1234/') class ServerTCPTestCase(ServerTestCaseBase): def setUp(self): ServerTestCaseBase.setUp(self) self.server = liblo.Server('1234', liblo.TCP) def tearDown(self): del self.server def testSendReceive(self): self.server.add_method('/foo', 'i', self.callback) liblo.send(self.server.url, '/foo', 123) assert self.server.recv() == True assert self.cb.path == '/foo' assert self.cb.args[0] == 123 assert self.cb.types == 'i' def testNotReachable(self): try: self.server.send('osc.tcp://192.168.23.42:4711', '/foo', 23, 42) except IOError: pass else: assert False class ServerThreadTestCase(ServerTestCaseBase): def setUp(self): ServerTestCaseBase.setUp(self) self.server = liblo.ServerThread('1234') def tearDown(self): del self.server def testSendAndReceive(self): self.server.add_method('/foo', 'i', self.callback) self.server.send('1234', '/foo', 42) self.server.start() time.sleep(0.2) self.server.stop() assert self.cb.args[0] == 42 class DecoratorTestCase(unittest.TestCase): class TestServer(liblo.Server): def __init__(self): liblo.Server.__init__(self, 1234) @liblo.make_method('/foo', 'ibm') def foo_cb(self, path, args, types, src, data): self.cb = Arguments(path, args, types, src, data) def setUp(self): self.server = self.TestServer() def tearDown(self): del self.server def testSendReceive(self): liblo.send(1234, '/foo', 42, ('b', [4, 8, 15, 16, 23, 42]), ('m', (6, 6, 6, 0))) assert self.server.recv() == True assert self.server.cb.path == '/foo' assert len(self.server.cb.args) == 3 class AddressTestCase(unittest.TestCase): def testPort(self): a = liblo.Address(1234) b = liblo.Address('5678') assert a.port == 1234 assert b.port == 5678 assert a.url == 'osc.udp://localhost:1234/' def testUrl(self): a = liblo.Address('osc.udp://foo:1234/') assert a.url == 'osc.udp://foo:1234/' assert a.hostname == 'foo' assert a.port == 1234 assert a.protocol == liblo.UDP def testHostPort(self): a = liblo.Address('foo', 1234) assert a.url == 'osc.udp://foo:1234/' def testHostPortProto(self): a = liblo.Address('foo', 1234, liblo.TCP) assert a.url == 'osc.tcp://foo:1234/' if __name__ == "__main__": unittest.main() pyliblo-0.9.1/PKG-INFO0000644000175000017500000000037711521046730012376 0ustar dasdasMetadata-Version: 1.0 Name: pyliblo Version: 0.9.1 Summary: Python bindings for the liblo OSC library Home-page: http://das.nasophon.de/pyliblo/ Author: Dominic Sacre Author-email: dominic.sacre@gmx.de License: LGPL Description: UNKNOWN Platform: UNKNOWN