diff options
author | David Pursehouse <david.pursehouse@sonymobile.com> | 2012-09-24 12:15:13 +0900 |
---|---|---|
committer | Gustaf Lundh <gustaf.lundh@sonymobile.com> | 2012-10-09 12:45:30 +0200 |
commit | 8a68ff96057ec58e524a3e41a2d8dca7b5d016bc (patch) | |
tree | 22f6971e8d3c4a90d11d3704602d073a852328b4 /subcmds/stage.py | |
parent | e3b1c45aebed329cbc9ad172b1d8e812cf208117 (diff) | |
download | git-repo-8a68ff96057ec58e524a3e41a2d8dca7b5d016bc.tar.gz |
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
Diffstat (limited to 'subcmds/stage.py')
-rw-r--r-- | subcmds/stage.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/subcmds/stage.py b/subcmds/stage.py index 4c221dba..2ec48069 100644 --- a/subcmds/stage.py +++ b/subcmds/stage.py | |||
@@ -48,8 +48,8 @@ The '%prog' command stages files to prepare the next commit. | |||
48 | self.Usage() | 48 | self.Usage() |
49 | 49 | ||
50 | def _Interactive(self, opt, args): | 50 | def _Interactive(self, opt, args): |
51 | all = filter(lambda x: x.IsDirty(), self.GetProjects(args)) | 51 | all_projects = filter(lambda x: x.IsDirty(), self.GetProjects(args)) |
52 | if not all: | 52 | if not all_projects: |
53 | print >>sys.stderr,'no projects have uncommitted modifications' | 53 | print >>sys.stderr,'no projects have uncommitted modifications' |
54 | return | 54 | return |
55 | 55 | ||
@@ -58,8 +58,8 @@ The '%prog' command stages files to prepare the next commit. | |||
58 | out.header(' %s', 'project') | 58 | out.header(' %s', 'project') |
59 | out.nl() | 59 | out.nl() |
60 | 60 | ||
61 | for i in xrange(0, len(all)): | 61 | for i in xrange(0, len(all_projects)): |
62 | p = all[i] | 62 | p = all_projects[i] |
63 | out.write('%3d: %s', i + 1, p.relpath + '/') | 63 | out.write('%3d: %s', i + 1, p.relpath + '/') |
64 | out.nl() | 64 | out.nl() |
65 | out.nl() | 65 | out.nl() |
@@ -93,11 +93,11 @@ The '%prog' command stages files to prepare the next commit. | |||
93 | if a_index is not None: | 93 | if a_index is not None: |
94 | if a_index == 0: | 94 | if a_index == 0: |
95 | break | 95 | break |
96 | if 0 < a_index and a_index <= len(all): | 96 | if 0 < a_index and a_index <= len(all_projects): |
97 | _AddI(all[a_index - 1]) | 97 | _AddI(all_projects[a_index - 1]) |
98 | continue | 98 | continue |
99 | 99 | ||
100 | p = filter(lambda x: x.name == a or x.relpath == a, all) | 100 | p = filter(lambda x: x.name == a or x.relpath == a, all_projects) |
101 | if len(p) == 1: | 101 | if len(p) == 1: |
102 | _AddI(p[0]) | 102 | _AddI(p[0]) |
103 | continue | 103 | continue |