#NEWLINE# def dispatch( self , replicate_args , args ) : #NEWLINE# #INDENT# if ( not hasattr ( args , 'pop' ) ) : #NEWLINE# #INDENT# return HTTPBadRequest ( body = 'Invalid object type' ) #NEWLINE# #UNINDENT# op = args . pop ( 0 ) #NEWLINE# ( drive , partition , hsh ) = replicate_args #NEWLINE# if ( self . mount_check and ( not ismount ( os . path . join ( self . root , drive ) ) ) ) : #NEWLINE# #INDENT# return Response ( status = ( '507 %s is not mounted' % drive ) ) #NEWLINE# #UNINDENT# db_file = os . path . join ( self . root , drive , storage_directory ( self . datadir , partition , hsh ) , ( self + '.db' ) ) #NEWLINE# if ( op == 'rsync_then_merge' ) : #NEWLINE# #INDENT# return self . rsync_then_merge ( drive , db_file , args ) #NEWLINE# #UNINDENT# if ( op == 'complete_rsync' ) : #NEWLINE# #INDENT# return self . complete_rsync ( drive , db_file , args ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# mkdirs ( os . path . join ( self . root , drive , 'tmp' ) ) #NEWLINE# if ( not os . path . exists ( db_file ) ) : #NEWLINE# #INDENT# return HTTPNotFound ( ) #NEWLINE# #UNINDENT# return getattr ( self , op ) ( self . broker_class ( db_file ) , args )