diff options
author | Thomas Grill <xovo@users.sourceforge.net> | 2002-11-26 22:35:57 +0000 |
---|---|---|
committer | Thomas Grill <xovo@users.sourceforge.net> | 2002-11-26 22:35:57 +0000 |
commit | 7017ea71b842451548451125d10acd5c27086e3b (patch) | |
tree | ee55af9f9f4f9b2b1c060545763e553a85e6963d /externals/grill/py/source/main.cpp | |
parent | ae094b15eab3b833bf69a8c26492dc022d09e5fb (diff) |
""
svn path=/trunk/; revision=262
Diffstat (limited to 'externals/grill/py/source/main.cpp')
-rw-r--r-- | externals/grill/py/source/main.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/externals/grill/py/source/main.cpp b/externals/grill/py/source/main.cpp index 65e1d274..2522ff51 100644 --- a/externals/grill/py/source/main.cpp +++ b/externals/grill/py/source/main.cpp @@ -10,7 +10,6 @@ WARRANTIES, see the file, "license.txt," in this distribution. #include "main.h" - V py::lib_setup() { post(""); @@ -127,7 +126,7 @@ V py::m_doc() -V py::SetArgs(I argc,t_atom *argv) +V py::SetArgs(I argc,const t_atom *argv) { // script arguments C **sargv = new C *[argc+1]; @@ -202,8 +201,15 @@ V py::AddToPath(const C *dir) if(dir && *dir) { PyObject *pobj = PySys_GetObject("path"); if(pobj && PyList_Check(pobj)) { - PyObject *ps = PyString_FromString(dir); - PyList_Append(pobj,ps); + int i,n = PyList_Size(pobj); + for(i = 0; i < n; ++i) { + PyObject *pt = PyList_GetItem(pobj,i); + if(PyString_Check(pt) && !strcmp(dir,PyString_AsString(pt))) break; + } + if(i == n) { // string is not yet existent in path + PyObject *ps = PyString_FromString(dir); + PyList_Append(pobj,ps); + } } PySys_SetObject("path",pobj); } |