From dc05dfe881d86f2bf5f6c0c9ccf8d847a6ec376d Mon Sep 17 00:00:00 2001 From: Thomas Grill Date: Sun, 26 Sep 2004 23:03:16 +0000 Subject: "" svn path=/trunk/; revision=2057 --- externals/grill/py/source/main.cpp | 4 ++-- externals/grill/py/source/main.h | 2 +- externals/grill/py/source/pyext.cpp | 35 ++++++++++++++++++++--------------- 3 files changed, 23 insertions(+), 18 deletions(-) (limited to 'externals/grill/py/source') diff --git a/externals/grill/py/source/main.cpp b/externals/grill/py/source/main.cpp index 6a28acc9..8c46b037 100644 --- a/externals/grill/py/source/main.cpp +++ b/externals/grill/py/source/main.cpp @@ -31,8 +31,8 @@ V py::lib_setup() Py_Initialize(); #ifdef FLEXT_DEBUG - Py_DebugFlag = 1; -// Py_VerboseFlag = 1; +// Py_DebugFlag = 1; + Py_VerboseFlag = 1; #endif #ifdef FLEXT_THREADS diff --git a/externals/grill/py/source/main.h b/externals/grill/py/source/main.h index 581efde5..9178a4d7 100644 --- a/externals/grill/py/source/main.h +++ b/externals/grill/py/source/main.h @@ -29,7 +29,7 @@ WARRANTIES, see the file, "license.txt," in this distribution. #error You need at least flext version 0.4.6 #endif -#define PY__VERSION "0.1.4pre" +#define PY__VERSION "0.1.4" #define PYEXT_MODULE "pyext" // name for module diff --git a/externals/grill/py/source/pyext.cpp b/externals/grill/py/source/pyext.cpp index e8440081..27ad942b 100644 --- a/externals/grill/py/source/pyext.cpp +++ b/externals/grill/py/source/pyext.cpp @@ -11,7 +11,7 @@ WARRANTIES, see the file, "license.txt," in this distribution. #include "pyext.h" #include -FLEXT_LIB_V("pyext pyx",pyext) +FLEXT_LIB_V("pyext pyext. pyx pyx.",pyext) V pyext::Setup(t_classid c) { @@ -125,6 +125,8 @@ pyext::pyext(I argc,const t_atom *argv): apre += 2; } + const t_atom *clname = NULL; + PY_LOCK // init script module @@ -158,20 +160,21 @@ pyext::pyext(I argc,const t_atom *argv): } ++apre; + + // check for alias creation names + if(strrchr(thisName(),'.')) clname = &scr; } Register("_pyext"); -// t_symbol *sobj = NULL; - if(argc > apre) { - // object name - if(!IsString(argv[apre])) - post("%s - object name argument is invalid",thisName()); - else { - methname = GetSymbol(argv[apre]); - } - - ++apre; + if(argc > apre || clname) { + if(!clname) clname = &argv[apre++]; + + // class name + if(!IsString(*clname)) + post("%s - class name argument is invalid",thisName()); + else + methname = GetSymbol(*clname); } if(argc > apre) args(argc-apre,argv+apre); @@ -237,10 +240,12 @@ pyext::pyext(I argc,const t_atom *argv): PY_UNLOCK - FLEXT_ASSERT(inlets >= 0 && outlets >= 0); - - AddInAnything(1+inlets); - AddOutAnything(outlets); + if(inlets < 0 || outlets < 0) + InitProblem(); + else { + AddInAnything(1+inlets); + AddOutAnything(outlets); + } if(!pyobj) InitProblem(); -- cgit v1.2.1