From 5868a37018e5a1c094637a33e2a7a066364f82bc Mon Sep 17 00:00:00 2001 From: Jon Tibble Date: Thu, 10 Jun 2010 14:28:41 +0100 Subject: [PATCH] Small refactorings --- openlp/plugins/bibles/lib/csvbible.py | 7 ------- openlp/plugins/bibles/lib/db.py | 7 +++++++ openlp/plugins/bibles/lib/opensong.py | 7 ------- openlp/plugins/bibles/lib/osis.py | 7 ------- .../presentations/lib/impresscontroller.py | 15 --------------- .../presentations/lib/powerpointcontroller.py | 14 -------------- .../presentations/lib/presentationcontroller.py | 7 ++++++- 7 files changed, 13 insertions(+), 51 deletions(-) diff --git a/openlp/plugins/bibles/lib/csvbible.py b/openlp/plugins/bibles/lib/csvbible.py index faaccf303..3cfe9dea5 100644 --- a/openlp/plugins/bibles/lib/csvbible.py +++ b/openlp/plugins/bibles/lib/csvbible.py @@ -56,13 +56,6 @@ class CSVBible(BibleDB): QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'bibles_stop_import'), self.stop_import) - def stop_import(self): - """ - Stops the import of the Bible. - """ - log.debug('Stopping import!') - self.stop_import_flag = True - def do_import(self): #Populate the Tables success = True diff --git a/openlp/plugins/bibles/lib/db.py b/openlp/plugins/bibles/lib/db.py index 02b0a82aa..47d9ffdd2 100644 --- a/openlp/plugins/bibles/lib/db.py +++ b/openlp/plugins/bibles/lib/db.py @@ -92,6 +92,13 @@ class BibleDB(QtCore.QObject): if u'file' in kwargs: self.get_name() + def stop_import(self): + """ + Stops the import of the Bible. + """ + log.debug('Stopping import') + self.stop_import_flag = True + def get_name(self): """ Returns the version name of the Bible. diff --git a/openlp/plugins/bibles/lib/opensong.py b/openlp/plugins/bibles/lib/opensong.py index abc06431c..b2df50257 100644 --- a/openlp/plugins/bibles/lib/opensong.py +++ b/openlp/plugins/bibles/lib/opensong.py @@ -51,13 +51,6 @@ class OpenSongBible(BibleDB): QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'bibles_stop_import'), self.stop_import) - def stop_import(self): - """ - Stops the import of the Bible. - """ - log.debug('Stopping import!') - self.stop_import_flag = True - def do_import(self): """ Loads a Bible from file. diff --git a/openlp/plugins/bibles/lib/osis.py b/openlp/plugins/bibles/lib/osis.py index c6779c132..b4a2a2aa1 100644 --- a/openlp/plugins/bibles/lib/osis.py +++ b/openlp/plugins/bibles/lib/osis.py @@ -86,13 +86,6 @@ class OSISBible(BibleDB): QtCore.QObject.connect(Receiver.get_receiver(), QtCore.SIGNAL(u'bibles_stop_import'), self.stop_import) - def stop_import(self): - """ - Stops the import of the Bible. - """ - log.debug('Stopping import!') - self.stop_import_flag = True - def do_import(self): """ Loads a Bible from file. diff --git a/openlp/plugins/presentations/lib/impresscontroller.py b/openlp/plugins/presentations/lib/impresscontroller.py index c1de03b2b..6c360355c 100644 --- a/openlp/plugins/presentations/lib/impresscontroller.py +++ b/openlp/plugins/presentations/lib/impresscontroller.py @@ -370,21 +370,6 @@ class ImpressDocument(PresentationDocument): """ self.control.gotoPreviousSlide() - def get_slide_preview_file(self, slide_no): - """ - Returns an image path containing a preview for the - requested slide - - ``slide_no`` - The slide an image is required for, starting at 1 - """ - path = os.path.join(self.thumbnailpath, - self.controller.thumbnailprefix + unicode(slide_no) + u'.png') - if os.path.isfile(path): - return path - else: - return None - def get_slide_text(self, slide_no): """ Returns the text on the slide diff --git a/openlp/plugins/presentations/lib/powerpointcontroller.py b/openlp/plugins/presentations/lib/powerpointcontroller.py index 34cc6376e..760869f7a 100644 --- a/openlp/plugins/presentations/lib/powerpointcontroller.py +++ b/openlp/plugins/presentations/lib/powerpointcontroller.py @@ -269,20 +269,6 @@ class PowerpointDocument(PresentationDocument): """ self.presentation.SlideShowWindow.View.Previous() - def get_slide_preview_file(self, slide_no): - """ - Returns an image path containing a preview for the requested slide - - ``slide_no`` - The slide an image is required for, starting at 1 - """ - path = os.path.join(self.thumbnailpath, - self.controller.thumbnailprefix + unicode(slide_no) + u'.png') - if os.path.isfile(path): - return path - else: - return None - def get_slide_text(self, slide_no): """ Returns the text on the slide diff --git a/openlp/plugins/presentations/lib/presentationcontroller.py b/openlp/plugins/presentations/lib/presentationcontroller.py index 706e70ae6..501776a19 100644 --- a/openlp/plugins/presentations/lib/presentationcontroller.py +++ b/openlp/plugins/presentations/lib/presentationcontroller.py @@ -357,7 +357,12 @@ class PresentationDocument(object): ``slide_no`` The slide an image is required for, starting at 1 """ - return None + path = os.path.join(self.thumbnailpath, + self.controller.thumbnailprefix + unicode(slide_no) + u'.png') + if os.path.isfile(path): + return path + else: + return None def poll_slidenumber(self, is_live): """