Disable importer if pysword is missing. Pep8 fixes.

This commit is contained in:
Tomas Groth 2016-03-25 20:58:43 +01:00
parent a86ef7e4d5
commit 6b75148e34
3 changed files with 12 additions and 9 deletions

View File

@ -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.utils import get_locale_key
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
log = logging.getLogger(__name__)
@ -504,7 +504,8 @@ class BibleImportForm(OpenLPWizard):
# Test the SWORD tab that is currently active
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:
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()
return False
key = self.sword_bible_combo_box.itemData(self.sword_bible_combo_box.currentIndex())

View File

@ -32,8 +32,10 @@ from .http import HTTPBible
from .opensong import OpenSongBible
from .osis import OSISBible
from .zefania import ZefaniaBible
try:
from .sword import SwordBible
except:
pass
log = logging.getLogger(__name__)