don't try to import pysqlite2, we depend on sqlite3
This commit is contained in:
parent
badbe820a1
commit
66fdb1490d
|
@ -27,18 +27,11 @@ import os
|
||||||
import sys
|
import sys
|
||||||
import stat
|
import stat
|
||||||
|
|
||||||
import exceptions
|
|
||||||
from common import gajim
|
from common import gajim
|
||||||
import logger
|
import logger
|
||||||
|
|
||||||
# DO NOT MOVE ABOVE OF import gajim
|
# DO NOT MOVE ABOVE OF import gajim
|
||||||
try:
|
import sqlite3 as sqlite
|
||||||
import sqlite3 as sqlite # python 2.5
|
|
||||||
except ImportError:
|
|
||||||
try:
|
|
||||||
from pysqlite2 import dbapi2 as sqlite
|
|
||||||
except ImportError:
|
|
||||||
raise exceptions.PysqliteNotAvailable
|
|
||||||
|
|
||||||
def create_log_db():
|
def create_log_db():
|
||||||
print _('creating logs database')
|
print _('creating logs database')
|
||||||
|
|
|
@ -21,17 +21,6 @@
|
||||||
## along with Gajim. If not, see <http://www.gnu.org/licenses/>.
|
## 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):
|
class PysqliteOperationalError(Exception):
|
||||||
"""
|
"""
|
||||||
Sqlite2 raised pysqlite2.dbapi2.OperationalError
|
Sqlite2 raised pysqlite2.dbapi2.OperationalError
|
||||||
|
|
|
@ -38,13 +38,7 @@ from cStringIO import StringIO
|
||||||
import exceptions
|
import exceptions
|
||||||
import gajim
|
import gajim
|
||||||
|
|
||||||
try:
|
import sqlite3 as sqlite
|
||||||
import sqlite3 as sqlite # python 2.5
|
|
||||||
except ImportError:
|
|
||||||
try:
|
|
||||||
from pysqlite2 import dbapi2 as sqlite
|
|
||||||
except ImportError:
|
|
||||||
raise exceptions.PysqliteNotAvailable
|
|
||||||
|
|
||||||
import configpaths
|
import configpaths
|
||||||
LOG_DB_PATH = configpaths.gajimpaths['LOG_DB']
|
LOG_DB_PATH = configpaths.gajimpaths['LOG_DB']
|
||||||
|
|
|
@ -34,14 +34,7 @@ from common import gajim
|
||||||
from common import helpers
|
from common import helpers
|
||||||
from common import caps
|
from common import caps
|
||||||
|
|
||||||
import exceptions
|
import sqlite3 as sqlite
|
||||||
try:
|
|
||||||
import sqlite3 as sqlite # python 2.5
|
|
||||||
except ImportError:
|
|
||||||
try:
|
|
||||||
from pysqlite2 import dbapi2 as sqlite
|
|
||||||
except ImportError:
|
|
||||||
raise exceptions.PysqliteNotAvailable
|
|
||||||
import logger
|
import logger
|
||||||
|
|
||||||
class OptionsParser:
|
class OptionsParser:
|
||||||
|
|
|
@ -102,13 +102,7 @@ C_NICKNAME
|
||||||
) = range(2, 6)
|
) = range(2, 6)
|
||||||
|
|
||||||
|
|
||||||
try:
|
import sqlite3 as sqlite
|
||||||
import sqlite3 as sqlite # python 2.5
|
|
||||||
except ImportError:
|
|
||||||
try:
|
|
||||||
from pysqlite2 import dbapi2 as sqlite
|
|
||||||
except ImportError:
|
|
||||||
raise exceptions.PysqliteNotAvailable
|
|
||||||
|
|
||||||
|
|
||||||
class HistoryManager:
|
class HistoryManager:
|
||||||
|
|
Loading…
Reference in New Issue