<s> import pprint <EOL> from flask import Flask , current_app <EOL> from flaskext . script import Manager , prompt_choices , Server <EOL> def create_app ( config = None ) : <EOL> app = Flask ( __name__ ) <EOL> app . debug = False <EOL> print "<STR_LIT>" , config <EOL> app . config . from_envvar ( '<STR_LIT>' , silent = True ) <EOL> @ app . route ( "<STR_LIT:/>" ) <EOL> def index ( ) : <EOL> assert False , "<STR_LIT>" <EOL> return app <EOL> manager = Manager ( create_app ) <EOL> @ manager . command <EOL> def dumpconfig ( ) : <EOL> "<STR_LIT>" <EOL> pprint . pprint ( current_app . config ) <EOL> @ manager . command <EOL> def output ( name ) : <EOL> "<STR_LIT>" <EOL> print name <EOL> print type ( name ) <EOL> @ manager . command <EOL> def outputplus ( name , url = None ) : <EOL> "<STR_LIT>" <EOL> print name , url <EOL> @ manager . command <EOL> def getrolesimple ( ) : <EOL> choices = ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) <EOL> role = prompt_choices ( "<STR_LIT>" , choices = choices , default = "<STR_LIT>" ) <EOL> print "<STR_LIT>" , role <EOL> @ manager . command <EOL> def getrole ( ) : <EOL> choices = ( <EOL> ( <NUM_LIT:1> , "<STR_LIT>" ) , <EOL> ( <NUM_LIT:2> , "<STR_LIT>" ) , <EOL> ( <NUM_LIT:3> , "<STR_LIT>" ) , <EOL> ) <EOL> role = prompt_choices ( "<STR_LIT>" , choices = choices , resolve = int , default = <NUM_LIT:1> ) <EOL> print "<STR_LIT>" , role <EOL> @ manager . option ( '<STR_LIT>' , '<STR_LIT>' , dest = '<STR_LIT:name>' , help = "<STR_LIT>" ) <EOL> @ manager . option ( '<STR_LIT>' , '<STR_LIT>' , dest = '<STR_LIT:url>' , help = "<STR_LIT>" ) <EOL> def optional ( name , url ) : <EOL> "<STR_LIT>" <EOL> print name , url <EOL> manager . add_option ( "<STR_LIT:-c>" , "<STR_LIT>" , <EOL> dest = "<STR_LIT>" , <EOL> help = "<STR_LIT>" , <EOL> required = False ) <EOL> manager . add_command ( "<STR_LIT>" , Server ( use_reloader = False ) ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> manager . run ( ) </s>
