Fix flake8 whitespace warnings.

Guided by the output of `flake8 --select=W`.
This commit is contained in:
Frederik “Freso” S. Olesen
2017-04-28 12:49:17 +02:00
parent 6c33d37b55
commit 6be899632d
7 changed files with 12 additions and 18 deletions

View File

@@ -4,16 +4,16 @@
# Copyright (C) 2009 Thomas Vander Stichele
# This file is part of whipper.
#
#
# whipper is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
#
# whipper is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
#
# You should have received a copy of the GNU General Public License
# along with whipper. If not, see <http://www.gnu.org/licenses/>.

View File

@@ -15,14 +15,14 @@ class Presentation:
def show(self, maxlen=20):
format = '%%-%ds %%3d %%%% (%%4d / %%4d)' % maxlen
print format % (self.name, self.percent, self.covered, self.lines)
class Coverage:
def __init__(self):
self.files = []
self.total_lines = 0
self.total_covered = 0
def _strip_filename(self, filename):
filename = os.path.basename(filename)
if filename.endswith('.cover'):
@@ -44,10 +44,10 @@ class Coverage:
for file in self.files:
self.show_one(file)
print '-' * (self.maxlen + 23)
p = Presentation('Total', self.total_lines, self.total_covered)
p.show(self.maxlen)
def show_one(self, filename):
f = open(filename)
lines = [line for line in f.readlines()
@@ -61,7 +61,7 @@ class Coverage:
return
filename = self._strip_filename(filename)
p = Presentation(filename,
len(lines),
len(lines) - len(uncovered_lines))
@@ -69,7 +69,7 @@ class Coverage:
self.total_lines += p.lines
self.total_covered += p.covered
def main(args):
c = Coverage()
files = args[1:]
@@ -82,6 +82,6 @@ def main(args):
c.add_file(file)
c.show_results()
if __name__ == '__main__':
sys.exit(main(sys.argv))

View File

@@ -145,5 +145,3 @@ class PopenTask(task.Task):
Called when the command is missing.
"""
pass

View File

@@ -18,8 +18,8 @@ def load_device(device):
"""
logger.debug("loading (eject -t) device %s", device)
os.system('eject -t %s' % device)
def unmount_device(device):
"""
Unmount the given device if it is mounted, as happens with automounted

View File

@@ -114,5 +114,3 @@ class MetadataTestCase(unittest.TestCase):
';ec07a209-55ff-4084-bc41-9d4d1764e075'
';f626b92e-07b1-4a19-ad13-c09d690db66c'
)

View File

@@ -442,4 +442,3 @@ class SurferRosaTestCase(common.TestCase):
self.assertEquals(t.getIndex(2).absolute, 111257 + 3370)
# print self.toc.table.cue()

View File

@@ -91,4 +91,3 @@ class CacheTestCase(common.TestCase):
t = AnalyzeFileTask(path)
self.runner.run(t)
self.failUnless(t.defeatsCache)