Viewing File: /opt/alt/python35/lib/python3.5/site-packages/peewee_migrate/__pycache__/cli.cpython-35.opt-1.pyc



/X

@smdZddlZddlZddlZddlZddlmZddlmZddddgZ	ej
d	ejZdd
dZ
ejdd
ZejejdddddejdddddejdddddejdddddejdddddddddddZejejd ejd!dddd"ejdddddejdddddejddddddddd#d$Zejejd ejdddddejdddddejdddddddd%d&ZdS)'z CLI integration. N)connect)string_typesWARNINGINFODEBUGNOTSETz\s+$c
Cs@ddlm}ddlm}ddlm}t|}i}yittj	j
|dG}||j|||jd|}|jd|j
}WdQRXWntk
rYnXt|trt|}|j|y||d|SWn?tk
r;}	z|j|	tjd	SWYdd}	~	XnXdS)
Nr)LOGGER)exec_in)Routerzconf.pyZDATABASEZ
LOGGING_LEVELZmigrate_dir)Zpeewee_migraterpeewee_migrate.compatr	Zpeewee_migrate.routerr
VERBOSEopenospathjoinreadgetupperIOError
isinstancerrsetLevelRuntimeErrorerrorsysexit)
	directorydatabaseverboserr	r
Z
logging_levelconfigZcfgexcr!/cli.py
get_routers(
#


r#cCsdS)Nr!r!r!r!r"cli+sr$z--namedefaulthelpzSelect migrationz
--databasezDatabase connectionz--directory
migrationsz%Directory where migrations are storedz--fakeFzRun migration as fake.z-vz	--verbosecountTcCsKt|||}|j|d|}|rGtjddj|dS)z Run migrations. fakezMigrations completed: %sz, N)r#runclickZechor)namerrrr)routerr'r!r!r"migrate0sr.r,z--autoz@Create migrations automatically. Set path to your models module.cCs)t|||}|j|d|dS)z Create migration. autoN)r#create)r,rr/rrr-r!r!r"r0>s	r0cCs#t|||}|j|dS)z Rollback migration.N)r#rollback)r,rrrr-r!r!r"r1Ksr1)__doc__rrerr+Zplayhouse.db_urlrrrr
compileMZCLEAN_REr#groupr$ZcommandZoptionr.Zargumentr0r1r!r!r!r"<module>s>	-	*	
Back to Directory File Manager