Solve all flake8 warnings (#163)

Whipper is now fully PEP8 compliant.
Revised version which includes all the changes suggested by Freso.
This commit is contained in:
JoeLametta
2017-05-31 23:09:36 +02:00
committed by GitHub
parent b331f53b47
commit b6fb7e8a86
49 changed files with 614 additions and 539 deletions

View File

@@ -21,7 +21,6 @@
import os
import os.path
import commands
import math
import subprocess
@@ -32,7 +31,7 @@ logger = logging.getLogger(__name__)
FRAMES_PER_SECOND = 75
SAMPLES_PER_FRAME = 588 # a sample is 2 16-bit values, left and right channel
SAMPLES_PER_FRAME = 588 # a sample is 2 16-bit values, left and right channel
WORDS_PER_FRAME = SAMPLES_PER_FRAME * 2
BYTES_PER_FRAME = SAMPLES_PER_FRAME * 4
@@ -41,6 +40,7 @@ class EjectError(SystemError):
"""
Possibly ejects the drive in command.main.
"""
def __init__(self, device, *args):
"""
args is a tuple used by BaseException.__str__
@@ -60,7 +60,7 @@ def msfToFrames(msf):
@rtype: int
@returns: number of frames
"""
if not ':' in msf:
if ':' not in msf:
return int(msf)
m, s, f = msf.split(':')
@@ -133,6 +133,7 @@ def formatTime(seconds, fractional=3):
return " ".join(chunks)
class MissingDependencyException(Exception):
dependency = None
@@ -144,6 +145,7 @@ class MissingDependencyException(Exception):
class EmptyError(Exception):
pass
class MissingFrames(Exception):
"""
Less frames decoded than expected.
@@ -289,8 +291,8 @@ class VersionGetter(object):
try:
p = asyncsub.Popen(self._args,
stdin=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.PIPE, close_fds=True)
stdin=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.PIPE, close_fds=True)
p.wait()
output = asyncsub.recv_some(p, e=0, stderr=1)
vre = self._regexp.search(output)