@@ -113,33 +113,29 PythonQtImport::module_info PythonQtImport::getModuleInfo(PythonQtImporter* self | |||
|
113 | 113 | |
|
114 | 114 | |
|
115 | 115 | /* PythonQtImporter.__init__ |
|
116 | Just store the path argument | |
|
116 | Just store the path argument (or reject if it is in the ignorePaths list | |
|
117 | 117 | */ |
|
118 | 118 | int PythonQtImporter_init(PythonQtImporter *self, PyObject *args, PyObject * /*kwds*/) |
|
119 | 119 | { |
|
120 | 120 | self->_path = NULL; |
|
121 | 121 | |
|
122 | const char* path; | |
|
122 | const char* cpath; | |
|
123 | 123 | if (!PyArg_ParseTuple(args, "s", |
|
124 | &path)) | |
|
124 | &cpath)) | |
|
125 | 125 | return -1; |
|
126 | 126 | |
|
127 | QString path(cpath); | |
|
127 | 128 | if (PythonQt::importInterface()->exists(path)) { |
|
128 | //qDebug("path %s", path); | |
|
129 | QString p(path); | |
|
130 | 129 | const QStringList& ignorePaths = PythonQt::self()->getImporterIgnorePaths(); |
|
131 | foreach(QString a, ignorePaths) { | |
|
132 | if (a==p) { | |
|
130 | foreach(QString ignorePath, ignorePaths) { | |
|
131 | if (path.startsWith(ignorePath)) { | |
|
133 | 132 | PyErr_SetString(PythonQtImportError, |
|
134 | 133 | "path ignored"); |
|
135 | 134 | return -1; |
|
136 | 135 | } |
|
137 | 136 | } |
|
138 | 137 | |
|
139 | self->_path = new QString(p); | |
|
140 | ||
|
141 | //mlabDebugConst("MLABPython", "PythonQtImporter init: " << *self->_path); | |
|
142 | ||
|
138 | self->_path = new QString(path); | |
|
143 | 139 | return 0; |
|
144 | 140 | } else { |
|
145 | 141 | PyErr_SetString(PythonQtImportError, |
General Comments 0
You need to be logged in to leave comments.
Login now