<s> from nodeset . core import stream <EOL> from foolscap import slicer <EOL> import pickle <EOL> class FormatterSlicer ( slicer . BaseSlicer ) : <EOL> """<STR_LIT>""" <EOL> opentype = ( '<STR_LIT>' , ) <EOL> slices = stream . Formatter <EOL> trackReferences = True <EOL> def sliceBody ( self , streamable , banana ) : <EOL> yield pickle . dumps ( self . obj . encode ) <EOL> yield pickle . dumps ( self . obj . decode ) <EOL> class StreamEventUnslicer ( slicer . BaseUnslicer ) : <EOL> """<STR_LIT>""" <EOL> opentype = ( '<STR_LIT>' , ) <EOL> def __init__ ( self ) : <EOL> self . obj = stream . Formatter ( ) <EOL> def receiveChild ( self , obj , ready_deferred = None ) : <EOL> o = pickle . loads ( obj ) <EOL> setattr ( self . obj , o . __name__ , o ) <EOL> def receiveClose ( self ) : <EOL> return self . obj , None </s>
