Fix English and alignment

bzr-revno: 947
This commit is contained in:
Jon Tibble 2010-07-16 22:03:41 +01:00
commit 103cc83960

View File

@ -137,7 +137,7 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
def checkAuthor(self, new_author, edit=False): def checkAuthor(self, new_author, edit=False):
""" """
Returns False when the given Author is already in the list elsewise Returns False if the given Author is already in the list otherwise
True. True.
""" """
authors = self.songmanager.get_all_objects_filtered(Author, authors = self.songmanager.get_all_objects_filtered(Author,
@ -163,11 +163,10 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
def checkTopic(self, new_topic, edit=False): def checkTopic(self, new_topic, edit=False):
""" """
Returns False when the given Topic is already in the list elsewise True. Returns False if the given Topic is already in the list otherwise True.
""" """
topics = self.songmanager.get_all_objects_filtered(Topic, topics = self.songmanager.get_all_objects_filtered(Topic,
Topic.name == new_topic.name Topic.name == new_topic.name)
)
if len(topics) > 0: if len(topics) > 0:
# If we edit an existing Topic, we need to make sure that we do # If we edit an existing Topic, we need to make sure that we do
# not return False when nothing has changed (because this would # not return False when nothing has changed (because this would
@ -184,25 +183,22 @@ class SongMaintenanceForm(QtGui.QDialog, Ui_SongMaintenanceDialog):
def checkBook(self, new_book, edit=False): def checkBook(self, new_book, edit=False):
""" """
Returns False when the given Book is already in the list elsewise True. Returns False if the given Book is already in the list otherwise True.
""" """
books = self.songmanager.get_all_objects_filtered(Book, books = self.songmanager.get_all_objects_filtered(Book,
and_( and_(Book.name == new_book.name,
Book.name == new_book.name, Book.publisher == new_book.publisher))
Book.publisher == new_book.publisher
)
)
if len(books) > 0: if len(books) > 0:
# If we edit an existing Book, we need to make sure that we do # If we edit an existing Book, we need to make sure that we do
# not return False when nothing has changed (because this would # not return False when nothing has changed (because this would
# cause an error message later on). # cause an error message later on).
if edit: if edit:
if books[0].id == new_book.id: if books[0].id == new_book.id:
return True return True
else:
return False
else: else:
return False return False
else:
return False
else: else:
return True return True