Address errors, improvements, formatting

- Removed unused code not portable due to buffer() use
- raw_input() does not exist in Python 3
- Fixed octal constant syntax for Python 3
- Fixed TypeError
- Replace if not exists: makedirs(path) with single call: using makedirs(path, exist_ok=True)
- Class inherits from object, can be safely removed from bases in python3: pylint's useless-object-inheritance (W0235) check

Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
This commit is contained in:
JoeLametta
2019-08-10 09:10:00 +00:00
parent 8446c290e7
commit 35201d5290
18 changed files with 31 additions and 65 deletions

View File

@@ -58,7 +58,7 @@ _INDEX_RE = re.compile(r"""
""", re.VERBOSE)
class CueFile(object):
class CueFile:
"""
I represent a .cue file as an object.
@@ -138,8 +138,8 @@ class CueFile(object):
seconds = int(m.expand('\\3'))
frames = int(m.expand('\\4'))
frameOffset = int(frames
+ seconds * common.FRAMES_PER_SECOND
+ minutes * common.FRAMES_PER_SECOND * 60)
+ seconds * common.FRAMES_PER_SECOND
+ minutes * common.FRAMES_PER_SECOND * 60)
logger.debug('found index %d of track %r in %r:%d',
indexNumber, currentTrack, currentFile.path,

View File

@@ -34,7 +34,7 @@ import logging
logger = logging.getLogger(__name__)
class Image(object):
class Image:
"""
:ivar table: The Table of Contents for this image.
:vartype table: table.Table

View File

@@ -157,7 +157,7 @@ class Index:
self.number, self.absolute, self.path, self.relative, self.counter)
class Table(object):
class Table:
"""
I represent a table of indexes on a CD.

View File

@@ -134,7 +134,7 @@ class Sources:
return self._sources[-1][1]
class TocFile(object):
class TocFile:
def __init__(self, path):
"""