diff options
author | Thomas Grill <xovo@users.sourceforge.net> | 2005-07-18 18:03:12 +0000 |
---|---|---|
committer | Thomas Grill <xovo@users.sourceforge.net> | 2005-07-18 18:03:12 +0000 |
commit | 35a59e7dbce7f5cd6fb8c26e40fc66dfd8384cce (patch) | |
tree | cb2d24e74f150aa72822e468338e077211012dbb /externals/grill/py/source/pybase.h | |
parent | f29a360e5aaaeeb75ec191a4163905a8cf44212a (diff) |
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
Diffstat (limited to 'externals/grill/py/source/pybase.h')
-rw-r--r-- | externals/grill/py/source/pybase.h | 21 |
1 files changed, 19 insertions, 2 deletions
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
|