string change, close file, MarkType

This commit is contained in:
Andreas Preikschat 2010-12-11 10:53:30 +01:00
parent 62643d7d5e
commit ce0abd19bd
3 changed files with 21 additions and 3 deletions

View File

@ -35,9 +35,14 @@ from openlp.plugins.bibles.lib.db import BibleDB, BibleMeta
from csvbible import CSVBible from csvbible import CSVBible
from http import HTTPBible from http import HTTPBible
from openlp1 import OpenLP1Bible
from opensong import OpenSongBible from opensong import OpenSongBible
from osis import OSISBible from osis import OSISBible
# Imports that might fail.
try:
from openlp1 import OpenLP1Bible
has_openlp1 = True
except ImportError:
has_openlp1 = False
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
@ -57,6 +62,7 @@ class BibleFormat(object):
plus a few helper functions to facilitate generic handling of Bible types plus a few helper functions to facilitate generic handling of Bible types
for importing. for importing.
""" """
_format_availability = {}
Unknown = -1 Unknown = -1
OSIS = 0 OSIS = 0
CSV = 1 CSV = 1
@ -98,6 +104,18 @@ class BibleFormat(object):
BibleFormat.OpenLP1 BibleFormat.OpenLP1
] ]
@staticmethod
def set_availability(format, available):
BibleFormat._format_availability[format] = available
@staticmethod
def get_availability(format):
return BibleFormat._format_availability.get(format, True)
BibleFormat.set_availability(BibleFormat.OpenLP1, has_openlp1)
__all__ = [u'BibleFormat']
class BibleManager(object): class BibleManager(object):
""" """

View File

@ -25,7 +25,7 @@
############################################################################### ###############################################################################
import logging import logging
import sqlite import sqlitse
from PyQt4 import QtCore from PyQt4 import QtCore

View File

@ -53,7 +53,7 @@ class SongFormat(object):
plus a few helper functions to facilitate generic handling of song types plus a few helper functions to facilitate generic handling of song types
for importing. for importing.
""" """
_format_availability = {} format_availability = {}
Unknown = -1 Unknown = -1
OpenLP2 = 0 OpenLP2 = 0
OpenLP1 = 1 OpenLP1 = 1