From c7a8bbee8b520cd16660f72da11ca5f3c4f9aab4 Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Fri, 16 Jul 2010 22:26:57 +0100 Subject: [PATCH] More getters and setters --- openlp/plugins/songs/lib/sofimport.py | 23 +++++++++---------- openlp/plugins/songs/lib/songimport.py | 31 -------------------------- 2 files changed, 10 insertions(+), 44 deletions(-) diff --git a/openlp/plugins/songs/lib/sofimport.py b/openlp/plugins/songs/lib/sofimport.py index 8e78caceb..d6f9ea08e 100644 --- a/openlp/plugins/songs/lib/sofimport.py +++ b/openlp/plugins/songs/lib/sofimport.py @@ -167,7 +167,7 @@ class SofImport(OooImport): self.song.repeat_verse() return if self.song.title == u'': - if self.song.get_copyright() == u'': + if self.song.copyright == u'': self.add_author(text) else: self.song.add_copyright(text) @@ -187,7 +187,7 @@ class SofImport(OooImport): return text if textportion.CharWeight == BOLD: boldtext = text.strip() - if boldtext.isdigit() and self.song.get_song_number() == '': + if boldtext.isdigit() and self.song.song_number == '': self.add_songnumber(boldtext) return u'' if self.song.title == u'': @@ -220,20 +220,17 @@ class SofImport(OooImport): Add a song number, store as alternate title. Also use the song number to work out which songbook we're in """ - self.song.set_song_number(song_no) - self.song.set_alternate_title(song_no + u'.') + self.song.song_number = song_no + self.song.alternate_title = song_no + u'.' + self.song.song_book_pub = u'Kingsway Publications' if int(song_no) <= 640: - self.song.set_song_book(u'Songs of Fellowship 1', - u'Kingsway Publications') + self.song.song_book = u'Songs of Fellowship 1' elif int(song_no) <= 1150: - self.song.set_song_book(u'Songs of Fellowship 2', - u'Kingsway Publications') + self.song.song_book = u'Songs of Fellowship 2' elif int(song_no) <= 1690: - self.song.set_song_book(u'Songs of Fellowship 3', - u'Kingsway Publications') + self.song.song_book = u'Songs of Fellowship 3' else: - self.song.set_song_book(u'Songs of Fellowship 4', - u'Kingsway Publications') + self.song.song_book = u'Songs of Fellowship 4' def add_title(self, text): """ @@ -283,7 +280,7 @@ class SofImport(OooImport): splitat = None else: versetag = u'V' - splitat = self.verse_splits(self.song.get_song_number()) + splitat = self.verse_splits(self.song.song_number) if splitat: ln = 0 verse = u'' diff --git a/openlp/plugins/songs/lib/songimport.py b/openlp/plugins/songs/lib/songimport.py index 1db73baa3..904ace424 100644 --- a/openlp/plugins/songs/lib/songimport.py +++ b/openlp/plugins/songs/lib/songimport.py @@ -127,37 +127,6 @@ class SongImport(object): self.title = lines[0] self.add_verse(text) - def get_copyright(self): - """ - Return the copyright - """ - return self.copyright - - def get_song_number(self): - """ - Return the song number - """ - return self.song_number - - def set_alternate_title(self, title): - """ - Set the alternate title - """ - self.alternate_title = title - - def set_song_number(self, song_number): - """ - Set the song number - """ - self.song_number = song_number - - def set_song_book(self, song_book, publisher): - """ - Set the song book name and publisher - """ - self.song_book_name = song_book - self.song_book_pub = publisher - def add_copyright(self, copyright): """ Build the copyright field