From feab3df9108b3449d9758eb780ee0fa59cffe6a2 Mon Sep 17 00:00:00 2001
From: Peter Kessen
Date: Sat, 20 Feb 2016 14:12:37 +0100
Subject: [PATCH] Removed import of unicode_literals from plugins
* mpdstats
* mpdupdate
* permissions
* zero
---
beetsplug/mpdstats.py | 21 ++++++++++-----------
beetsplug/mpdupdate.py | 5 ++---
beetsplug/permissions.py | 7 +++----
beetsplug/zero.py | 3 +--
4 files changed, 16 insertions(+), 20 deletions(-)
diff --git a/beetsplug/mpdstats.py b/beetsplug/mpdstats.py
index 326afe4da..a2ade3186 100644
--- a/beetsplug/mpdstats.py
+++ b/beetsplug/mpdstats.py
@@ -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)
diff --git a/beetsplug/mpdupdate.py b/beetsplug/mpdupdate.py
index 5e4e999aa..70fb4c749 100644
--- a/beetsplug/mpdupdate.py
+++ b/beetsplug/mpdupdate.py
@@ -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.')
diff --git a/beetsplug/permissions.py b/beetsplug/permissions.py
index 8a4ab960b..1099aad51 100644
--- a/beetsplug/permissions.py
+++ b/beetsplug/permissions.py
@@ -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)
diff --git a/beetsplug/zero.py b/beetsplug/zero.py
index b427bbe8a..5623aa3df 100644
--- a/beetsplug/zero.py
+++ b/beetsplug/zero.py
@@ -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