Пример #1
0
    def __same__(self, o):
        if type(self) is not type(o):
            return False

        if same_attrs(self, o, "desc_name", "shown", "opaque"):
            return True
        return False
Пример #2
0
 def __same__(
     self,
     o,
     attribs=tuple(pa) + tuple(kwa.keys()),
     # support extra comparison rules
     _same=(klass.__same__ if "__same__" in klass.__dict__ else None)):
     if type(self) is not type(o):
         return False
     if _same is not None and not _same(self, o):
         return False
     if same_attrs(self, o, *attribs):
         return True
     return False
Пример #3
0
    def __same__(self, o):
        if not Node.__same__(self, o):
            return False

        if not same(idon(self.parent_bus), idon(o.parent_bus)):
            return False

        if not same_attrs(self, o, "qom_type", "properties"):
            return False

        # order of buses is significant
        if not same_vectors((b.id for b in self.buses),
                            (b.id for b in o.buses)):
            return False

        # order of IRQs is not significant
        if same_sets((i.id for i in self.irqs), (i.id for i in o.irqs)):
            return True
        return False
Пример #4
0
 def __same__(self, o):
     if not isinstance(o, Register):
         return False
     return same_attrs(self, o, "name", "access", "reset", "full_name",
         "wmask", "warbits"
     )
Пример #5
0
 def __same__(self, o):
     if type(self) is not type(o):
         return False
     return same_attrs(self, o, "id", "var_base")