From 054959ca17a1fd9564619b4fd1aba51c15e82f80 2009-05-04 08:10:05 From: florianlink Date: 2009-05-04 08:10:05 Subject: [PATCH] changed so that paths are ignored when they startWith() an ignore path instead of matching the ignore path git-svn-id: svn://svn.code.sf.net/p/pythonqt/code/trunk@76 ea8d5007-eb21-0410-b261-ccb3ea6e24a9 --- diff --git a/src/PythonQtImporter.cpp b/src/PythonQtImporter.cpp index d02f360..5dd665c 100644 --- a/src/PythonQtImporter.cpp +++ b/src/PythonQtImporter.cpp @@ -113,33 +113,29 @@ PythonQtImport::module_info PythonQtImport::getModuleInfo(PythonQtImporter* self /* PythonQtImporter.__init__ - Just store the path argument + Just store the path argument (or reject if it is in the ignorePaths list */ int PythonQtImporter_init(PythonQtImporter *self, PyObject *args, PyObject * /*kwds*/) { self->_path = NULL; - const char* path; + const char* cpath; if (!PyArg_ParseTuple(args, "s", - &path)) + &cpath)) return -1; + QString path(cpath); if (PythonQt::importInterface()->exists(path)) { - //qDebug("path %s", path); - QString p(path); const QStringList& ignorePaths = PythonQt::self()->getImporterIgnorePaths(); - foreach(QString a, ignorePaths) { - if (a==p) { + foreach(QString ignorePath, ignorePaths) { + if (path.startsWith(ignorePath)) { PyErr_SetString(PythonQtImportError, "path ignored"); return -1; } } - self->_path = new QString(p); - - //mlabDebugConst("MLABPython", "PythonQtImporter init: " << *self->_path); - + self->_path = new QString(path); return 0; } else { PyErr_SetString(PythonQtImportError,