<s> from functools import partial <EOL> from flaskext . script import Manager , Server , Shell <EOL> from werkzeug import create_environ <EOL> from coqd . runner import main as coqd_main <EOL> from cockerel . webapp import app <EOL> from cockerel . utilities import new_app <EOL> from cockerel . models import db , schema <EOL> def _make_context ( ) : <EOL> return dict ( app = new_app ( app ) , db = db , models = schema ) <EOL> manager = Manager ( partial ( new_app , app ) ) <EOL> manager . add_command ( "<STR_LIT>" , Shell ( make_context = _make_context ) ) <EOL> manager . add_command ( "<STR_LIT>" , Server ( ) ) <EOL> manager . add_option ( '<STR_LIT>' , action = "<STR_LIT:store_true>" , <EOL> default = False , help = "<STR_LIT>" ) <EOL> @ manager . command <EOL> def initdb ( ) : <EOL> with new_app ( app ) . request_context ( create_environ ( ) ) : <EOL> db . drop_all ( ) <EOL> db . create_all ( ) <EOL> @ manager . option ( "<STR_LIT>" , dest = "<STR_LIT>" , action = "<STR_LIT>" , <EOL> default = [ ] , <EOL> help = "<STR_LIT>" <EOL> "<STR_LIT>" , <EOL> ) <EOL> @ manager . option ( '<STR_LIT>' , action = "<STR_LIT:store_true>" , <EOL> default = False , <EOL> help = "<STR_LIT>" ) <EOL> def runcoqd ( modules , serialize ) : <EOL> coqd_main ( modules , serialize ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> manager . run ( ) </s>
