diff options
author | Thomas Grill <xovo@users.sourceforge.net> | 2004-09-26 23:03:16 +0000 |
---|---|---|
committer | Thomas Grill <xovo@users.sourceforge.net> | 2004-09-26 23:03:16 +0000 |
commit | dc05dfe881d86f2bf5f6c0c9ccf8d847a6ec376d (patch) | |
tree | dc411f38745b75f86f2113d283607f31c83542aa /externals/grill/py/source/pyext.cpp | |
parent | db005cd335dbdecbf2e555c92a40d6ffdea0ca96 (diff) |
""
svn path=/trunk/; revision=2057
Diffstat (limited to 'externals/grill/py/source/pyext.cpp')
-rw-r--r-- | externals/grill/py/source/pyext.cpp | 35 |
1 files changed, 20 insertions, 15 deletions
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 <flinternal.h> -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(); |