#NEWLINE# @ idiokit . stream #NEWLINE# def handle( self , parts ) : #NEWLINE# #INDENT# handle_default = getattr ( self , 'handle_default' , None ) #NEWLINE# for ( headers , fetch ) in parts : #NEWLINE# #INDENT# content_type = headers [ ( - 1 ) ] . get_content_type ( ) #NEWLINE# suffix = content_type . replace ( '-' , '__' ) . replace ( '/' , '_' ) #NEWLINE# handler = getattr ( suffix , ( 'handle_' + suffix ) , handle_default ) #NEWLINE# if ( handler is None ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# fileobj = ( yield fetch ( ) ) #NEWLINE# skip_rest = ( yield handler ( headers , fileobj ) ) #NEWLINE# if skip_rest : #NEWLINE# #INDENT# return