diff --git a/openlp/migration/migratebibles.py b/openlp/migration/migratebibles.py index b73b016cf..c0d47fdb8 100644 --- a/openlp/migration/migratebibles.py +++ b/openlp/migration/migratebibles.py @@ -27,9 +27,9 @@ import os import sys import sqlite3 -from sqlalchemy import * +from sqlalchemy import * from sqlalchemy import create_engine -from sqlalchemy.orm import scoped_session, sessionmaker, mapper, relation +from sqlalchemy.orm import scoped_session, sessionmaker, mapper from openlp.core.lib import PluginConfig from openlp.plugins.bibles.lib.models import * @@ -223,4 +223,3 @@ class MigrateBibles(): conn.commit() conn.execute(u'vacuum;') conn.commit() - diff --git a/openlp/plugins/presentations/lib/impresscontroller.py b/openlp/plugins/presentations/lib/impresscontroller.py index dd0f86840..14e98273e 100644 --- a/openlp/plugins/presentations/lib/impresscontroller.py +++ b/openlp/plugins/presentations/lib/impresscontroller.py @@ -147,8 +147,8 @@ class ImpressController(PresentationController): Called at system exit to clean up any running presentations """ log.debug(u'Kill OpenOffice') - for doc in self.docs: - doc.close_presentation() + while self.docs: + self.docs[0].close_presentation() if os.name != u'nt': desktop = self.get_uno_desktop() else: diff --git a/openlp/plugins/presentations/lib/mediaitem.py b/openlp/plugins/presentations/lib/mediaitem.py index 35ec1721b..6e9bbfaed 100644 --- a/openlp/plugins/presentations/lib/mediaitem.py +++ b/openlp/plugins/presentations/lib/mediaitem.py @@ -143,7 +143,7 @@ class PresentationMediaItem(MediaManagerItem): for cidx in self.controllers: doc = self.controllers[cidx].add_doc(filepath) doc.presentation_deleted() - self.controllers[cidx].remove_doc(doc) + doc.close_presentation() def generateSlideData(self, service_item): items = self.ListView.selectedIndexes() @@ -171,7 +171,7 @@ class PresentationMediaItem(MediaManagerItem): service_item.add_from_command(path, name, img) i = i + 1 img = doc.get_slide_preview_file(i) - controller.remove_doc(doc) + doc.close_presentation() return True def findControllerByType(self, filename): diff --git a/openlp/plugins/presentations/lib/powerpointcontroller.py b/openlp/plugins/presentations/lib/powerpointcontroller.py index 45d040b45..67870574d 100644 --- a/openlp/plugins/presentations/lib/powerpointcontroller.py +++ b/openlp/plugins/presentations/lib/powerpointcontroller.py @@ -81,8 +81,9 @@ class PowerpointController(PresentationController): """ Called at system exit to clean up any running presentations """ - for doc in self.docs: - doc.close_presentation() + log.debug(u'Kill powerpoint') + while self.docs: + self.docs[0].close_presentation() if self.process is None: return if self.process.Presentations.Count > 0: @@ -149,12 +150,12 @@ class PowerpointDocument(PresentationDocument): Triggerent by new object being added to SlideController orOpenLP being shut down """ - if self.presentation is None: - return - try: - self.presentation.Close() - except: - pass + log.debug(u'ClosePresentation') + if self.presentation: + try: + self.presentation.Close() + except: + pass self.presentation = None self.controller.remove_doc(self) diff --git a/openlp/plugins/presentations/lib/pptviewcontroller.py b/openlp/plugins/presentations/lib/pptviewcontroller.py index 574441850..455e1c601 100644 --- a/openlp/plugins/presentations/lib/pptviewcontroller.py +++ b/openlp/plugins/presentations/lib/pptviewcontroller.py @@ -88,9 +88,9 @@ class PptviewController(PresentationController): """ Called at system exit to clean up any running presentations """ - log.debug(u'Kill') - for doc in self.docs: - doc.close_presentation() + log.debug(u'Kill pptviewer') + while self.docs: + self.docs[0].close_presentation() def add_doc(self, name): log.debug(u'Add Doc PPTView') @@ -137,6 +137,7 @@ class PptviewDocument(PresentationDocument): Triggerent by new object being added to SlideController orOpenLP being shut down """ + log.debug(u'ClosePresentation') self.controller.process.ClosePPT(self.pptid) self.pptid = -1 self.controller.remove_doc(self) diff --git a/openlp/plugins/songs/forms/editsongform.py b/openlp/plugins/songs/forms/editsongform.py index f6e0c11f5..976ee1e78 100644 --- a/openlp/plugins/songs/forms/editsongform.py +++ b/openlp/plugins/songs/forms/editsongform.py @@ -498,7 +498,6 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): sxml = SongXMLBuilder() sxml.new_document() sxml.add_lyrics_to_song() - count = 1 text = u' ' for i in range (0, self.VerseListWidget.count()): item = self.VerseListWidget.item(i) @@ -506,7 +505,6 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog): bits = verseId.split(u':') sxml.add_verse_to_lyrics(bits[0], bits[1], unicode(item.text())) text = text + unicode(self.VerseListWidget.item(i).text()) + u' ' - count += 1 text = text.replace(u'\'', u'') text = text.replace(u',', u'') text = text.replace(u';', u'') diff --git a/openlp/plugins/songs/lib/mediaitem.py b/openlp/plugins/songs/lib/mediaitem.py index 151dc8118..c7b29afd9 100644 --- a/openlp/plugins/songs/lib/mediaitem.py +++ b/openlp/plugins/songs/lib/mediaitem.py @@ -282,7 +282,7 @@ class SongMediaItem(MediaManagerItem): raw_footer = [] author_list = u'' author_audit = [] - ccl = u'' + ccli = u'' if self.remoteTriggered is None: item = self.ListView.currentItem() if item is None: diff --git a/scripts/bible-1to2-converter.py b/scripts/bible-1to2-converter.py index b1604764f..6fe1f1df4 100755 --- a/scripts/bible-1to2-converter.py +++ b/scripts/bible-1to2-converter.py @@ -206,7 +206,6 @@ def import_bible(): rows = old_cursor.fetchall() if debug or verbose: print 'done.' - song_map = {} for row in rows: book_id = int(row[1]) chapter = int(row[2])