summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorJan Safranek <jsafrane@redhat.com>2013-01-11 14:47:50 +0100
committerJan Safranek <jsafrane@redhat.com>2013-01-11 15:03:01 +0100
commit9791f84ea41b5de5fa7fb651a3d284b6ebe67176 (patch)
tree2f787ddef77d52ebac22046e186b8503ea25b362 /tools
parentdf6847b72e4ba18d34c9309847f1f8c061102dd0 (diff)
downloadopenlmi-providers-9791f84ea41b5de5fa7fb651a3d284b6ebe67176.tar.gz
openlmi-providers-9791f84ea41b5de5fa7fb651a3d284b6ebe67176.tar.xz
openlmi-providers-9791f84ea41b5de5fa7fb651a3d284b6ebe67176.zip
Check 'Implemeted' qualifier and show all implemented properties/methods as local.
Diffstat (limited to 'tools')
-rwxr-xr-xtools/class2dot.py8
-rwxr-xr-xtools/class2html.py8
-rwxr-xr-xtools/class2rst.py8
-rwxr-xr-xtools/class2uml.py12
4 files changed, 28 insertions, 8 deletions
diff --git a/tools/class2dot.py b/tools/class2dot.py
index 008111b..4e844f2 100755
--- a/tools/class2dot.py
+++ b/tools/class2dot.py
@@ -101,7 +101,9 @@ class DotExporter(object):
def compare_properties(self, p1, p2):
"""
- Compare two properties. Only Name and Description are checked.
+ Compare two properties if they should printed in Inherited properties.
+ Only Name, Description and Implemented are checked.
+ Returns False, if the property should be printed in Local.
"""
if p1.name != p2.name:
return False
@@ -109,6 +111,10 @@ class DotExporter(object):
d2 = p2.qualifiers.get("Description", None)
if d1.value != d2.value:
return False
+ i1 = p1.qualifiers.get("Implemented", None)
+ i2 = p2.qualifiers.get("Implemented", None)
+ if i1 and i1.value and not (i2 and i2.value):
+ return False
return True
def print_class(self, c, display_local = True, box_only = False):
diff --git a/tools/class2html.py b/tools/class2html.py
index cebf762..a4d8047 100755
--- a/tools/class2html.py
+++ b/tools/class2html.py
@@ -158,7 +158,9 @@ class HtmlExporter(object):
def compare_properties(self, p1, p2):
"""
- Compare two properties. Only Name and Description are checked.
+ Compare two properties if they should printed in Inherited properties.
+ Only Name, Description and Implemented are checked.
+ Returns False, if the property should be printed in Local.
"""
if p1.name != p2.name:
return False
@@ -166,6 +168,10 @@ class HtmlExporter(object):
d2 = p2.qualifiers.get("Description", None)
if d1.value != d2.value:
return False
+ i1 = p1.qualifiers.get("Implemented", None)
+ i2 = p2.qualifiers.get("Implemented", None)
+ if i1 and i1.value and not (i2 and i2.value):
+ return False
return True
def print_keys(self, c):
diff --git a/tools/class2rst.py b/tools/class2rst.py
index 828745e..b093a6a 100755
--- a/tools/class2rst.py
+++ b/tools/class2rst.py
@@ -178,7 +178,9 @@ class HtmlExporter(object):
def compare_properties(self, p1, p2):
"""
- Compare two properties. Only Name and Description are checked.
+ Compare two properties if they should printed in Inherited properties.
+ Only Name, Description and Implemented are checked.
+ Returns False, if the property should be printed in Local.
"""
if p1.name != p2.name:
return False
@@ -186,6 +188,10 @@ class HtmlExporter(object):
d2 = p2.qualifiers.get("Description", None)
if d1.value != d2.value:
return False
+ i1 = p1.qualifiers.get("Implemented", None)
+ i2 = p2.qualifiers.get("Implemented", None)
+ if i1 and i1.value and not (i2 and i2.value):
+ return False
return True
def print_keys(self, c):
diff --git a/tools/class2uml.py b/tools/class2uml.py
index d46bcc5..99e547e 100755
--- a/tools/class2uml.py
+++ b/tools/class2uml.py
@@ -101,18 +101,20 @@ class UmlExporter(object):
def compare_properties(self, p1, p2):
"""
- Compare two properties. Only Name and Description are checked.
+ Compare two properties if they should printed in Inherited properties.
+ Only Name, Description and Implemented are checked.
+ Returns False, if the property should be printed in Local.
"""
if p1.name != p2.name:
return False
- i1 = p1.qualifiers.get("Implemented", None)
- i2 = p2.qualifiers.get("Implemented", None)
- if i1 and i1.value and not (i2 and i2.value):
- return False
d1 = p1.qualifiers.get("Description", None)
d2 = p2.qualifiers.get("Description", None)
if d1.value != d2.value:
return False
+ i1 = p1.qualifiers.get("Implemented", None)
+ i2 = p2.qualifiers.get("Implemented", None)
+ if i1 and i1.value and not (i2 and i2.value):
+ return False
return True
def print_class(self, c, display_local = True, box_only = False):