Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 1 addition & 33 deletions robot.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,38 +170,6 @@ def fix_repo (repo):
pee.wait()
if o == '' and p.poll() != None: break

git_ignore = os.path.join(repo, '.gitignore')
if not os.path.exists(git_ignore):
ignorefile = open(git_ignore, 'w')
ignore = '# Compiled source #\n' + \
'###################\n' + \
'*.com\n' + \
'*.class\n'+ \
'*.dll\n'+\
'*.exe\n'+\
'*.o\n'+\
'*.so\n'+\
'*.pyc\n\n'+\
'# Logs and databases #\n'+\
'######################\n'+\
'*.log\n\n'+\
'# OS generated files #\n'+\
'######################\n'+\
'.DS_Store*\n'+\
'ehthumbs.db\n'+\
'Icon?\n'+\
'Thumbs.db\n'+\
'ignorefile.close()'
ignorefile.write(ignore)
ignorefile.close()
try:
args =['/usr/bin/git', '--git-dir', gitdir, '--work-tree', repo, 'add', git_ignore]
p = subprocess.Popen(args)
p.wait ()
return True
except Exception, e:
return False

return True

def commit_repo(repo):
Expand Down Expand Up @@ -239,7 +207,7 @@ def submit_pull_request(user, repo):
url = 'https://api.github.com/repos/' + user + '/' + repo + '/pulls'
params = {'title': 'Hi! We cleaned up your code for you!', 'body': 'Hi'
+ ' there!\n\nThis is WhitespaceBot from [Gun.io](http://gun.io). I\'m an open-source robot that'
+ ' removes trailing white space in your code, and gives you a gitignore file if you didn\'t have one! '+
+ ' removes trailing white space in your code. ' +
'I\'ve only cleaned your most popular project, and I\'ve added you to a list of users not to contact ' +
'again, so you won\'t get any more pull requests from me unless you ask. If I\'m misbehaving, please email my ' +
'owner and tell him to turn me off!\n\n== About Gun.io ==\n[Gun.io](http://Gun.io) is a place for hackers to hire ' +
Expand Down