|
|
@ -31,16 +31,26 @@ class PrinterInheritance(AbstractPrinter): |
|
|
|
if not self.contracts: |
|
|
|
if not self.contracts: |
|
|
|
return |
|
|
|
return |
|
|
|
|
|
|
|
|
|
|
|
info += blue('Child_Contract -> ') + green('Base_Contracts') |
|
|
|
info += blue('Child_Contract -> ') + green('Immediate_Base_Contracts') |
|
|
|
|
|
|
|
info += green(' [Not_Immediate_Base_Contracts]') |
|
|
|
for child in self.contracts: |
|
|
|
for child in self.contracts: |
|
|
|
info += blue(f'\n+ {child.name}') |
|
|
|
info += blue(f'\n+ {child.name}') |
|
|
|
if child.inheritance: |
|
|
|
if child.inheritance: |
|
|
|
info += ' -> ' + green(", ".join(map(str, child.inheritance))) |
|
|
|
immediate = child.immediate_inheritance |
|
|
|
|
|
|
|
not_immediate = [i for i in child.inheritance if i not in immediate] |
|
|
|
info += green('\n\nBase_Contract -> ') + blue('Child_Contracts') |
|
|
|
info += ' -> ' + green(", ".join(map(str, immediate))) |
|
|
|
|
|
|
|
if not_immediate: |
|
|
|
|
|
|
|
info += ", ["+ green(", ".join(map(str, not_immediate))) + "]" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
info += green('\n\nBase_Contract -> ') + blue('Immediate_Child_Contracts') |
|
|
|
|
|
|
|
info += blue(' [Not_Immediate_Child_Contracts]') |
|
|
|
for base in self.contracts: |
|
|
|
for base in self.contracts: |
|
|
|
info += green(f'\n+ {base.name}') |
|
|
|
info += green(f'\n+ {base.name}') |
|
|
|
children = list(self._get_child_contracts(base)) |
|
|
|
children = list(self._get_child_contracts(base)) |
|
|
|
if children: |
|
|
|
if children: |
|
|
|
info += ' -> ' + blue(", ".join(map(str, children))) |
|
|
|
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))) |
|
|
|
|
|
|
|
if not_immediate: |
|
|
|
|
|
|
|
info += ', [' + blue(", ".join(map(str, not_immediate))) + ']' |
|
|
|
self.info(info) |
|
|
|
self.info(info) |
|
|
|