Small refactorings

This commit is contained in:
Jon Tibble 2010-06-10 14:28:41 +01:00
parent 78a6d20bb3
commit 5868a37018
7 changed files with 13 additions and 51 deletions

View File

@ -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

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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

View File

@ -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

View File

@ -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):
"""