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

View File

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

View File

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