Fixed an issue parsing sources in the various UML like diagrams.

Sat, 05 May 2012 19:23:18 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 05 May 2012 19:23:18 +0200
changeset 1845
d481279d882b
parent 1844
0388a36b5fcf
child 1851
8809e87fcbee
child 1855
93bf1823466a

Fixed an issue parsing sources in the various UML like diagrams.

Graphics/ApplicationDiagram.py file | annotate | diff | comparison | revisions
Graphics/ImportsDiagram.py file | annotate | diff | comparison | revisions
Graphics/PackageDiagram.py file | annotate | diff | comparison | revisions
Graphics/UMLClassDiagram.py file | annotate | diff | comparison | revisions
--- a/Graphics/ApplicationDiagram.py	Sat May 05 18:55:21 2012 +0200
+++ b/Graphics/ApplicationDiagram.py	Sat May 05 19:23:18 2012 +0200
@@ -19,6 +19,8 @@
 import Utilities.ModuleParser
 import Utilities
 
+import Preferences
+
 
 class ApplicationDiagram(UMLDialog):
     """
@@ -52,6 +54,8 @@
         
         @return dictionary of modules contained in the application.
         """
+        extensions = Preferences.getPython("PythonExtensions") + \
+            Preferences.getPython("Python3Extensions") + ['.rb']
         moduleDict = {}
         mods = self.project.pdata["SOURCES"]
         modules = []
@@ -71,7 +75,7 @@
                 if module.endswith("__init__.py"):
                     continue
                 try:
-                    mod = Utilities.ModuleParser.readModule(module)
+                    mod = Utilities.ModuleParser.readModule(module, extensions=extensions)
                 except ImportError:
                     continue
                 else:
--- a/Graphics/ImportsDiagram.py	Sat May 05 18:55:21 2012 +0200
+++ b/Graphics/ImportsDiagram.py	Sat May 05 19:23:18 2012 +0200
@@ -64,6 +64,8 @@
         
         @return dictionary of modules contained in the package.
         """
+        extensions = Preferences.getPython("PythonExtensions") + \
+                     Preferences.getPython("Python3Extensions")
         moduleDict = {}
         modules = []
         for ext in Preferences.getPython("PythonExtensions") + \
@@ -83,7 +85,8 @@
                 QApplication.processEvents()
                 prog = prog + 1
                 try:
-                    mod = Utilities.ModuleParser.readModule(module, caching=False)
+                    mod = Utilities.ModuleParser.readModule(module, extensions=extensions,
+                                                            caching=False)
                 except ImportError:
                     continue
                 else:
--- a/Graphics/PackageDiagram.py	Sat May 05 18:55:21 2012 +0200
+++ b/Graphics/PackageDiagram.py	Sat May 05 19:23:18 2012 +0200
@@ -68,6 +68,8 @@
             ['*{0}'.format(ext) for ext in Preferences.getPython("PythonExtensions")] + \
             ['*{0}'.format(ext) for ext in Preferences.getPython("Python3Extensions")] + \
             ['*.rb']
+        extensions = Preferences.getPython("PythonExtensions") + \
+            Preferences.getPython("Python3Extensions") + ['.rb']
         
         moduleDict = {}
         modules = []
@@ -85,7 +87,7 @@
                 QApplication.processEvents()
                 prog += 1
                 try:
-                    mod = Utilities.ModuleParser.readModule(module)
+                    mod = Utilities.ModuleParser.readModule(module, extensions=extensions)
                 except ImportError:
                     continue
                 else:
--- a/Graphics/UMLClassDiagram.py	Sat May 05 18:55:21 2012 +0200
+++ b/Graphics/UMLClassDiagram.py	Sat May 05 19:23:18 2012 +0200
@@ -12,6 +12,7 @@
 from PyQt4.QtGui import QGraphicsTextItem
 
 import Utilities.ModuleParser
+import Preferences
 
 from .UMLDialog import UMLDialog
 from .ClassItem import ClassItem, ClassModel
@@ -63,7 +64,9 @@
         The algorithm is borrowed from Boa Constructor.
         """
         try:
-            module = Utilities.ModuleParser.readModule(self.file)
+            extensions = Preferences.getPython("PythonExtensions") + \
+                Preferences.getPython("Python3Extensions") + ['.rb']
+            module = Utilities.ModuleParser.readModule(self.file, extensions=extensions)
         except ImportError:
             ct = QGraphicsTextItem(None, self.scene)
             ct.setHtml(

eric ide

mercurial