From 35a59e7dbce7f5cd6fb8c26e40fc66dfd8384cce Mon Sep 17 00:00:00 2001 From: Thomas Grill Date: Mon, 18 Jul 2005 18:03:12 +0000 Subject: python-like dotted module.function syntax cleaned up float vs. int pyext tags better definition of output values (atoms, lists, anythings) multiply inlets for py (hot and cold inlets) better exception handling and error message fixes for atomic pyext._outlet messages svn path=/trunk/; revision=3358 --- externals/grill/py/source/pybase.h | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'externals/grill/py/source/pybase.h') diff --git a/externals/grill/py/source/pybase.h b/externals/grill/py/source/pybase.h index 068aeb86..f7b6840b 100644 --- a/externals/grill/py/source/pybase.h +++ b/externals/grill/py/source/pybase.h @@ -89,7 +89,7 @@ protected: static bool IsAnything(const t_symbol *s) { return s && s != sym_float && s != sym_int && s != sym_symbol && s != sym_list && s != sym_pointer; } static bool IsAtom(const t_symbol *s) { return s == sym_float || s == sym_int || s == sym_symbol || s == sym_pointer; } - enum retval { nothing,atom,sequ }; +// enum retval { nothing,atom,sequ }; // --- module stuff ----- @@ -136,8 +136,22 @@ protected: bool xlate; bool gencall(PyObject *fun,PyObject *args); + + bool docall(PyObject *fun,PyObject *args) + { + callpy(fun,args); + if(PyErr_Occurred()) { + exchandle(); + return false; + } + else + return true; + } + virtual bool thrcall(void *data) = 0; - virtual bool callpy(PyObject *fun,PyObject *args) = 0; + virtual void callpy(PyObject *fun,PyObject *args) = 0; + + void exchandle(); #if FLEXT_SYS == FLEXT_SYS_MAX static short patcher_myvol(t_patcher *x); @@ -164,6 +178,9 @@ protected: static const t_symbol *sym_fint; // float or int symbol, depending on native number message type + static const t_symbol *getone(t_atom &at,PyObject *arg); + static const t_symbol *getlist(t_atom *lst,PyObject *seq,int cnt,int offs = 0); + public: #ifdef FLEXT_THREADS -- cgit v1.2.1