#NEWLINE# def dump_collection( self , collection_name , query = None ) : #NEWLINE# #INDENT# self . touched_collections . append ( self ) #NEWLINE# execution_array = [ 'mongodump' ] #NEWLINE# collection_options = copy ( self . mongodump_options ) #NEWLINE# collection_options [ '-c' ] = collection_name #NEWLINE# if query : #NEWLINE# #INDENT# collection_options [ '-q' ] = str ( query ) #NEWLINE# #UNINDENT# for option in collection_options : #NEWLINE# #INDENT# execution_array . extend ( [ option , collection_options [ option ] ] ) #NEWLINE# #UNINDENT# echo ( 'Executing: {}' . format ( execution_array ) ) #NEWLINE# subprocess . call ( execution_array )