Exemple #1
0
 def deserialize(data):
     kls = Deserializer.get_polymorphic_class(data)
     obj = kls(data[Declaration.SERIAL_DATA_KEY])
     try:
         d = data[Declaration.SERIAL_PROPERTIES]
         props = SetDeserializer(str).deserialize(d)
         obj.properties = props
     except KeyError:
         pass
     try:
         d = data[Declaration.SERIAL_EXCLUDE_KEY]
         if d:
             obj.properties.add(DependenciesProperties.EXCLUDE_FROM_BUILD)
     except KeyError:
         pass
     return obj
 def deserialize(data):
     kls = Deserializer.get_polymorphic_class(data)
     obj = kls(data[Declaration.SERIAL_DATA_KEY])
     try:
         d = data[Declaration.SERIAL_PROPERTIES]
         props = SetDeserializer(str).deserialize(d)
         obj.properties = props
     except KeyError:
         pass
     try:
         d = data[Declaration.SERIAL_EXCLUDE_KEY]
         if d:
             obj.properties.add(DependenciesProperties.EXCLUDE_FROM_BUILD)
     except KeyError:
         pass
     return obj
Exemple #3
0
 def deserialize(self, data):
     if data is None:
         return None
     try:
         kls = Deserializer.get_polymorphic_class(data)
         r = kls.deserialize(data)
         r.name = BlockCellName(data[Cell.SERIAL_NAME_KEY])
         r.root = ID.deserialize(data[Cell.SERIAL_ROOT_KEY])
         r.ID = self.id_type.deserialize(data[Cell.SERIAL_ID_KEY])
         r.type = BiiType(data[Cell.SERIAL_TYPE_KEY])
         r.hasMain = data[Cell.SERIAL_MAIN_KEY]
         try:
             r.dependencies.cell_name = r.name
         except AttributeError:
             pass
         return r
     except Exception as e:
         tb = traceback.format_exc()
         logger.warning(tb)
         raise BiiSerializationException(e)