Fix several issues in the gstreamer removal PR

Patch by JoeLametta
This commit is contained in:
Merlijn Wajer
2017-04-23 22:32:05 +02:00
parent e7767694af
commit 304c66876b
6 changed files with 3 additions and 25 deletions

View File

@@ -31,7 +31,6 @@ import gobject
gobject.threads_init()
from morituri.command.basecommand import BaseCommand
from morituri.common import encode
from morituri.common import (
accurip, common, config, drive, program, task
)
@@ -510,7 +509,8 @@ Log files will log the path to tracks relative to this directory.
logger.debug('writing m3u file for %r', discName)
m3uPath = u'%s.m3u' % discName
handle = open(m3uPath, 'w')
handle.write(u'#EXTM3U\n')
u = u'#EXTM3U\n'
handle.write(u.encode('utf-8'))
def writeFile(handle, path, length):
targetPath = common.getRelativePath(path, m3uPath)

View File

@@ -153,14 +153,6 @@ class Encode(BaseCommand):
# here to avoid import gst eating our options
from morituri.common import encode
default = 'flac'
# slated for deletion as flac will be the only encoder
self.parser.add_argument('--profile',
action="store",
dest="profile",
help="profile for encoding (default '%s', choices '%s')" % (
default, "', '".join(encode.ALL_PROFILES.keys())),
default=default)
self.parser.add_argument('input', action='store',
help="audio file to encode")
self.parser.add_argument('output', nargs='?', action='store',
@@ -168,7 +160,6 @@ class Encode(BaseCommand):
def do(self):
from morituri.common import encode
profile = encode.ALL_PROFILES[self.options.profile]()
try:
fromPath = unicode(self.options.input)
@@ -180,7 +171,7 @@ class Encode(BaseCommand):
try:
toPath = unicode(self.options.output)
except IndexError:
toPath = fromPath + '.' + profile.extension
toPath = fromPath + '.flac'
runner = task.SyncRunner()

View File

@@ -81,7 +81,6 @@ CD in the AccurateRip database."""
logger.debug('Trying with offsets %r', self._offsets)
def do(self):
prog = program.Program(config.Config())
runner = ctask.SyncRunner()
device = self.options.device