mirror of
https://github.com/gryf/flac2ogg.git
synced 2025-12-18 20:10:21 +01:00
Python3 compatibility
This commit is contained in:
11
flac2ogg.py
11
flac2ogg.py
@@ -61,7 +61,8 @@ def get_filepaths_recursively(pattern=None):
|
|||||||
if pattern and len(pattern) == 1 and pattern[0].startswith("*"):
|
if pattern and len(pattern) == 1 and pattern[0].startswith("*"):
|
||||||
pat = "." + pattern[0]
|
pat = "." + pattern[0]
|
||||||
else:
|
else:
|
||||||
print "Recursive option only works with simple pattern for files match"
|
print("Recursive option only works with simple pattern for files"
|
||||||
|
" match")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
files_ = []
|
files_ = []
|
||||||
@@ -295,7 +296,7 @@ class ApeType(FileType):
|
|||||||
"""Ape filetype"""
|
"""Ape filetype"""
|
||||||
|
|
||||||
def extract_wav(self):
|
def extract_wav(self):
|
||||||
"""Extract mpc file to wav"""
|
"""Extract ape file to wav"""
|
||||||
sp.check_call(["mac", self.filename, self.wav, "-d"])
|
sp.check_call(["mac", self.filename, self.wav, "-d"])
|
||||||
|
|
||||||
|
|
||||||
@@ -396,11 +397,11 @@ class Converter(object):
|
|||||||
base + ".wv.cue", base + ".ape.cue"):
|
base + ".wv.cue", base + ".ape.cue"):
|
||||||
if os.path.exists(tmp):
|
if os.path.exists(tmp):
|
||||||
cuefile = tmp
|
cuefile = tmp
|
||||||
print "*** cuefile: %s" % cuefile
|
print("*** cuefile: %s" % cuefile)
|
||||||
break
|
break
|
||||||
|
|
||||||
if cuefile is None:
|
if cuefile is None:
|
||||||
print "*** No cuefile found for `%s'" % filename
|
print("*** No cuefile found for `%s'" % filename)
|
||||||
return
|
return
|
||||||
|
|
||||||
cue = CueObjectParser(cuefile)
|
cue = CueObjectParser(cuefile)
|
||||||
@@ -409,7 +410,7 @@ class Converter(object):
|
|||||||
# list of wavs to encode
|
# list of wavs to encode
|
||||||
klass = Converter.extract_map.get(ext.lower())
|
klass = Converter.extract_map.get(ext.lower())
|
||||||
if not klass:
|
if not klass:
|
||||||
print "*** Cannot find right converter for `%s'" % ext
|
print("*** Cannot find right converter for `%s'" % ext)
|
||||||
return
|
return
|
||||||
|
|
||||||
fobj = klass(filename, encoder)
|
fobj = klass(filename, encoder)
|
||||||
|
|||||||
Reference in New Issue
Block a user