Update of /cvsroot/pure-data/externals/grill/py/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31376/source
Modified Files: clmeth.cpp py.cpp pyargs.cpp Log Message: None returned by script will bang the output fixes for atomic pyext._outlet messages
Index: clmeth.cpp =================================================================== RCS file: /cvsroot/pure-data/externals/grill/py/source/clmeth.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** clmeth.cpp 9 Jul 2005 13:03:34 -0000 1.22 --- clmeth.cpp 15 Jul 2005 16:13:43 -0000 1.23 *************** *** 168,180 ****
PyObject *val; ! ! bool tp = ! sz == 3 && ! PySequence_Check( ! val = PyTuple_GET_ITEM(args,2) // borrow reference ! );
if(!tp) ! val = PySequence_GetSlice(args,2,sz); // new ref
int o = PyInt_AsLong(outl); --- 168,191 ----
PyObject *val; ! bool tp; ! #if 0 ! if(sz == 3) { ! val = PyTuple_GET_ITEM(args,2); // borrow reference ! Py_INCREF(val); ! tp = PySequence_Check(val); ! } ! else ! tp = false;
if(!tp) ! val = PySequence_GetSlice(args,2,sz); // new ref ! #else ! if(sz == 3) { ! val = PyTuple_GET_ITEM(args,2); // borrow reference ! Py_INCREF(val); ! } ! else ! val = PySequence_GetSlice(args,2,sz); // new ref ! #endif
int o = PyInt_AsLong(outl); *************** *** 191,195 **** PyErr_SetString(PyExc_ValueError,"pyext - _outlet: index out of range");
! if(!tp) Py_DECREF(val); } else --- 202,206 ---- PyErr_SetString(PyExc_ValueError,"pyext - _outlet: index out of range");
! Py_DECREF(val); } else
Index: pyargs.cpp =================================================================== RCS file: /cvsroot/pure-data/externals/grill/py/source/pyargs.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** pyargs.cpp 9 Jul 2005 13:03:34 -0000 1.17 --- pyargs.cpp 15 Jul 2005 16:13:43 -0000 1.18 *************** *** 131,134 **** --- 131,137 ---- if(pValue == NULL) return false;
+ // output bang on None returned + if(pValue == Py_None) return sym_bang; + // analyze return value or tuple
*************** *** 136,140 **** retval tp = nothing;
! if(PyString_Check(pValue)) { rargc = 1; tp = atom; --- 139,143 ---- retval tp = nothing;
! if(PyString_Check(pValue) || pySymbol_Check(pValue)) { rargc = 1; tp = atom; *************** *** 144,149 **** tp = sequ; } ! else if(pValue != Py_None) { ! rargc = 1; tp = atom; } --- 147,152 ---- tp = sequ; } ! else { ! rargc = 1; tp = atom; }
Index: py.cpp =================================================================== RCS file: /cvsroot/pure-data/externals/grill/py/source/py.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** py.cpp 9 Jul 2005 13:03:34 -0000 1.27 --- py.cpp 15 Jul 2005 16:13:43 -0000 1.28 *************** *** 126,130 **** if(argc && CanbeInt(*argv)) { inlets = GetAInt(*argv); ! if(inlets < 1) inlets = 1; argv++,argc--; } --- 126,130 ---- if(argc && CanbeInt(*argv)) { inlets = GetAInt(*argv); ! if(inlets < 0) inlets = 1; argv++,argc--; } *************** *** 353,357 **** } else { ! if(ret != Py_None && !OutObject(this,0,ret) && PyErr_Occurred()) PyErr_Print(); Py_DECREF(ret); --- 353,357 ---- } else { ! if(!OutObject(this,0,ret) && PyErr_Occurred()) PyErr_Print(); Py_DECREF(ret); *************** *** 385,389 **** PyObject *pargs;
! if(objects) { int inlets = CntIn()-1; pargs = PyTuple_New(inlets); --- 385,389 ---- PyObject *pargs;
! if(objects || CntIn() == 1) { int inlets = CntIn()-1; pargs = PyTuple_New(inlets);