shortened some long lines.

This commit is contained in:
Philip Ridout 2010-08-27 21:14:23 +01:00
parent 4e059f8cc5
commit e4f4626f04

View File

@ -116,13 +116,14 @@ class WowImport(SongImport):
self.import_wizard.importProgressBar.setMaximum( self.import_wizard.importProgressBar.setMaximum(
len(self.import_source)) len(self.import_source))
for file in self.import_source: for file in self.import_source:
# TODO: check that it is a valid words of worship file (could check # TODO: check that it is a valid words of worship file (could
# header for WoW File Song Word) # check header for WoW File Song Word)
self.author = u'' self.author = u''
self.copyright= u'' self.copyright= u''
# Get the song title # Get the song title
self.file_name = os.path.split(file)[1] self.file_name = os.path.split(file)[1]
self.import_wizard.incrementProgressBar("Importing %s" % (self.file_name), 0) self.import_wizard.incrementProgressBar(
"Importing %s" % (self.file_name), 0)
self.title = self.file_name.rpartition(u'.')[0] self.title = self.file_name.rpartition(u'.')[0]
self.songData = open(file, 'rb') self.songData = open(file, 'rb')
# Seek to byte which stores number of blocks in the song # Seek to byte which stores number of blocks in the song
@ -155,16 +156,17 @@ class WowImport(SongImport):
# Now to extact the author # Now to extact the author
self.author_length = ord(self.songData.read(1)) self.author_length = ord(self.songData.read(1))
if self.author_length != 0: if self.author_length != 0:
self.author = unicode(self.songData.read(self.author_length), self.author = unicode(
u'cp1252') self.songData.read(self.author_length), u'cp1252')
# Finally the copyright # Finally the copyright
self.copyright_length = ord(self.songData.read(1)) self.copyright_length = ord(self.songData.read(1))
if self.copyright_length != 0: if self.copyright_length != 0:
self.copyright = unicode(self.songData.read(self.copyright_length), self.copyright = unicode(
u'cp1252') self.songData.read(self.copyright_length), u'cp1252')
self.parse_author(self.author) self.parse_author(self.author)
self.add_copyright(self.copyright) self.add_copyright(self.copyright)
self.songData.close() self.songData.close()
self.finish() self.finish()
self.import_wizard.incrementProgressBar("Importing %s" % (self.file_name)) self.import_wizard.incrementProgressBar(
"Importing %s" % (self.file_name))
return True return True