<s> """<STR_LIT>""" <EOL> from __future__ import absolute_import <EOL> from . pysqlite import SQLiteDialect_pysqlite <EOL> from ... engine import url as _url <EOL> from ... import pool <EOL> class SQLiteDialect_pysqlcipher ( SQLiteDialect_pysqlite ) : <EOL> driver = '<STR_LIT>' <EOL> pragmas = ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> @ classmethod <EOL> def dbapi ( cls ) : <EOL> from pysqlcipher import dbapi2 as sqlcipher <EOL> return sqlcipher <EOL> @ classmethod <EOL> def get_pool_class ( cls , url ) : <EOL> return pool . SingletonThreadPool <EOL> def connect ( self , * cargs , ** cparams ) : <EOL> passphrase = cparams . pop ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> pragmas = dict ( <EOL> ( key , cparams . pop ( key , None ) ) for key in <EOL> self . pragmas <EOL> ) <EOL> conn = super ( SQLiteDialect_pysqlcipher , self ) . connect ( * cargs , ** cparams ) <EOL> conn . execute ( '<STR_LIT>' % passphrase ) <EOL> for prag , value in pragmas . items ( ) : <EOL> if value is not None : <EOL> conn . execute ( '<STR_LIT>' % ( prag , value ) ) <EOL> return conn <EOL> def create_connect_args ( self , url ) : <EOL> super_url = _url . URL ( <EOL> url . drivername , username = url . username , <EOL> host = url . host , database = url . database , query = url . query ) <EOL> c_args , opts = super ( SQLiteDialect_pysqlcipher , self ) . create_connect_args ( super_url ) <EOL> opts [ '<STR_LIT>' ] = url . password <EOL> return c_args , opts <EOL> dialect = SQLiteDialect_pysqlcipher </s>
