forked from openlp/openlp
Disable importer if pysword is missing. Pep8 fixes.
This commit is contained in:
parent
a86ef7e4d5
commit
6b75148e34
@ -39,7 +39,7 @@ from openlp.core.lib.ui import critical_error_message_box
|
|||||||
from openlp.core.ui.wizard import OpenLPWizard, WizardStrings
|
from openlp.core.ui.wizard import OpenLPWizard, WizardStrings
|
||||||
from openlp.core.utils import get_locale_key
|
from openlp.core.utils import get_locale_key
|
||||||
from openlp.plugins.bibles.lib.manager import BibleFormat
|
from openlp.plugins.bibles.lib.manager import BibleFormat
|
||||||
from openlp.plugins.bibles.lib.db import BiblesResourcesDB, clean_filename
|
from openlp.plugins.bibles.lib.db import clean_filename
|
||||||
from openlp.plugins.bibles.lib.http import CWExtract, BGExtract, BSExtract
|
from openlp.plugins.bibles.lib.http import CWExtract, BGExtract, BSExtract
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
@ -504,7 +504,8 @@ class BibleImportForm(OpenLPWizard):
|
|||||||
# Test the SWORD tab that is currently active
|
# Test the SWORD tab that is currently active
|
||||||
if self.sword_tab_widget.currentIndex() == self.sword_tab_widget.indexOf(self.sword_folder_tab):
|
if self.sword_tab_widget.currentIndex() == self.sword_tab_widget.indexOf(self.sword_folder_tab):
|
||||||
if not self.field('sword_folder_path') and self.sword_bible_combo_box.count() == 0:
|
if not self.field('sword_folder_path') and self.sword_bible_combo_box.count() == 0:
|
||||||
critical_error_message_box(UiStrings().NFSs, WizardStrings.YouSpecifyFolder % WizardStrings.SWORD)
|
critical_error_message_box(UiStrings().NFSs,
|
||||||
|
WizardStrings.YouSpecifyFolder % WizardStrings.SWORD)
|
||||||
self.sword_folder_edit.setFocus()
|
self.sword_folder_edit.setFocus()
|
||||||
return False
|
return False
|
||||||
key = self.sword_bible_combo_box.itemData(self.sword_bible_combo_box.currentIndex())
|
key = self.sword_bible_combo_box.itemData(self.sword_bible_combo_box.currentIndex())
|
||||||
|
@ -32,8 +32,10 @@ from .http import HTTPBible
|
|||||||
from .opensong import OpenSongBible
|
from .opensong import OpenSongBible
|
||||||
from .osis import OSISBible
|
from .osis import OSISBible
|
||||||
from .zefania import ZefaniaBible
|
from .zefania import ZefaniaBible
|
||||||
from .sword import SwordBible
|
try:
|
||||||
|
from .sword import SwordBible
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ class SwordBible(BibleDB):
|
|||||||
self.application.process_events()
|
self.application.process_events()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
critical_error_message_box(
|
critical_error_message_box(
|
||||||
message=translate('BiblesPlugin.SwordImport','An unexpected error happened while importing the SWORD '
|
message=translate('BiblesPlugin.SwordImport', 'An unexpected error happened while importing the SWORD '
|
||||||
'bible, please report this to the OpenLP developers.\n'
|
'bible, please report this to the OpenLP developers.\n'
|
||||||
'%s' % e.msg))
|
'%s' % e.msg))
|
||||||
log.exception(str(e))
|
log.exception(str(e))
|
||||||
|
Loading…
Reference in New Issue
Block a user