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

List:       kde-commits
Subject:    [kdev-python/1.7-py3] /: Fix for introspection script to enable possibility of introspecting in-proj
From:       Sven Brauch <svenbrauch () googlemail ! com>
Date:       2015-03-20 21:27:38
Message-ID: E1YZ4SA-00044D-TK () scm ! kde ! org
[Download RAW message or body]

Git commit 1668f02a5be861891b958652564c20f47bfa2ef7 by Sven Brauch, on behalf of \
Vladimir Berezenko. Committed on 20/03/2015 at 21:26.
Pushed by brauch into branch '1.7-py3'.

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/1668f02a5be861891b958652564c20f47bfa2ef7

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 2df2adf..4c90af6 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 1c1720c..358e6d9 100644
--- a/duchain/CMakeLists.txt
+++ b/duchain/CMakeLists.txt
@@ -38,6 +38,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