#NEWLINE# def serializeForUndo( self , pack = True ) : #NEWLINE# #INDENT# from cPickle import dumps #NEWLINE# import zlib #NEWLINE# data = dict ( serializedData = self . getDataToSerializeForUndo ( ) , customData = self . getCustomDataToSerializeForUndo ( ) ) #NEWLINE# if pack : #NEWLINE# #INDENT# data = dumps ( data , 0 ) #NEWLINE# data = zlib . compress ( data , 9 ) #NEWLINE# #UNINDENT# return dict ( packed = pack , data = data )