- removed not needed imports

- fixed wrong list comprehensions
- other minor fixes

bzr-revno: 1768
This commit is contained in:
Andreas Preikschat 2011-10-04 17:50:09 +02:00
commit ef3134d3d9
10 changed files with 13 additions and 12 deletions

View File

@ -28,7 +28,6 @@
import logging
import chardet
import os
import re
import sqlite3
from PyQt4 import QtCore

View File

@ -82,13 +82,16 @@ class BGExtract(object):
Receiver.send_message(u'openlp_process_events')
footnotes = soup.findAll(u'sup', u'footnote')
if footnotes:
[footnote.extract() for footnote in footnotes]
for footnote in footnotes:
footnote.extract()
crossrefs = soup.findAll(u'sup', u'xref')
if crossrefs:
[crossref.extract() for crossref in crossrefs]
for crossref in crossrefs:
crossref.extract()
headings = soup.findAll(u'h5')
if headings:
[heading.extract() for heading in headings]
for heading in headings:
heading.extract()
cleanup = [(re.compile('\s+'), lambda match: ' ')]
verses = BeautifulSoup(str(soup), markupMassage=cleanup)
verse_list = {}

View File

@ -28,7 +28,6 @@
from PyQt4 import QtCore, QtGui
from openlp.core.lib import SettingsTab, translate, Receiver
from openlp.core.lib.ui import UiStrings, create_valign_combo
class ImageTab(SettingsTab):
"""

View File

@ -32,7 +32,7 @@ import shutil
from PyQt4 import QtCore
from openlp.core.lib import Receiver, check_directory_exists, create_thumb, \
resize_image, validate_thumb
validate_thumb
from openlp.core.utils import AppLocation
log = logging.getLogger(__name__)

View File

@ -87,7 +87,7 @@ class PresentationPlugin(Plugin):
to close down their applications and release resources.
"""
log.info(u'Plugin Finalise')
#Ask each controller to tidy up
# Ask each controller to tidy up.
for key in self.controllers:
controller = self.controllers[key]
if controller.enabled():

View File

@ -333,5 +333,6 @@ class CCLIFileImport(SongImport):
if len(author_list) < 2:
author_list = song_author.split(u'|')
# Clean spaces before and after author names.
[self.addAuthor(author_name.strip()) for author_name in author_list]
for author_name in author_list:
self.addAuthor(author_name.strip())
return self.finish()

View File

@ -397,7 +397,8 @@ class SongMediaItem(MediaManagerItem):
try:
os.remove(media_file.file_name)
except:
log.exception('Could not remove file: %s', audio)
log.exception('Could not remove file: %s',
media_file.file_name)
try:
save_path = os.path.join(AppLocation.get_section_data_path(
self.plugin.name), 'audio', str(item_id))

View File

@ -30,7 +30,6 @@ songs from the database to the OpenLyrics format.
"""
import logging
import os
import re
from lxml import etree

View File

@ -29,7 +29,7 @@ The :mod:`upgrade` module provides a way for the database and schema that is the
backend for the Songs plugin
"""
from sqlalchemy import Column, ForeignKey, Table, types
from sqlalchemy import Column, Table, types
from sqlalchemy.sql.expression import func
from migrate import changeset
from migrate.changeset.constraint import ForeignKeyConstraint

View File

@ -28,7 +28,6 @@
from PyQt4 import QtCore, QtGui
from openlp.core.lib import translate
from openlp.core.lib.ui import create_accept_reject_button_box
class Ui_SongUsageDeleteDialog(object):
def setupUi(self, songUsageDeleteDialog):