|
|
|
@ -36,11 +36,10 @@ class PrinterInheritance(AbstractPrinter): |
|
|
|
|
info += blue('Child_Contract -> ') + green('Immediate_Base_Contracts') |
|
|
|
|
info += green(' [Not_Immediate_Base_Contracts]') |
|
|
|
|
|
|
|
|
|
result = {} |
|
|
|
|
result['child_to_base'] = {} |
|
|
|
|
result = {'child_to_base': {}} |
|
|
|
|
|
|
|
|
|
for child in self.contracts: |
|
|
|
|
info += blue(f'\n+ {child.name}') |
|
|
|
|
info += blue(f'\n+ {child.name}\n') |
|
|
|
|
result['child_to_base'][child.name] = {'immediate': [], |
|
|
|
|
'not_immediate': []} |
|
|
|
|
if child.inheritance: |
|
|
|
@ -48,18 +47,18 @@ class PrinterInheritance(AbstractPrinter): |
|
|
|
|
immediate = child.immediate_inheritance |
|
|
|
|
not_immediate = [i for i in child.inheritance if i not in immediate] |
|
|
|
|
|
|
|
|
|
info += ' -> ' + green(", ".join(map(str, immediate))) |
|
|
|
|
info += ' -> ' + green(", ".join(map(str, immediate))) + '\n' |
|
|
|
|
result['child_to_base'][child.name]['immediate'] = list(map(str, immediate)) |
|
|
|
|
if not_immediate: |
|
|
|
|
info += ", ["+ green(", ".join(map(str, not_immediate))) + "]" |
|
|
|
|
info += ", ["+ green(", ".join(map(str, not_immediate))) + "]\n" |
|
|
|
|
result['child_to_base'][child.name]['not_immediate'] = list(map(str, not_immediate)) |
|
|
|
|
|
|
|
|
|
info += green('\n\nBase_Contract -> ') + blue('Immediate_Child_Contracts') |
|
|
|
|
info += blue(' [Not_Immediate_Child_Contracts]') |
|
|
|
|
info += green('\n\nBase_Contract -> ') + blue('Immediate_Child_Contracts') + '\n' |
|
|
|
|
info += blue(' [Not_Immediate_Child_Contracts]') + '\n' |
|
|
|
|
|
|
|
|
|
result['base_to_child'] = {} |
|
|
|
|
for base in self.contracts: |
|
|
|
|
info += green(f'\n+ {base.name}') |
|
|
|
|
info += green(f'\n+ {base.name}') + '\n' |
|
|
|
|
children = list(self._get_child_contracts(base)) |
|
|
|
|
|
|
|
|
|
result['base_to_child'][base.name] = {'immediate': [], |
|
|
|
@ -68,10 +67,10 @@ class PrinterInheritance(AbstractPrinter): |
|
|
|
|
immediate = [child for child in children if base in child.immediate_inheritance] |
|
|
|
|
not_immediate = [child for child in children if not child in immediate] |
|
|
|
|
|
|
|
|
|
info += ' -> ' + blue(", ".join(map(str, immediate))) |
|
|
|
|
info += ' -> ' + blue(", ".join(map(str, immediate))) + '\n' |
|
|
|
|
result['base_to_child'][base.name]['immediate'] = list(map(str, immediate)) |
|
|
|
|
if not_immediate: |
|
|
|
|
info += ', [' + blue(", ".join(map(str, not_immediate))) + ']' |
|
|
|
|
info += ', [' + blue(", ".join(map(str, not_immediate))) + ']' + '\n' |
|
|
|
|
result['base_to_child'][base.name]['not_immediate'] = list(map(str, immediate)) |
|
|
|
|
self.info(info) |
|
|
|
|
|
|
|
|
|