def __enter__(self):
if splitext(self.database)[<NUM_LIT:1>] == '<STR_LIT>':<EOL><INDENT>conn_str = '<STR_LIT>''<STR_LIT>'.format(self.database)<EOL>logging.debug(_('<STR_LIT>'), conn_str)<EOL>try:<EOL><INDENT>self.con = adodbapi.connect(conn_str)<EOL><DEDENT>except NameError:<EOL><INDENT>raise<EOL><DEDENT><DEDENT>else:<EOL><INDENT>logging.debug(_('<STR_LIT>'), self.database)<EOL>self.con = sqlite3.connect(self.database)<EOL><DEDENT>self.cursor = self.con.cursor()<EOL>self._init_kind_converter()<EOL>return self<EOL>
Establish database connection.