#NEWLINE# def dump_db( dburl , username = None , password = None , boundary = None , output = sys . stdout , bulk_size = BULK_SIZE ) : #NEWLINE# #INDENT# db = Database ( dburl ) #NEWLINE# if ( ( username is not None ) and ( password is not None ) ) : #NEWLINE# #INDENT# db . resource . credentials = ( username , password ) #NEWLINE# #UNINDENT# envelope = write_multipart ( output , boundary = boundary ) #NEWLINE# ( start , num ) = ( 0 , db . info ( ) [ 'doc_count' ] ) #NEWLINE# while ( start < num ) : #NEWLINE# #INDENT# opts = { #NEWLINE# #INDENT# 'limit' : bulk_size , #NEWLINE# 'skip' : start , #NEWLINE# 'include_docs' : True , #NEWLINE# #UNINDENT# } #NEWLINE# docs = ( row . doc for row in db . view ( '_all_docs' , ** opts ) ) #NEWLINE# dump_docs ( envelope , num , docs ) #NEWLINE# start += bulk_size #NEWLINE# #UNINDENT# envelope . close ( )