Initial pass on python 3 port

Given the imminent end-of-life for Python 2, I didn't bother making the
codebase compatible with both.

Signed-off-by: Drew DeVault <sir@cmpwn.com>
This commit is contained in:
Drew DeVault
2019-08-10 11:45:17 +09:00
committed by JoeLametta
parent f740a0ef0d
commit 64dd9d843a
33 changed files with 274 additions and 317 deletions

View File

@@ -21,11 +21,11 @@ class AudioLengthTask(ctask.PopenTask):
def __init__(self, path):
"""
:type path: unicode
:type path: str
"""
assert isinstance(path, unicode), "%r is not unicode" % path
assert isinstance(path, str), "%r is not str" % path
self.logName = os.path.basename(path).encode('utf-8')
self.logName = os.path.basename(path)
self.command = [SOXI, '-s', path]
@@ -47,4 +47,4 @@ class AudioLengthTask(ctask.PopenTask):
def done(self):
if self._error:
logger.warning("soxi reported on stderr: %s", "".join(self._error))
self.length = int("".join(self._output))
self.length = int("".join(o.decode() for o in self._output))