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
def createMemento(self): """ Creates a new memento to hold the current state """ jsonString = self.toJson() jsonObject = json.JsonReader().read(jsonString) return jsonObject
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
def deserialize(self, serializationStream): text = GzipSerializer.deserialize(self, serializationStream) reader = json.JsonReader() jsonObject = reader.read(text) return jsonObject