<s> from django . conf import settings <EOL> from django . db import connection <EOL> from django . utils . translation import ugettext as _ <EOL> from modoboa . lib . exceptions import InternalError <EOL> def db_table_exists ( table ) : <EOL> """<STR_LIT>""" <EOL> return table in connection . introspection . table_names ( ) <EOL> def db_type ( cname = "<STR_LIT:default>" ) : <EOL> """<STR_LIT>""" <EOL> if cname not in settings . DATABASES : <EOL> raise InternalError ( <EOL> _ ( "<STR_LIT>" % cname ) ) <EOL> for t in [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] : <EOL> if settings . DATABASES [ cname ] [ '<STR_LIT>' ] . find ( t ) != - <NUM_LIT:1> : <EOL> return t <EOL> return None </s>
