Esempio n. 1
0
 def createMemento(self):
     # ok, it's weird now since I've wrote the toString() method before
     # createMemento(). Correct would be to create an Json Object and then
     # convert it to the string
     jsonString = self.toString()
     jsonObject = json.JsonReader().read(jsonString)
     return jsonObject
Esempio n. 2
0
 def createMemento(self):
     """
     Creates a new memento to hold the current state
     """
     jsonString = self.toJson()
     jsonObject = json.JsonReader().read(jsonString)
     return jsonObject
Esempio n. 3
0
    def deserialize(self, serializationStream):
        """
        Deserializes the ASGC memento object from the stream.

        Arguments:
        serializationStream -- the stream to deserialize

        Return The ASGC object
        """
        text = GzipSerializer.deserialize(self, serializationStream)
        jsonObject = json.JsonReader().read(text)
        return jsonObject
Esempio n. 4
0
 def deserialize(self, serializationStream):
     text = GzipSerializer.deserialize(self, serializationStream)
     reader = json.JsonReader()
     jsonObject = reader.read(text)
     return jsonObject