Start cleaning getters and setters

This commit is contained in:
Jon Tibble 2010-07-16 22:06:10 +01:00
parent 65d5f89302
commit 5097cbaf9c
3 changed files with 7 additions and 23 deletions

View File

@ -142,7 +142,7 @@ class SofImport(OooImport):
self.blanklines += 1
if self.blanklines > 1:
return
if self.song.get_title() != u'':
if self.song.title != u'':
self.finish_verse()
return
self.blanklines = 0
@ -166,7 +166,7 @@ class SofImport(OooImport):
self.finish_verse()
self.song.repeat_verse()
return
if self.song.get_title() == u'':
if self.song.title == u'':
if self.song.get_copyright() == u'':
self.add_author(text)
else:
@ -190,7 +190,7 @@ class SofImport(OooImport):
if boldtext.isdigit() and self.song.get_song_number() == '':
self.add_songnumber(boldtext)
return u''
if self.song.get_title() == u'':
if self.song.title == u'':
text = self.uncap_text(text)
self.add_title(text)
return text
@ -245,7 +245,7 @@ class SofImport(OooImport):
title = title[1:]
if title.endswith(u','):
title = title[:-1]
self.song.set_title(title)
self.song.title = title
def add_author(self, text):
"""

View File

@ -123,16 +123,10 @@ class SongImport(object):
if len(lines) == 1:
self.parse_author(lines[0])
return
if not self.get_title():
self.set_title(lines[0])
if not self.title:
self.title = lines[0]
self.add_verse(text)
def get_title(self):
"""
Return the title
"""
return self.title
def get_copyright(self):
"""
Return the copyright
@ -145,12 +139,6 @@ class SongImport(object):
"""
return self.song_number
def set_title(self, title):
"""
Set the title
"""
self.title = title
def set_alternate_title(self, title):
"""
Set the alternate title

View File

@ -366,10 +366,6 @@ class Song(object):
if len(self.search_title) < 1:
raise SongTitleError(u'The searchable title is empty')
def get_title(self):
"""Return title value"""
return self.title
def from_ccli_text_buffer(self, textList):
"""
Create song from a list of texts (strings) - CCLI text format expected
@ -688,7 +684,7 @@ class Song(object):
raise SongSlideError(u'Slide number too high')
res = []
if self.show_title:
title = self.get_title()
title = self.title
else:
title = ""
if self.show_author_list: