#NEWLINE# def delete_orphan_snapshots( self , after_delete = None ) : #NEWLINE# #INDENT# stellar_databases = set ( ) #NEWLINE# for snapshot in self . db . session . query ( Snapshot ) : #NEWLINE# #INDENT# for table in snapshot . tables : #NEWLINE# #INDENT# stellar_databases . add ( table . get_table_name ( 'master' ) ) #NEWLINE# stellar_databases . add ( table . get_table_name ( 'slave' ) ) #NEWLINE# #UNINDENT# #UNINDENT# databases = set ( self . operations . list_of_databases ( ) ) #NEWLINE# for database in filter ( ( lambda database : ( database . startswith ( 'stellar_' ) and ( database != 'stellar_data' ) ) ) , ( databases - self ) ) : #NEWLINE# #INDENT# self . operations . remove_database ( database ) #NEWLINE# if after_delete : #NEWLINE# #INDENT# after_delete ( database )