#NEWLINE# def trim_tile_caches( sender , instance , * args , **kwargs ) : #NEWLINE# #INDENT# if ( sender is Style ) : #NEWLINE# #INDENT# drivers . CacheManager . get ( ) . remove_caches_for_style ( instance ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( sender is DataResource ) : #NEWLINE# #INDENT# drivers . CacheManager . get ( ) . remove_caches_for_resource ( instance ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( sender is RenderedLayer ) : #NEWLINE# #INDENT# drivers . CacheManager . get ( ) . remove_caches_for_layer ( instance )