Log failing imports

bzr-revno: 1600
This commit is contained in:
Gerald Britton 2011-05-31 21:01:49 +02:00 committed by Andreas Preikschat
commit 6a6d0aa64d

View File

@ -27,6 +27,7 @@
""" """
The :mod:`importer` modules provides the general song import functionality. The :mod:`importer` modules provides the general song import functionality.
""" """
import logging
from opensongimport import OpenSongImport from opensongimport import OpenSongImport
from easislidesimport import EasiSlidesImport from easislidesimport import EasiSlidesImport
from olpimport import OpenLPSongImport from olpimport import OpenLPSongImport
@ -38,20 +39,24 @@ from songbeamerimport import SongBeamerImport
from songshowplusimport import SongShowPlusImport from songshowplusimport import SongShowPlusImport
from foilpresenterimport import FoilPresenterImport from foilpresenterimport import FoilPresenterImport
# Imports that might fail # Imports that might fail
log = logging.getLogger(__name__)
try: try:
from olp1import import OpenLP1SongImport from olp1import import OpenLP1SongImport
HAS_OPENLP1 = True HAS_OPENLP1 = True
except ImportError: except ImportError:
log.exception('Error importing %s', 'OpenLP1SongImport')
HAS_OPENLP1 = False HAS_OPENLP1 = False
try: try:
from sofimport import SofImport from sofimport import SofImport
HAS_SOF = True HAS_SOF = True
except ImportError: except ImportError:
log.exception('Error importing %s', 'SofImport')
HAS_SOF = False HAS_SOF = False
try: try:
from oooimport import OooImport from oooimport import OooImport
HAS_OOO = True HAS_OOO = True
except ImportError: except ImportError:
log.exception('Error importing %s', 'OooImport')
HAS_OOO = False HAS_OOO = False
class SongFormat(object): class SongFormat(object):