| extensions = ['.h','.cc','.c','.cpp'] |
| ignore_these = ['my_ignore_header.h'] |
| Replaces all TAB characters with %(TABSIZE)d space characters. |
| In addition, all trailing space characters are removed. |
| if((len(sys.argv) != 2) and (len(sys.argv) != 3)): |
| if(not filemanagement.pathexist(directory)): |
| if((len(sys.argv) == 3) and (sys.argv[2] != '--commit')): |
| for extension in extensions: |
| files_to_fix.extend(filemanagement.listallfilesinfolder(directory,\ |
| p4commands.checkoutallfiles() |
| for path,file_name in files_to_fix: |
| full_file_name = path + file_name |
| print full_file_name + ' will be edited' |
| for line in fileinput.input(full_file_name, inplace=True): |
| line = line.replace('\t',' '*TABSIZE); # replace TABs |
| line = line.rstrip(None) # remove trailing whitespaces |
| print line # modify the file |
| p4commands.revertunchangedfiles() |
| if __name__ == '__main__': |