Remove unnecessary import and move one more constant to module level. Thanks, Tim.

This commit is contained in:
Mattias Põldaru 2012-07-04 08:31:27 +03:00
parent 7871dfdf00
commit 16186c3960

View File

@ -25,7 +25,6 @@
# Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Temple Place, Suite 330, Boston, MA 02111-1307 USA #
############################################################################### ###############################################################################
import logging
import os import os
import re import re
@ -33,16 +32,7 @@ from openlp.plugins.songs.lib import VerseType, retrieve_windows_encoding
from openlp.plugins.songs.lib import strip_rtf from openlp.plugins.songs.lib import strip_rtf
from openlp.plugins.songs.lib.songimport import SongImport from openlp.plugins.songs.lib.songimport import SongImport
log = logging.getLogger(__name__) HOTKEY_TO_VERSE_TYPE = {
class SundayPlusImport(SongImport):
"""
Import Sunday Plus songs
The format examples can be found attached to bug report at
<http://support.openlp.org/issues/395>
"""
HOTKEY_TO_VERSE_TYPE = {
u'1': u'v1', u'1': u'v1',
u'2': u'v2', u'2': u'v2',
u'3': u'v3', u'3': u'v3',
@ -56,6 +46,14 @@ class SundayPlusImport(SongImport):
u'+': u'b', u'+': u'b',
u'Z': u'o'} u'Z': u'o'}
class SundayPlusImport(SongImport):
"""
Import Sunday Plus songs
The format examples can be found attached to bug report at
<http://support.openlp.org/issues/395>
"""
def __init__(self, manager, **kwargs): def __init__(self, manager, **kwargs):
""" """
Initialise the class. Initialise the class.
@ -146,8 +144,8 @@ class SundayPlusImport(SongImport):
# Hotkey always appears after MARKER_NAME, so it # Hotkey always appears after MARKER_NAME, so it
# effectively overrides MARKER_NAME, if present. # effectively overrides MARKER_NAME, if present.
if len(value) and \ if len(value) and \
value in self.HOTKEY_TO_VERSE_TYPE.keys(): value in HOTKEY_TO_VERSE_TYPE.keys():
verse_type = self.HOTKEY_TO_VERSE_TYPE[value] verse_type = HOTKEY_TO_VERSE_TYPE[value]
if name == 'rtf': if name == 'rtf':
value = self.unescape(value) value = self.unescape(value)
verse, self.encoding = strip_rtf(value, self.encoding) verse, self.encoding = strip_rtf(value, self.encoding)