intficpy/serializer.py
def deserialize_attribute(self, value):
        """
        Recursively deserialize an attribute
        Raises DeserializationError in the event of an attribute
        that cannot be deseriliazed
        """
        if isinstance(value, str) and value[:5] == "<IFP>":
            ix = value[5:]
            if not ix in self.game.ifp_objects:
                raise DeserializationError
            return self.game.ifp_objects[ix]

        elif isinstance(value, str):
            return value

        try:
            out = {}
            for sub_attr, sub_value in value.items():
                out[sub_attr] = self.deserialize_attribute(sub_value)
            return out

        except AttributeError:
            pass

        try:
            out = []
            for sub_value in value:
                out.append(self.deserialize_attribute(sub_value))
            return out

        except TypeError:
            pass

        return value

        Recursively deserialize an attribute
        Raises DeserializationError in the event of an attribute
        that cannot be deseriliazed
        
Recursively deserialize an attribute
Raises DeserializationError in the event of an attribute
that cannot be deseriliazed
Recursively deserialize an attribute Raises DeserializationError in the event of an attribute that cannot be deseriliazed
def deserialize_attribute(self, value):
        if isinstance(value, str) and value[:5] == "<IFP>":
            ix = value[5:]
            if not ix in self.game.ifp_objects:
                raise DeserializationError
            return self.game.ifp_objects[ix]
        elif isinstance(value, str):
            return value
        try:
            out = {}
            for sub_attr, sub_value in value.items():
                out[sub_attr] = self.deserialize_attribute(sub_value)
            return out
        except AttributeError:
            pass
        try:
            out = []
            for sub_value in value:
                out.append(self.deserialize_attribute(sub_value))
            return out
        except TypeError:
            pass
        return value
def deserialize_attribute ( self , value ) : if isinstance ( value , str ) and value [ : 5 ] == "<IFP>" : ix = value [ 5 : ] if not ix in self . game . ifp_objects : raise DeserializationError return self . game . ifp_objects [ ix ] elif isinstance ( value , str ) : return value try : out = { } for sub_attr , sub_value in value . items ( ) : out [ sub_attr ] = self . deserialize_attribute ( sub_value ) return out except AttributeError : pass try : out = [ ] for sub_value in value : out . append ( self . deserialize_attribute ( sub_value ) ) return out except TypeError : pass return value
Recursively deserialize an attribute
Raises DeserializationError in the event of an attribute
that cannot be deseriliazed
Recursively deserialize an attribute Raises DeserializationError in the event of an attribute that cannot be deseriliazed
"""
        Recursively deserialize an attribute
        Raises DeserializationError in the event of an attribute
        that cannot be deseriliazed
        """
self
value