summaryrefslogtreecommitdiff
path: root/pylint/pyreverse/diagrams.py
diff options
context:
space:
mode:
Diffstat (limited to 'pylint/pyreverse/diagrams.py')
-rw-r--r--pylint/pyreverse/diagrams.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/pylint/pyreverse/diagrams.py b/pylint/pyreverse/diagrams.py
index dfc03f2..ef7fe90 100644
--- a/pylint/pyreverse/diagrams.py
+++ b/pylint/pyreverse/diagrams.py
@@ -18,10 +18,13 @@
import astroid
from pylint.pyreverse.utils import is_interface, FilterMixIn
+from pylint.checkers.utils import decorated_with_property
+
class Figure(object):
"""base class for counter handling"""
+
class Relationship(Figure):
"""a relation ship from an object in the diagram to another
"""
@@ -41,6 +44,7 @@ class DiagramEntity(Figure):
self.title = title
self.node = node
+
class ClassDiagram(Figure, FilterMixIn):
"""main class diagram handling
"""
@@ -77,8 +81,13 @@ class ClassDiagram(Figure, FilterMixIn):
def get_attrs(self, node):
"""return visible attributes, possibly with class name"""
attrs = []
+ properties = [
+ (n, m) for n, m in node.items()
+ if isinstance(m, astroid.FunctionDef)
+ and decorated_with_property(m)
+ ]
for node_name, ass_nodes in list(node.instance_attrs_type.items()) + \
- list(node.locals_type.items()):
+ list(node.locals_type.items()) + properties:
if not self.show_attr(node_name):
continue
names = self.class_names(ass_nodes)
@@ -91,7 +100,9 @@ class ClassDiagram(Figure, FilterMixIn):
"""return visible methods"""
methods = [
m for m in node.values()
- if isinstance(m, astroid.FunctionDef) and self.show_attr(m.name)
+ if isinstance(m, astroid.FunctionDef)
+ and not decorated_with_property(m)
+ and self.show_attr(m.name)
]
return sorted(methods, key=lambda n: n.name)