clean up some module import code in fpdb_import
This commit is contained in:
parent
8b19750b1f
commit
d6c5309aa3
|
@ -49,22 +49,20 @@ log = logging.getLogger('importer')
|
||||||
# database interface modules
|
# database interface modules
|
||||||
try:
|
try:
|
||||||
import MySQLdb
|
import MySQLdb
|
||||||
mysqlLibFound=True
|
|
||||||
log.debug("Import module: MySQLdb")
|
|
||||||
except:
|
except:
|
||||||
log.debug("Import module: MySQLdb not found")
|
log.debug("Import database module: MySQLdb not found")
|
||||||
|
else:
|
||||||
|
mysqlLibFound = True
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import psycopg2
|
import psycopg2
|
||||||
pgsqlLibFound=True
|
except:
|
||||||
|
log.debug("Import database module: psycopg2 not found")
|
||||||
|
else:
|
||||||
import psycopg2.extensions
|
import psycopg2.extensions
|
||||||
psycopg2.extensions.register_type(psycopg2.extensions.UNICODE)
|
psycopg2.extensions.register_type(psycopg2.extensions.UNICODE)
|
||||||
log.debug("Import module: psycopg2")
|
|
||||||
except:
|
|
||||||
log.debug("Import module: psycopg2 not found")
|
|
||||||
|
|
||||||
class Importer:
|
class Importer:
|
||||||
|
|
||||||
def __init__(self, caller, settings, config, sql = None):
|
def __init__(self, caller, settings, config, sql = None):
|
||||||
"""Constructor"""
|
"""Constructor"""
|
||||||
self.settings = settings
|
self.settings = settings
|
||||||
|
|
Loading…
Reference in New Issue
Block a user