""" Shows all the routes registered in Flask. """ output = [] for rule in current_app.url_map.iter_rules(): methods = ','.join(rule.methods) path = urllib.unquote(rule.rule) # line = urllib.unquote() output.append((rule.endpoint, methods, path)) for endpoint, methods, path in sorted(output): print('{:40s} {:25s} {}'.format(endpoint, methods, path)) # user commands email_opt = manager.option('email', help='user\'s email') password_opt = manager.option( '-p', '--password', dest='password', default=None, help='If absent, a prompt will ask for password', ) role_opt = manager.option( '-r', '--role', dest='role', choices=[r.name for r in Role.assignable_roles()], ) name_opt = manager.option( '-n', '--name', dest='name', default=None, help='Last name (e.g "Smith")') firstname_opt = manager.option( '-f', '--firstname', dest='first_name', default=None, help='Fist name (e.g. "John")')
@manager.command def routes(): """Show all the routes registered in Flask.""" output = [] for rule in current_app.url_map.iter_rules(): methods = ','.join(rule.methods) path = urllib.parse.unquote(rule.rule) output.append((rule.endpoint, methods, path)) for endpoint, methods, path in sorted(output): print('{:40s} {:25s} {}'.format(endpoint, methods, path)) # user commands email_opt = manager.option('email', help='user\'s email') password_opt = manager.option( '-p', '--password', dest='password', default=None, help='If absent, a prompt will ask for password', ) role_opt = manager.option( '-r', '--role', dest='role', choices=[r.name for r in Role.assignable_roles()], ) name_opt = manager.option( '-n',
@manager.command def routes(): """Show all the routes registered in Flask.""" output = [] for rule in current_app.url_map.iter_rules(): methods = ",".join(rule.methods) path = urllib.parse.unquote(rule.rule) output.append((rule.endpoint, methods, path)) for endpoint, methods, path in sorted(output): print("{:40s} {:25s} {}".format(endpoint, methods, path)) # user commands email_opt = manager.option("email", help="user's email") password_opt = manager.option( "-p", "--password", dest="password", default=None, help="If absent, a prompt will ask for password", ) role_opt = manager.option( "-r", "--role", dest="role", choices=[r.name for r in Role.assignable_roles()] ) name_opt = manager.option( "-n", "--name", dest="name", default=None, help='Last name (e.g "Smith")' ) firstname_opt = manager.option( "-f", "--firstname", dest="first_name", default=None, help='Fist name (e.g. "John")'