forked from openlp/openlp
PEP8
This commit is contained in:
parent
ad982e9fa3
commit
830e3d6624
@ -51,6 +51,7 @@ class Author(BaseModel):
|
|||||||
return "%s: %s" % (AuthorType.Types[author_type], self.display_name)
|
return "%s: %s" % (AuthorType.Types[author_type], self.display_name)
|
||||||
return self.display_name
|
return self.display_name
|
||||||
|
|
||||||
|
|
||||||
class AuthorSong(BaseModel):
|
class AuthorSong(BaseModel):
|
||||||
"""
|
"""
|
||||||
Relationship between Authors and Songs (many to many).
|
Relationship between Authors and Songs (many to many).
|
||||||
@ -60,6 +61,7 @@ class AuthorSong(BaseModel):
|
|||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class AuthorType(object):
|
class AuthorType(object):
|
||||||
"""
|
"""
|
||||||
Enumeration for Author types.
|
Enumeration for Author types.
|
||||||
@ -74,6 +76,7 @@ class AuthorType(object):
|
|||||||
Translation: translate('OpenLP.Ui', 'Translation')
|
Translation: translate('OpenLP.Ui', 'Translation')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class Book(BaseModel):
|
class Book(BaseModel):
|
||||||
"""
|
"""
|
||||||
Book model
|
Book model
|
||||||
@ -81,6 +84,7 @@ class Book(BaseModel):
|
|||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return '<Book id="%s" name="%s" publisher="%s" />' % (str(self.id), self.name, self.publisher)
|
return '<Book id="%s" name="%s" publisher="%s" />' % (str(self.id), self.name, self.publisher)
|
||||||
|
|
||||||
|
|
||||||
class MediaFile(BaseModel):
|
class MediaFile(BaseModel):
|
||||||
"""
|
"""
|
||||||
MediaFile model
|
MediaFile model
|
||||||
|
@ -234,8 +234,7 @@ class SongMediaItem(MediaManagerItem):
|
|||||||
if song.temporary:
|
if song.temporary:
|
||||||
continue
|
continue
|
||||||
author_list = [author.display_name for author in song.authors]
|
author_list = [author.display_name for author in song.authors]
|
||||||
song_detail = '%s (%s)' % (song.title, create_separated_list(author_list)) if author_list\
|
song_detail = '%s (%s)' % (song.title, create_separated_list(author_list)) if author_list else song.title
|
||||||
else '%s'%song.title
|
|
||||||
song_name = QtGui.QListWidgetItem(song_detail)
|
song_name = QtGui.QListWidgetItem(song_detail)
|
||||||
song_name.setData(QtCore.Qt.UserRole, song.id)
|
song_name.setData(QtCore.Qt.UserRole, song.id)
|
||||||
self.list_view.addItem(song_name)
|
self.list_view.addItem(song_name)
|
||||||
@ -489,13 +488,17 @@ class SongMediaItem(MediaManagerItem):
|
|||||||
item.raw_footer = []
|
item.raw_footer = []
|
||||||
item.raw_footer.append(song.title)
|
item.raw_footer.append(song.title)
|
||||||
if authors_none:
|
if authors_none:
|
||||||
item.raw_footer.append("%s: %s"%(translate('OpenLP.Ui', 'Written by'), create_separated_list(authors_none)))
|
item.raw_footer.append("%s: %s" % (translate('OpenLP.Ui', 'Written by'),
|
||||||
|
create_separated_list(authors_none)))
|
||||||
if authors_words:
|
if authors_words:
|
||||||
item.raw_footer.append("%s: %s"%(AuthorType.Types[AuthorType.Words], create_separated_list(authors_words)))
|
item.raw_footer.append("%s: %s" % (AuthorType.Types[AuthorType.Words],
|
||||||
|
create_separated_list(authors_words)))
|
||||||
if authors_music:
|
if authors_music:
|
||||||
item.raw_footer.append("%s: %s"%(AuthorType.Types[AuthorType.Music], create_separated_list(authors_music)))
|
item.raw_footer.append("%s: %s" % (AuthorType.Types[AuthorType.Music],
|
||||||
|
create_separated_list(authors_music)))
|
||||||
if authors_translation:
|
if authors_translation:
|
||||||
item.raw_footer.append("%s: %s"%(AuthorType.Types[AuthorType.Translation], create_separated_list(authors_translation)))
|
item.raw_footer.append("%s: %s" % (AuthorType.Types[AuthorType.Translation],
|
||||||
|
create_separated_list(authors_translation)))
|
||||||
if not authors_all: # No authors defined
|
if not authors_all: # No authors defined
|
||||||
item.raw_footer.append(SongStrings.AuthorUnknown)
|
item.raw_footer.append(SongStrings.AuthorUnknown)
|
||||||
item.raw_footer.append(song.copyright)
|
item.raw_footer.append(song.copyright)
|
||||||
|
@ -98,6 +98,7 @@ def upgrade_3(session, metadata):
|
|||||||
except OperationalError:
|
except OperationalError:
|
||||||
log.info('Upgrade 3 has already been run')
|
log.info('Upgrade 3 has already been run')
|
||||||
|
|
||||||
|
|
||||||
def upgrade_4(session, metadata):
|
def upgrade_4(session, metadata):
|
||||||
"""
|
"""
|
||||||
Version 4 upgrade.
|
Version 4 upgrade.
|
||||||
|
Loading…
Reference in New Issue
Block a user