#NEWLINE# def __init__( self , url ) : #NEWLINE# #INDENT# if url . startswith ( 'mysql://' ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# import MySQLdb #NEWLINE# assert ( MySQLdb is not None ) #NEWLINE# #UNINDENT# except ImportError : #NEWLINE# #INDENT# import pymysql_sa #NEWLINE# pymysql_sa . make_default_mysql_dialect ( ) #NEWLINE# #UNINDENT# #UNINDENT# self . url = url #NEWLINE# self . config = Config ( os . path . join ( self . alembic_path , 'alembic.ini' ) ) #NEWLINE# self . config . set_main_option ( 'script_location' , self . alembic_path ) #NEWLINE# self . config . set_main_option ( 'url' , self . url ) #NEWLINE# self . config . set_main_option ( 'sqlalchemy.url' , self . url )