Last active
August 29, 2015 13:57
-
-
Save tfcollins/9776083 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import commands | |
import glob | |
import os | |
difflines = 12 | |
# Get all .m files | |
target_dir = 'tmp' #No trailing slash | |
command = 'rm -rf '+target_dir | |
os.system(command) | |
command = 'mkdir '+target_dir | |
os.system(command) | |
command = 'find . -iname "*.m" -exec cp "{}" '+target_dir+ ' \;' | |
os.system(command) | |
files = glob.glob( target_dir+'/*m' ) | |
files2 = files | |
for filename1 in files: | |
for filename2 in files2: | |
command = 'diff -y --suppress-common-lines '+filename1+' '+filename2+" | grep '^' | wc -l" | |
status, output = commands.getstatusoutput( command ) | |
if (int(output) < difflines) and (filename1 is not filename2): | |
print '## Close files ##' | |
print 'Score: '+str(int(output)) | |
print filename1 | |
print filename2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment