py25 comes with pysqlite module in the stdlib
This commit is contained in:
parent
307abbc384
commit
3535249ba1
|
@ -20,7 +20,14 @@ import stat
|
|||
from common import gajim
|
||||
import logger
|
||||
|
||||
from pysqlite2 import dbapi2 as sqlite # DO NOT MOVE ABOVE OF import gajim
|
||||
# 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
|
||||
|
||||
def create_log_db():
|
||||
print _('creating logs database')
|
||||
|
|
|
@ -206,6 +206,9 @@ class OptionsParser:
|
|||
def assert_unread_msgs_table_exists(self):
|
||||
'''create table unread_messages if there is no such table'''
|
||||
import exceptions
|
||||
try:
|
||||
import sqlite3 as sqlite # python 2.5
|
||||
except ImportError:
|
||||
try:
|
||||
from pysqlite2 import dbapi2 as sqlite
|
||||
except ImportError:
|
||||
|
@ -282,6 +285,9 @@ class OptionsParser:
|
|||
def update_config_to_01013(self):
|
||||
'''create table transports_cache if there is no such table'''
|
||||
import exceptions
|
||||
try:
|
||||
import sqlite3 as sqlite # python 2.5
|
||||
except ImportError:
|
||||
try:
|
||||
from pysqlite2 import dbapi2 as sqlite
|
||||
except ImportError:
|
||||
|
@ -308,6 +314,9 @@ class OptionsParser:
|
|||
def update_config_to_01014(self):
|
||||
'''apply indeces to the logs database'''
|
||||
import exceptions
|
||||
try:
|
||||
import sqlite3 as sqlite # python 2.5
|
||||
except ImportError:
|
||||
try:
|
||||
from pysqlite2 import dbapi2 as sqlite
|
||||
except ImportError:
|
||||
|
@ -333,7 +342,13 @@ class OptionsParser:
|
|||
|
||||
def update_config_to_01015(self):
|
||||
'''clean show values in logs database'''
|
||||
try:
|
||||
import sqlite3 as sqlite # python 2.5
|
||||
except ImportError:
|
||||
try:
|
||||
from pysqlite2 import dbapi2 as sqlite
|
||||
except ImportError:
|
||||
raise exceptions.PysqliteNotAvailable
|
||||
import logger
|
||||
con = sqlite.connect(logger.LOG_DB_PATH)
|
||||
cur = con.cursor()
|
||||
|
|
|
@ -44,9 +44,13 @@ C_SUBJECT,
|
|||
C_NICKNAME
|
||||
) = range(2, 6)
|
||||
|
||||
|
||||
try:
|
||||
from pysqlite2 import dbapi2 as sqlite
|
||||
import sqlite3 as sqlite # python 2.5
|
||||
except ImportError:
|
||||
try:
|
||||
from pysqlite2 import dbapi2 as sqlite
|
||||
except ImportError:
|
||||
raise exceptions.PysqliteNotAvailable
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue