mirror of
https://github.com/beetbox/beets.git
synced 2025-12-27 11:02:43 +01:00
Removed import of unicode_literals from plugins
* mpdstats * mpdupdate * permissions * zero
This commit is contained in:
parent
48098c3741
commit
feab3df910
4 changed files with 16 additions and 20 deletions
|
|
@ -13,8 +13,7 @@
|
|||
# The above copyright notice and this permission notice shall be
|
||||
# included in all copies or substantial portions of the Software.
|
||||
|
||||
from __future__ import (division, absolute_import, print_function,
|
||||
unicode_literals)
|
||||
from __future__ import (division, absolute_import, print_function)
|
||||
|
||||
import mpd
|
||||
import socket
|
||||
|
|
@ -80,7 +79,7 @@ class MPDClientWrapper(object):
|
|||
try:
|
||||
self.client.connect(host, port)
|
||||
except socket.error as e:
|
||||
raise ui.UserError('could not connect to MPD: {0}'.format(e))
|
||||
raise ui.UserError(u'could not connect to MPD: {0}'.format(e))
|
||||
|
||||
password = mpd_config['password'].get(unicode)
|
||||
if password:
|
||||
|
|
@ -88,7 +87,7 @@ class MPDClientWrapper(object):
|
|||
self.client.password(password)
|
||||
except mpd.CommandError as e:
|
||||
raise ui.UserError(
|
||||
'could not authenticate to MPD: {0}'.format(e)
|
||||
u'could not authenticate to MPD: {0}'.format(e)
|
||||
)
|
||||
|
||||
def disconnect(self):
|
||||
|
|
@ -338,16 +337,16 @@ class MPDStatsPlugin(plugins.BeetsPlugin):
|
|||
def commands(self):
|
||||
cmd = ui.Subcommand(
|
||||
'mpdstats',
|
||||
help='run a MPD client to gather play statistics')
|
||||
help=u'run a MPD client to gather play statistics')
|
||||
cmd.parser.add_option(
|
||||
'--host', dest='host', type='string',
|
||||
help='set the hostname of the server to connect to')
|
||||
u'--host', dest='host', type='string',
|
||||
help=u'set the hostname of the server to connect to')
|
||||
cmd.parser.add_option(
|
||||
'--port', dest='port', type='int',
|
||||
help='set the port of the MPD server to connect to')
|
||||
u'--port', dest='port', type='int',
|
||||
help=u'set the port of the MPD server to connect to')
|
||||
cmd.parser.add_option(
|
||||
'--password', dest='password', type='string',
|
||||
help='set the password of the MPD server to connect to')
|
||||
u'--password', dest='password', type='string',
|
||||
help=u'set the password of the MPD server to connect to')
|
||||
|
||||
def func(lib, opts, args):
|
||||
mpd_config.set_args(opts)
|
||||
|
|
|
|||
|
|
@ -21,8 +21,7 @@ Put something like the following in your config.yaml to configure:
|
|||
port: 6600
|
||||
password: seekrit
|
||||
"""
|
||||
from __future__ import (division, absolute_import, print_function,
|
||||
unicode_literals)
|
||||
from __future__ import (division, absolute_import, print_function)
|
||||
|
||||
from beets.plugins import BeetsPlugin
|
||||
import os
|
||||
|
|
@ -126,4 +125,4 @@ class MPDUpdatePlugin(BeetsPlugin):
|
|||
|
||||
s.send('close\n')
|
||||
s.close()
|
||||
self._log.info('Database updated.')
|
||||
self._log.info(u'Database updated.')
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
from __future__ import (division, absolute_import, print_function,
|
||||
unicode_literals)
|
||||
from __future__ import (division, absolute_import, print_function)
|
||||
|
||||
"""Fixes file permissions after the file gets written on import. Put something
|
||||
like the following in your config.yaml to configure:
|
||||
|
|
@ -82,7 +81,7 @@ def permissions(lib, item=None, album=None):
|
|||
|
||||
# Checks if the destination path has the permissions configured.
|
||||
if not check_permissions(util.bytestring_path(path), file_perm):
|
||||
message = 'There was a problem setting permission on {}'.format(
|
||||
message = u'There was a problem setting permission on {}'.format(
|
||||
path)
|
||||
print(message)
|
||||
|
||||
|
|
@ -98,6 +97,6 @@ def permissions(lib, item=None, album=None):
|
|||
|
||||
# Checks if the destination path has the permissions configured.
|
||||
if not check_permissions(util.bytestring_path(path), dir_perm):
|
||||
message = 'There was a problem setting permission on {}'.format(
|
||||
message = u'There was a problem setting permission on {}'.format(
|
||||
path)
|
||||
print(message)
|
||||
|
|
|
|||
|
|
@ -15,8 +15,7 @@
|
|||
|
||||
""" Clears tag fields in media files."""
|
||||
|
||||
from __future__ import (division, absolute_import, print_function,
|
||||
unicode_literals)
|
||||
from __future__ import (division, absolute_import, print_function)
|
||||
|
||||
import re
|
||||
from beets.plugins import BeetsPlugin
|
||||
|
|
|
|||
Loading…
Reference in a new issue