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

@@ -48,8 +48,8 @@ The '%prog' command stages files to prepare the next commit.
self.Usage()
def _Interactive(self, opt, args):
all = filter(lambda x: x.IsDirty(), self.GetProjects(args))
if not all:
all_projects = filter(lambda x: x.IsDirty(), self.GetProjects(args))
if not all_projects:
print >>sys.stderr,'no projects have uncommitted modifications'
return
@@ -58,8 +58,8 @@ The '%prog' command stages files to prepare the next commit.
out.header(' %s', 'project')
out.nl()
for i in xrange(0, len(all)):
p = all[i]
for i in xrange(0, len(all_projects)):
p = all_projects[i]
out.write('%3d: %s', i + 1, p.relpath + '/')
out.nl()
out.nl()
@@ -93,11 +93,11 @@ The '%prog' command stages files to prepare the next commit.
if a_index is not None:
if a_index == 0:
break
if 0 < a_index and a_index <= len(all):
_AddI(all[a_index - 1])
if 0 < a_index and a_index <= len(all_projects):
_AddI(all_projects[a_index - 1])
continue
p = filter(lambda x: x.name == a or x.relpath == a, all)
p = filter(lambda x: x.name == a or x.relpath == a, all_projects)
if len(p) == 1:
_AddI(p[0])
continue