Coding style cleanup

Fix the following issues reported by pylint:

C0321: More than one statement on a single line
W0622: Redefining built-in 'name'
W0612: Unused variable 'name'
W0613: Unused argument 'name'
W0102: Dangerous default value 'value' as argument
W0105: String statement has no effect

Also fixed a few cases of inconsistent indentation.

Change-Id: Ie0db839e7c57d576cff12d8c055fe87030d00744
This commit is contained in:
David Pursehouse
2012-09-24 12:15:13 +09:00
committed by Gustaf Lundh
parent e3b1c45aeb
commit 8a68ff9605
22 changed files with 167 additions and 172 deletions

View File

@ -40,8 +40,8 @@ def _die(fmt, *args):
def _SplitEmails(values):
result = []
for str in values:
result.extend([s.strip() for s in str.split(',')])
for value in values:
result.extend([s.strip() for s in value.split(',')])
return result
class Upload(InteractiveCommand):
@ -174,15 +174,15 @@ Gerrit Code Review: http://code.google.com/p/gerrit/
if answer is None:
date = branch.date
list = branch.commits
commit_list = branch.commits
print 'Upload project %s/ to remote branch %s:' % (project.relpath, project.revisionExpr)
print ' branch %s (%2d commit%s, %s):' % (
name,
len(list),
len(list) != 1 and 's' or '',
len(commit_list),
len(commit_list) != 1 and 's' or '',
date)
for commit in list:
for commit in commit_list:
print ' %s' % commit
sys.stdout.write('to %s (y/N)? ' % remote.review)
@ -212,17 +212,17 @@ Gerrit Code Review: http://code.google.com/p/gerrit/
for branch in avail:
name = branch.name
date = branch.date
list = branch.commits
commit_list = branch.commits
if b:
script.append('#')
script.append('# branch %s (%2d commit%s, %s) to remote branch %s:' % (
name,
len(list),
len(list) != 1 and 's' or '',
len(commit_list),
len(commit_list) != 1 and 's' or '',
date,
project.revisionExpr))
for commit in list:
for commit in commit_list:
script.append('# %s' % commit)
b[name] = branch