[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kdev-python] /: Fix for introspection script to enable possibility of introspecting in-project pack
From:       Sven Brauch <svenbrauch () googlemail ! com>
Date:       2015-03-20 21:27:40
Message-ID: E1YZ4SC-00044m-BO () scm ! kde ! org
[Download RAW message or body]

Git commit 93e53490e13080c317e8d94201cb0bf5a7a33705 by Sven Brauch, on behalf of \
Vladimir Berezenko. Committed on 20/03/2015 at 21:26.
Pushed by brauch into branch 'master'.

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  +2    -1    duchain/CMakeLists.txt

http://commits.kde.org/kdev-python/93e53490e13080c317e8d94201cb0bf5a7a33705

diff --git a/docfilekcm/docfilewizard.cpp b/docfilekcm/docfilewizard.cpp
index 915784e..2400e0d 100644
--- a/docfilekcm/docfilewizard.cpp
+++ b/docfilekcm/docfilewizard.cpp
@@ -39,6 +39,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)
@@ -177,8 +182,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 540685a..0b73a8c 100644
--- a/documentation_src/introspection/introspect.py
+++ b/documentation_src/introspection/introspect.py
@@ -518,7 +518,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 9faa2b9..670757e 100644
--- a/duchain/CMakeLists.txt
+++ b/duchain/CMakeLists.txt
@@ -44,8 +44,9 @@ target_link_libraries( kdevpythonduchain LINK_PRIVATE
     KDev::Interfaces
     KDev::Language
     KDev::Project
+    KDev::Util
     kdevpythonparser
- )
+)
 
 install(TARGETS kdevpythonduchain DESTINATION ${INSTALL_TARGETS_DEFAULT_ARGS})
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic