don't try to import pysqlite2, we depend on sqlite3

This commit is contained in:
Yann Leboulanger 2009-11-30 16:36:47 +01:00
parent badbe820a1
commit 66fdb1490d
5 changed files with 4 additions and 41 deletions

View File

@ -27,18 +27,11 @@ import os
import sys
import stat
import exceptions
from common import gajim
import logger
# DO NOT MOVE ABOVE OF import gajim
try:
import sqlite3 as sqlite # python 2.5
except ImportError:
try:
from pysqlite2 import dbapi2 as sqlite
except ImportError:
raise exceptions.PysqliteNotAvailable
import sqlite3 as sqlite
def create_log_db():
print _('creating logs database')

View File

@ -21,17 +21,6 @@
## along with Gajim. If not, see <http://www.gnu.org/licenses/>.
##
class PysqliteNotAvailable(Exception):
"""
Sqlite2 is not installed or python bindings are missing
"""
def __init__(self):
Exception.__init__(self)
def __str__(self):
return _('pysqlite2 (aka python-pysqlite2) dependency is missing. Exiting...')
class PysqliteOperationalError(Exception):
"""
Sqlite2 raised pysqlite2.dbapi2.OperationalError

View File

@ -38,13 +38,7 @@ from cStringIO import StringIO
import exceptions
import gajim
try:
import sqlite3 as sqlite # python 2.5
except ImportError:
try:
from pysqlite2 import dbapi2 as sqlite
except ImportError:
raise exceptions.PysqliteNotAvailable
import sqlite3 as sqlite
import configpaths
LOG_DB_PATH = configpaths.gajimpaths['LOG_DB']

View File

@ -34,14 +34,7 @@ from common import gajim
from common import helpers
from common import caps
import exceptions
try:
import sqlite3 as sqlite # python 2.5
except ImportError:
try:
from pysqlite2 import dbapi2 as sqlite
except ImportError:
raise exceptions.PysqliteNotAvailable
import sqlite3 as sqlite
import logger
class OptionsParser:

View File

@ -102,13 +102,7 @@ C_NICKNAME
) = range(2, 6)
try:
import sqlite3 as sqlite # python 2.5
except ImportError:
try:
from pysqlite2 import dbapi2 as sqlite
except ImportError:
raise exceptions.PysqliteNotAvailable
import sqlite3 as sqlite
class HistoryManager: