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/pyext.cpp | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) (limited to 'externals/grill/py/source/pyext.cpp') 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