openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #01748
[Merge] lp:~meths/openlp/trivialfixes into lp:openlp
Jon Tibble has proposed merging lp:~meths/openlp/trivialfixes into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
Move VerseType into lib
--
https://code.launchpad.net/~meths/openlp/trivialfixes/+merge/27419
Your team OpenLP Core is requested to review the proposed merge of lp:~meths/openlp/trivialfixes into lp:openlp.
=== modified file 'openlp/plugins/songs/forms/__init__.py'
--- openlp/plugins/songs/forms/__init__.py 2010-06-10 19:45:02 +0000
+++ openlp/plugins/songs/forms/__init__.py 2010-06-12 12:35:40 +0000
@@ -23,74 +23,6 @@
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
###############################################################################
-from openlp.core.lib import translate
-
-class VerseType(object):
- """
- VerseType provides an enumeration for the tags that may be associated
- with verses in songs.
- """
- Verse = 0
- Chorus = 1
- Bridge = 2
- PreChorus = 3
- Intro = 4
- Ending = 5
- Other = 6
-
- @staticmethod
- def to_string(verse_type):
- """
- Return a string for a given VerseType
-
- ``verse_type``
- The type to return a string for
- """
- if verse_type == VerseType.Verse:
- return translate(u'VerseType', u'Verse')
- elif verse_type == VerseType.Chorus:
- return translate(u'VerseType', u'Chorus')
- elif verse_type == VerseType.Bridge:
- return translate(u'VerseType', u'Bridge')
- elif verse_type == VerseType.PreChorus:
- return translate(u'VerseType', u'Pre-Chorus')
- elif verse_type == VerseType.Intro:
- return translate(u'VerseType', u'Intro')
- elif verse_type == VerseType.Ending:
- return translate(u'VerseType', u'Ending')
- elif verse_type == VerseType.Other:
- return translate(u'VerseType', u'Other')
-
- @staticmethod
- def from_string(verse_type):
- """
- Return the VerseType for a given string
-
- ``verse_type``
- The string to return a VerseType for
- """
- verse_type = verse_type.lower()
- if verse_type == unicode(VerseType.to_string(VerseType.Verse)).lower():
- return VerseType.Verse
- elif verse_type == \
- unicode(VerseType.to_string(VerseType.Chorus)).lower():
- return VerseType.Chorus
- elif verse_type == \
- unicode(VerseType.to_string(VerseType.Bridge)).lower():
- return VerseType.Bridge
- elif verse_type == \
- unicode(VerseType.to_string(VerseType.PreChorus)).lower():
- return VerseType.PreChorus
- elif verse_type == \
- unicode(VerseType.to_string(VerseType.Intro)).lower():
- return VerseType.Intro
- elif verse_type == \
- unicode(VerseType.to_string(VerseType.Ending)).lower():
- return VerseType.Ending
- elif verse_type == \
- unicode(VerseType.to_string(VerseType.Other)).lower():
- return VerseType.Other
-
from authorsform import AuthorsForm
from topicsform import TopicsForm
from songbookform import SongBookForm
=== modified file 'openlp/plugins/songs/forms/editversedialog.py'
--- openlp/plugins/songs/forms/editversedialog.py 2010-06-08 15:38:09 +0000
+++ openlp/plugins/songs/forms/editversedialog.py 2010-06-12 12:35:40 +0000
@@ -26,7 +26,7 @@
from PyQt4 import QtCore, QtGui
from openlp.core.lib import translate
-from openlp.plugins.songs.forms import VerseType
+from openlp.plugins.songs.lib import VerseType
class Ui_EditVerseDialog(object):
def setupUi(self, EditVerseDialog):
=== modified file 'openlp/plugins/songs/forms/editverseform.py'
--- openlp/plugins/songs/forms/editverseform.py 2010-06-08 15:38:09 +0000
+++ openlp/plugins/songs/forms/editverseform.py 2010-06-12 12:35:40 +0000
@@ -28,7 +28,7 @@
from PyQt4 import QtCore, QtGui
-from openlp.plugins.songs.forms import VerseType
+from openlp.plugins.songs.lib import VerseType
from editversedialog import Ui_EditVerseDialog
=== modified file 'openlp/plugins/songs/lib/__init__.py'
--- openlp/plugins/songs/lib/__init__.py 2010-06-05 20:00:50 +0000
+++ openlp/plugins/songs/lib/__init__.py 2010-06-12 12:35:40 +0000
@@ -23,10 +23,77 @@
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
###############################################################################
+from openlp.core.lib import translate
+
+class VerseType(object):
+ """
+ VerseType provides an enumeration for the tags that may be associated
+ with verses in songs.
+ """
+ Verse = 0
+ Chorus = 1
+ Bridge = 2
+ PreChorus = 3
+ Intro = 4
+ Ending = 5
+ Other = 6
+
+ @staticmethod
+ def to_string(verse_type):
+ """
+ Return a string for a given VerseType
+
+ ``verse_type``
+ The type to return a string for
+ """
+ if verse_type == VerseType.Verse:
+ return translate(u'VerseType', u'Verse')
+ elif verse_type == VerseType.Chorus:
+ return translate(u'VerseType', u'Chorus')
+ elif verse_type == VerseType.Bridge:
+ return translate(u'VerseType', u'Bridge')
+ elif verse_type == VerseType.PreChorus:
+ return translate(u'VerseType', u'Pre-Chorus')
+ elif verse_type == VerseType.Intro:
+ return translate(u'VerseType', u'Intro')
+ elif verse_type == VerseType.Ending:
+ return translate(u'VerseType', u'Ending')
+ elif verse_type == VerseType.Other:
+ return translate(u'VerseType', u'Other')
+
+ @staticmethod
+ def from_string(verse_type):
+ """
+ Return the VerseType for a given string
+
+ ``verse_type``
+ The string to return a VerseType for
+ """
+ verse_type = verse_type.lower()
+ if verse_type == unicode(VerseType.to_string(VerseType.Verse)).lower():
+ return VerseType.Verse
+ elif verse_type == \
+ unicode(VerseType.to_string(VerseType.Chorus)).lower():
+ return VerseType.Chorus
+ elif verse_type == \
+ unicode(VerseType.to_string(VerseType.Bridge)).lower():
+ return VerseType.Bridge
+ elif verse_type == \
+ unicode(VerseType.to_string(VerseType.PreChorus)).lower():
+ return VerseType.PreChorus
+ elif verse_type == \
+ unicode(VerseType.to_string(VerseType.Intro)).lower():
+ return VerseType.Intro
+ elif verse_type == \
+ unicode(VerseType.to_string(VerseType.Ending)).lower():
+ return VerseType.Ending
+ elif verse_type == \
+ unicode(VerseType.to_string(VerseType.Other)).lower():
+ return VerseType.Other
+
from manager import SongManager
from songstab import SongsTab
from mediaitem import SongMediaItem
from sofimport import SofImport
from oooimport import OooImport
from songimport import SongImport
-
=== modified file 'openlp/plugins/songs/lib/songimport.py'
--- openlp/plugins/songs/lib/songimport.py 2010-06-06 22:30:11 +0000
+++ openlp/plugins/songs/lib/songimport.py 2010-06-12 12:35:40 +0000
@@ -28,8 +28,8 @@
from PyQt4 import QtGui
from openlp.core.lib import SongXMLBuilder
+from openlp.plugins.songs.lib import VerseType
from openlp.plugins.songs.lib.models import Song, Author, Topic, Book
-from openlp.plugins.songs.forms import VerseType
class SongImport(object):
"""
Follow ups