summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmile Anclin <emile.anclin@logilab.fr>2010-09-02 18:34:46 +0200
committerEmile Anclin <emile.anclin@logilab.fr>2010-09-02 18:34:46 +0200
commite9c5760cf85b73fa252c242943b0ce630bffddf0 (patch)
tree28617402c17a087c00e86b47451950bd75715c47
parentab71bff637d31e5269d74551400e38f752be50a2 (diff)
downloadpylint-git-e9c5760cf85b73fa252c242943b0ce630bffddf0.tar.gz
[pyreverse] add current working directory to sys.path
It is not enough to do it in the astng.manager (in the project_from_files method) since we call the "ancestors" method after it in the DiadefsHandler.
-rw-r--r--pyreverse/main.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/pyreverse/main.py b/pyreverse/main.py
index dd4f42fb1..e7fdbf230 100644
--- a/pyreverse/main.py
+++ b/pyreverse/main.py
@@ -19,7 +19,7 @@
create UML diagrams for classes and modules in <packages>
"""
-import sys
+import sys, os
from logilab.common.configuration import ConfigurationMixIn
from logilab.astng.manager import ASTNGManager
from logilab.astng.inspector import Linker
@@ -84,7 +84,6 @@ this disables -f values")),
#( ('quiet',
#dict(help='run quietly', action='store_true', short='q')), )
-
class PyreverseCommand(ConfigurationMixIn):
"""base class providing common behaviour for pyreverse commands"""
@@ -103,10 +102,15 @@ class PyreverseCommand(ConfigurationMixIn):
if not args:
print self.help()
return
- project = self.manager.project_from_files(args)
- linker = Linker(project, tag=True)
- handler = DiadefsHandler(self.config)
- diadefs = handler.get_diadefs(project, linker)
+ sys.path.insert(0, os.getcwd())
+ try:
+ project = self.manager.project_from_files(args)
+ linker = Linker(project, tag=True)
+ handler = DiadefsHandler(self.config)
+ diadefs = handler.get_diadefs(project, linker)
+ finally:
+ sys.path.pop(0)
+
if self.config.output_format == "vcg":
writer.VCGWriter(self.config).write(diadefs)
else: