Index: third_party/pylint/pyreverse/diadefslib.py |
diff --git a/third_party/pylint/pyreverse/diadefslib.py b/third_party/pylint/pyreverse/diadefslib.py |
index 46d0f19a6fde2e195ee1d5b872e957c907912e00..68ca68ca45f44e48163c7124bb53f9a2c54f0c5b 100644 |
--- a/third_party/pylint/pyreverse/diadefslib.py |
+++ b/third_party/pylint/pyreverse/diadefslib.py |
@@ -1,4 +1,4 @@ |
-# Copyright (c) 2000-2013 LOGILAB S.A. (Paris, FRANCE). |
+# Copyright (c) 2000-2010 LOGILAB S.A. (Paris, FRANCE). |
# http://www.logilab.fr/ -- mailto:contact@logilab.fr |
# |
# This program is free software; you can redistribute it and/or modify it under |
@@ -12,24 +12,22 @@ |
# |
# You should have received a copy of the GNU General Public License along with |
# this program; if not, write to the Free Software Foundation, Inc., |
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
+# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
"""handle diagram generation options for class diagram or default diagrams |
""" |
from logilab.common.compat import builtins |
- |
-import astroid |
-from astroid.utils import LocalsVisitor |
+BUILTINS_NAME = builtins.__name__ |
+from logilab import astng |
+from logilab.astng.utils import LocalsVisitor |
from pylint.pyreverse.diagrams import PackageDiagram, ClassDiagram |
-BUILTINS_NAME = builtins.__name__ |
- |
# diagram generators ########################################################## |
-class DiaDefGenerator(object): |
- """handle diagram generation options""" |
- |
+class DiaDefGenerator: |
+ """handle diagram generation options |
+ """ |
def __init__(self, linker, handler): |
"""common Diagram Handler initialization""" |
self.config = handler.config |
@@ -41,7 +39,7 @@ class DiaDefGenerator(object): |
"""get title for objects""" |
title = node.name |
if self.module_names: |
- title = '%s.%s' % (node.root().name, title) |
+ title = '%s.%s' % (node.root().name, title) |
return title |
def _set_option(self, option): |
@@ -102,9 +100,9 @@ class DiaDefGenerator(object): |
for ass_nodes in klass_node.instance_attrs_type.values() + \ |
klass_node.locals_type.values(): |
for ass_node in ass_nodes: |
- if isinstance(ass_node, astroid.Instance): |
+ if isinstance(ass_node, astng.Instance): |
ass_node = ass_node._proxied |
- if not (isinstance(ass_node, astroid.Class) |
+ if not (isinstance(ass_node, astng.Class) |
and self.show_node(ass_node)): |
continue |
yield ass_node |
@@ -134,7 +132,7 @@ class DefaultDiadefGenerator(LocalsVisitor, DiaDefGenerator): |
LocalsVisitor.__init__(self) |
def visit_project(self, node): |
- """visit an astroid.Project node |
+ """visit an astng.Project node |
create a diagram definition for packages |
""" |
@@ -146,7 +144,7 @@ class DefaultDiadefGenerator(LocalsVisitor, DiaDefGenerator): |
self.classdiagram = ClassDiagram('classes %s' % node.name, mode) |
def leave_project(self, node): |
- """leave the astroid.Project node |
+ """leave the astng.Project node |
return the generated diagram definition |
""" |
@@ -155,7 +153,7 @@ class DefaultDiadefGenerator(LocalsVisitor, DiaDefGenerator): |
return self.classdiagram, |
def visit_module(self, node): |
- """visit an astroid.Module node |
+ """visit an astng.Module node |
add this class to the package diagram definition |
""" |
@@ -164,7 +162,7 @@ class DefaultDiadefGenerator(LocalsVisitor, DiaDefGenerator): |
self.pkgdiagram.add_object(node.name, node) |
def visit_class(self, node): |
- """visit an astroid.Class node |
+ """visit an astng.Class node |
add this class to the class diagram definition |
""" |
@@ -172,7 +170,7 @@ class DefaultDiadefGenerator(LocalsVisitor, DiaDefGenerator): |
self.extract_classes(node, anc_level, ass_level) |
def visit_from(self, node): |
- """visit astroid.From and catch modules for package diagram |
+ """visit astng.From and catch modules for package diagram |
""" |
if self.pkgdiagram: |
self.pkgdiagram.add_from_depend(node, node.modname) |
@@ -206,7 +204,7 @@ class ClassDiadefGenerator(DiaDefGenerator): |
# diagram handler ############################################################# |
-class DiadefsHandler(object): |
+class DiadefsHandler: |
"""handle diagram definitions : |
get it from user (i.e. xml files) or generate them |
@@ -217,8 +215,8 @@ class DiadefsHandler(object): |
def get_diadefs(self, project, linker): |
"""get the diagrams configuration data |
- :param linker: astroid.inspector.Linker(IdGeneratorMixIn, LocalsVisitor) |
- :param project: astroid.manager.Project |
+ :param linker: astng.inspector.Linker(IdGeneratorMixIn, LocalsVisitor) |
+ :param project: astng.manager.Project |
""" |
# read and interpret diagram definitions (Diadefs) |