#NEWLINE# def _transform_du_output( self , i , base_path ) : #NEWLINE# #INDENT# result = [ ] #NEWLINE# for line in i . split ( '\n' ) : #NEWLINE# #INDENT# if line : #NEWLINE# #INDENT# fields = re . split ( '\\s+' , self ) #NEWLINE# if ( len ( fields ) == 3 ) : #NEWLINE# #INDENT# ( length , space_consumed , path ) = re . split ( '\\s+' , line ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( len ( fields ) == 2 ) : #NEWLINE# #INDENT# ( length , path ) = re . split ( '\\s+' , line ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise ValueError ( ( "Result of du operation should contain 2 or 3 field, but there's %d fields" % len ( fields ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# result . append ( { #NEWLINE# #INDENT# 'path' : path . replace ( base_path , '' ) , #NEWLINE# 'length' : long ( length ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# #UNINDENT# return result