[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kdev-python/1.7] /: Fix for introspection script to enable possibility of introspecting in-project
From: Sven Brauch <svenbrauch () googlemail ! com>
Date: 2015-03-20 21:27:37
Message-ID: E1YZ4S9-00043e-26 () scm ! kde ! org
[Download RAW message or body]
Git commit af6df34961c27a9df528ef618c359704701a23f9 by Sven Brauch, on behalf of Vladimir Berezenko.
Committed on 20/03/2015 at 21:26.
Pushed by brauch into branch '1.7'.
Fix for introspection script to enable possibility of introspecting in-project packages
REVIEW:123089
M +16 -2 docfilekcm/docfilewizard.cpp
M +4 -1 documentation_src/introspection/introspect.py
M +1 -0 duchain/CMakeLists.txt
http://commits.kde.org/kdev-python/af6df34961c27a9df528ef618c359704701a23f9
diff --git a/docfilekcm/docfilewizard.cpp b/docfilekcm/docfilewizard.cpp
index ec609fd..f9b82da 100644
--- a/docfilekcm/docfilewizard.cpp
+++ b/docfilekcm/docfilewizard.cpp
@@ -40,6 +40,11 @@
#include <KDialog>
#include <KMessageBox>
#include <KProcess>
+#include <interfaces/icore.h>
+#include <interfaces/iproject.h>
+#include <interfaces/iprojectcontroller.h>
+#include <project/projectmodel.h>
+#include <util/path.h>
DocfileWizard::DocfileWizard(const QString& workingDirectory, QWidget* parent)
: QDialog(parent)
@@ -179,8 +184,17 @@ bool DocfileWizard::run()
// can never have too many slashes
outputFile.setFileName(workingDirectory + "/" + outputFilename);
-
- worker->start(interpreter, QStringList() << scriptUrl << module);
+
+ QList<KDevelop::IProject*> projs = KDevelop::ICore::self()->projectController()->projects();
+ QStringList args;
+ args << scriptUrl;
+ foreach(const KDevelop::IProject* proj, projs)
+ {
+ if ( proj )
+ args << proj->path().toLocalFile();
+ }
+ args << module;
+ worker->start(interpreter, args);
return true;
}
diff --git a/documentation_src/introspection/introspect.py b/documentation_src/introspection/introspect.py
index ebf8427..5992248 100644
--- a/documentation_src/introspection/introspect.py
+++ b/documentation_src/introspection/introspect.py
@@ -359,7 +359,10 @@ def dumperForObject(object, memberName, root):
if __name__ == '__main__':
try:
- dumper = ModuleDumper(importlib.import_module(sys.argv[1]))
+ argscount = len(sys.argv)
+ for arg in range(1, argscount-2):
+ sys.path.insert(1, sys.argv[arg])
+ dumper = ModuleDumper(importlib.import_module(sys.argv[-1]))
except IndexError:
debugmsg("Usage: introspect.py <python_module_name>")
exit(1)
diff --git a/duchain/CMakeLists.txt b/duchain/CMakeLists.txt
index 1fe9a77..bbf91ce 100644
--- a/duchain/CMakeLists.txt
+++ b/duchain/CMakeLists.txt
@@ -39,6 +39,7 @@ target_link_libraries( kdev4pythonduchain LINK_PRIVATE
${KDE4_KTEXTEDITOR_LIBS}
${KDEVPLATFORM_INTERFACES_LIBRARIES}
${QT_QTWEBKIT_LIBRARY}
+ ${KDEVPLATFORM_UTIL_LIBRARIES}
kdev4pythonparser
)
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic