
    h                       S SK Jr  S SKrS SKrS SKrS SKrS SKrS SKrS SK	r	S SK
r
S SKrS SKJr  S SKJr  S SKrS SKJr  S SKJr  S SKJr  S SKJr  S	S
KJr  S	SKJr  S	SKJr  \R>                  (       a  S	SK J!r!   " S S\RD                  5      r#S r$S r%S r&S r'SoS jr(S r)\RT                  " S/SS\)SSS9r+ " S S5      r,\RZ                  " \,SS9r.S r/ " S S \R`                  5      r1SpS! jr2\RT                  " S"S#/S$S%SS\2S&9r3SqS' jr4\RT                  " S(/S)S\4S*9r5        SpS+ jr6\RT                  " S,S-/\Rn                  " SSS.9S/SS\6S09r8 " S1 S2\15      r9S3 r:SrSsS4 jjr;S5 r< " S6 S7\Rz                  5      r>S8 r? " S9 S:\Rn                  5      r@\R                  " S;S<S=9\R                  " S>S?S@SASB9\R                  " SCSDSESFSB9\R                  " SG\>" 5       SHSSI9\R                  " SJ\Rn                  " SSSSK9\?SSLSM9\R                  " SNSSOSB9\R                  " SPSSQSB9\R                  " SRSSSSB9\R                  " STS\@" 5       SU\R                  R                  < SV3SW9\R                  " SXS\@" 5       SY\R                  R                  < SV3SW9\.SZ 5       5       5       5       5       5       5       5       5       5       5       rE\ER                  R                  S \55        \R                  " S[S\S=9\/StS] j5       5       rH\R                  " S^S_S=9\R                  " S`Sa\R                  " Sb5      ScSdSe9\R                  " SfSSgSh9\/SuSi j5       5       5       5       rJ\9" SjSkSl9rKStSm jrL\MSn:X  a  \L" 5         gg)v    )annotationsN)update_wrapper)
itemgetter)ParameterSource)
run_simple)is_running_from_reloader)import_string   )current_app)get_debug_flag)get_load_dotenvFlaskc                      \ rS rSrSrSrg)NoAppException   z3Raised if an application cannot be found or loaded. N)__name__
__module____qualname____firstlineno____doc____static_attributes__r       ^C:\Users\ROHAN GUPTA\OneDrive\Desktop\mathbuddy-assessment\venv\Lib\site-packages\flask/cli.pyr   r      s    =r   r   c                   SSK Jn  S H#  n[        XS5      n[        X15      (       d  M!  Us  $    U R                  R                  5        Vs/ s H  n[        XA5      (       d  M  UPM     nn[        U5      S:X  a  US   $ [        U5      S:  a&  [        SU R                   SU R                   S35      eS	 HH  n[        XS5      n[        R                  " U5      (       d  M,   U" 5       n[        X15      (       a  Us  $ MJ     [        SU R                   SU R                   S35      es  snf ! [         aC  n[        U5      (       d  e [        S
U SU R                   SU R                   SU S3	5      UeSnAff = f)zoGiven a module instance this tries to find the best possible
application in the module or raises an exception.
r
   r   )appapplicationNr   z0Detected multiple Flask applications in module 'z'. Use 'z":name' to specify the correct one.)
create_appmake_appzDetected factory 'z' in module 'z1', but could not call it without arguments. Use ':z(args)' to specify arguments.z7Failed to find Flask application or factory in module 'z:name' to specify one.) r   getattr
isinstance__dict__valueslenr   r   inspect
isfunction	TypeError_called_with_wrong_args)moduler   	attr_namer   vmatchesapp_factoryes           r   find_best_appr2   !   s     ,	f.c!!J	 , !//002K2Qj6Jq2GK
7|qqz	W	!&//): ;++
 	
 0	f6k**!mc))J * 0( 	__Xfoo%6 7	 A L*  	.{;;$(=@Q R)9+ 6--
 		s$   D)$D)$D..
E;8>E66E;c                    [         R                  " 5       S   n Ub7  UR                  R                  U R                  L a   AgUR
                  nUb  M7   Ag! Af = f)zCheck whether calling a function raised a ``TypeError`` because
the call failed or because something in the factory raised the
error.

:param f: The function that was called.
:return: ``True`` if the call failed.
   FT)sysexc_infotb_framef_code__code__tb_next)ftbs     r   r+   r+   V   s\     
	Bn{{!!QZZ/  B n  Bs   &A A Ac                   SSK Jn   [        R                  " UR	                  5       SS9R
                  n[        U[        R                  5      (       a  UR                  n/ n0 nO[        U[        R                  5      (       a  [        UR                  [        R                  5      (       d  [        SU< S	35      eUR                  R                  n UR                   Vs/ s H  n[        R                  " U5      PM     nnUR                   Vs0 s H-  oR                   [        R                  " UR"                  5      _M/     nnO[        SU< S35      e ['        X5      n	[,        R.                  " U	5      (       a
   U	" U0 UD6nOU	n[        X5      (       a  U$ [        SU R*                   SU S35      e! [         a    [        SU< S35      Sef = fs  snf s  snf ! [$         a    [        S
U< S	35      Sef = f! [(         a$  n
[        SU< SU R*                  < S	35      U
eSn
A
ff = f! [0         a5  n
[3        U	5      (       d  e [        SU< SU R*                  < S35      U
eSn
A
ff = f)zCheck if the given string is a variable name or a function. Call
a function to get the app instance, or return the variable directly.
r
   r   eval)modezFailed to parse z' as an attribute name or function call.Nz*Function reference must be a simple name: .z-Failed to parse arguments as literal values: zFailed to find attribute z in zThe factory z in module z2 could not be called with the specified arguments.z1A valid Flask application was not obtained from 'r!   z'.)r"   r   astparsestripbodySyntaxErrorr   r$   NameidCallfuncargsliteral_evalkeywordsargvalue
ValueErrorr#   AttributeErrorr   r(   r)   r*   r+   )r,   app_namer   exprnamerJ   kwargsrM   kwattrr1   r   s               r   find_app_by_stringrW   p   st    yy)7<< $!!ww	D#((	#	#$))SXX.. <XLJ  yy||	59YY?YcC$$S)YD?CG==Q=Rffc..rxx88=FQF xl*QR
 	
v$ $
	''C #

	__Qxj	, y  xl*QR
	( @Q 	 !?|1M	  'xtFOO3FaH
	  	*400 xl +OO& '(( 			se   -F: G# " GG# 4GG# H H3 :G
G# #G?
H0H++H03
I2=0I--I2c                   [         R                  R                  U 5      n [         R                  R                  U 5      u  pUS:X  a  Un [         R                  R	                  U 5      S:X  a  [         R                  R                  U 5      n / n [         R                  R                  U 5      u  pUR                  U5        [         R                  R                  [         R                  R                  U S5      5      (       d  OMw  [        R                  S   U :w  a   [        R                  R                  SU 5        SR                  USSS2   5      $ )zGiven a filename this will try to calculate the python path, add it
to the search path and return the actual module name that is expected.
z.py__init__z__init__.pyr   r@   N)ospathrealpathsplitextbasenamedirnamesplitappendexistsjoinr5   insert)r\   fnameextmodule_namerS   s        r   prepare_importri      s     77D!D!!$'JE
e|	ww+wwt$K WW]]4(
4 ww~~bggll4?@@  xx{d4 88K"%&&r   Tc                \    [        U 5        [        R                  U    nUc  [        U5      $ [        X15      $ ! [         ah    [        R                  " 5       S   R                  (       a&  [        SU < S[        R                  " 5        35      S eU(       a  [        SU < S35      S e g f = f)Nr4   zWhile importing z, an ImportError was raised:

zCould not import r@   )
__import__ImportErrorr5   r6   r:   r   	traceback
format_excmodulesr2   rW   )rh   rQ   raise_if_not_foundr,   s       r   
locate_apprq      s    ; [[%FV$$!&33%   <<>!$$ ";/ 2(33568    #4[O1!EFDPs   9 A/B+*B+c                H   U(       a  U R                   (       a  g [        R                  R                  S5      n[        R                  R                  S5      n[        R
                  " S[        R                  " 5        SU SU 3U R                  S9  U R                  5         g )NflaskwerkzeugPython z
Flask z

Werkzeug )color)
resilient_parsing	importlibmetadataversionclickechoplatformpython_versionrv   exit)ctxparamrN   flask_versionwerkzeug_versions        r   get_versionr      s    C))&&..w7M ))11*=	JJ
())+, -  $%	' ii	 HHJr   z	--versionzShow the Flask version.F)helpexpose_valuecallbackis_flagis_eagerc                  D    \ rS rSrSr   S       SS jjrS	S jrSrg)

ScriptInfoi  am  Helper object to deal with Flask applications.  This is usually not
necessary to interface with as it's used internally in the dispatching
to click.  In future versions of Flask this object will most likely play
a bigger role.  Typically it's created automatically by the
:class:`FlaskGroup` but you can also manually create it and pass it
onwards as click object.
Nc                D    Xl         X l        0 U l        X0l        S U l        g N)app_import_pathr   dataset_debug_flag_loaded_app)selfr   r   r   s       r   rY   ScriptInfo.__init__  s(      / % )+	,)-r   c                   U R                   b  U R                   $ U R                  b  U R                  5       nOyU R                  (       a@  [        R                  " SU R                  SS9S/-   SS u  p#[        U5      n[        XC5      nO(S H"  n[        U5      n[        USSS9nU(       d  M"    O   W(       d  [        S	5      eU R                  (       a  [        5       Ul
        Xl         U$ )
zLoads the Flask app (if not yet loaded) and returns it.  Calling
this multiple times will just result in the already loaded app to
be returned.
Nz
:(?![\\/])r
   )maxsplitr4   )zwsgi.pyzapp.pyF)rp   zCould not locate a Flask application. Use the 'flask --app' option, 'FLASK_APP' environment variable, or a 'wsgi.py' or 'app.py' file in the current directory.)r   r   r   rera   ri   rq   r   r   r   debug)r   r   r\   rS   import_names        r   load_appScriptInfo.load_app%  s    
 '###??&//#C##HH]D,@,@1MQUPVV1
 -T2 31D"0"6K$[$5QCs 2  &   '(CI
r   )r   r   r   r   r   )NNT)r   
str | Noner   t.Callable[..., Flask] | Noner   boolreturnNone)r   r   )r   r   r   r   r   rY   r   r   r   r   r   r   r     sB     '+48#	.#. 2. 	.
 
."'r   r   )ensurec                N   ^  [         R                  U 4S j5       n[        UT 5      $ )a  Wraps a callback so that it's guaranteed to be executed with the
script's application context.

Custom commands (and their options) registered under ``app.cli`` or
``blueprint.cli`` will always have an app context available, this
decorator is not required in that case.

.. versionchanged:: 2.2
    The app context is active for subcommands as well as the
    decorated callback. The app context is always available to
    ``app.cli`` command and parameter callbacks.
c                   > [         (       dB  U R                  [        5      R                  5       nU R	                  UR                  5       5        U R                  " T/UQ70 UD6$ r   )r   ensure_objectr   r   with_resourceapp_contextinvoke)__ctxrJ   rT   r   r;   s       r   	decorator"with_appcontext.<locals>.decorator`  sO    {%%j1::<C 12||A////r   )r{   pass_contextr   )r;   r   s   ` r   with_appcontextr   R  s,     0 0 )Q''r   c                  $    \ rS rSrSrS rS rSrg)AppGroupik  zThis works similar to a regular click :class:`~click.Group` but it
changes the behavior of the :meth:`command` decorator so that it
automatically wraps the functions in :func:`with_appcontext`.

Not to be confused with :class:`FlaskGroup`.
c                D   ^ ^^^ TR                  SS5      mUUU U4S jnU$ )zThis works exactly like the method of the same name on a regular
:class:`click.Group` but it wraps callbacks in :func:`with_appcontext`
unless it's disabled by passing ``with_appcontext=False``.
r   Tc                |   > T(       a  [        U 5      n [        R                  R                  " T/TQ70 TD6" U 5      $ r   )r   r{   Groupcommand)r;   rJ   rT   r   wrap_for_ctxs    r   r   #AppGroup.command.<locals>.decoratorz  s4    #A&;;&&t=d=f=a@@r   )pop)r   rJ   rT   r   r   s   ``` @r   r   AppGroup.commands  s*    
 zz"3T:	A 	A
 r   c                v    UR                  S[        5        [        R                  R                  " U /UQ70 UD6$ )zThis works exactly like the method of the same name on a regular
:class:`click.Group` but it defaults the group class to
:class:`AppGroup`.
cls)
setdefaultr   r{   r   group)r   rJ   rT   s      r   r   AppGroup.group  s3    
 	%*{{  7777r   r   N)r   r   r   r   r   r   r   r   r   r   r   r   r   k  s    8r   r   c                D    Uc  g U R                  [        5      nX#l        U$ r   )r   r   r   )r   r   rN   infos       r   _set_appr     s%    }Z(D Lr   z-Az--appIMPORTzThe Flask application or factory function to load, in the form 'module:name'. Module can be a dotted import or file path. Name is not required if it is 'app', 'application', 'create_app', or 'make_app', and can be 'name(args)' to pass arguments.)metavarr   r   r   r   c                    U R                  UR                  5      nUb%  U[        R                  [        R                  4;   a  g U(       a  SOS[
        R                  S'   U$ )N10FLASK_DEBUG)get_parameter_sourcerS   r   DEFAULTDEFAULT_MAPr[   environ)r   r   rN   sources       r   
_set_debugr     sZ     %%ejj1Ff##)   (-#BJJ}Lr   z--debug/--no-debugzSet debug mode.)r   r   r   c                    Uc  g SS K n UR                  " S5        [        U5        U$ ! [         a    [        R                  " SU US9S ef = f)Nr   dotenvz4python-dotenv must be installed to load an env file.)r   r   )rx   import_modulerl   r{   BadParameterload_dotenv)r   r   rN   rx   s       r   _env_file_callbackr     sc     }) L    B
 		s	   ) "Az-ez
--env-file)rc   dir_okayzKLoad environment variables from this file. python-dotenv must be installed.)typer   r   r   r   c                     ^  \ rS rSrSr     S
             SU 4S jjjrS rU 4S jrU 4S jr S         SU 4S jjjr	SU 4S jjr
S	rU =r$ )
FlaskGroupi  a  Special subclass of the :class:`AppGroup` group that supports
loading more commands from the configured Flask app.  Normally a
developer does not have to interface with this class but there are
some very advanced use cases for which it makes sense to create an
instance of this. see :ref:`custom-scripts`.

:param add_default_commands: if this is True then the default run and
    shell commands will be added.
:param add_version_option: adds the ``--version`` option.
:param create_app: an optional callback that is passed the script info and
    returns the loaded app.
:param load_dotenv: Load the nearest :file:`.env` and :file:`.flaskenv`
    files to set environment variables. Will also change the working
    directory to the directory containing the first file found.
:param set_debug_flag: Set the app's debug flag.

.. versionchanged:: 2.2
    Added the ``-A/--app``, ``--debug/--no-debug``, ``-e/--env-file`` options.

.. versionchanged:: 2.2
    An app context is pushed when running ``app.cli`` commands, so
    ``@with_appcontext`` is no longer required for those commands.

.. versionchanged:: 1.0
    If installed, python-dotenv will be used to load environment variables
    from :file:`.env` and :file:`.flaskenv` files.
c                  > [        UR                  SS 5      =(       d    S5      nUR                  [        [        [
        45        U(       a  UR                  [        5        SU;  a  0 US'   US   R                  SS5        [        TU ](  " SSU0UD6  X l        X@l        XPl        U(       a?  U R                  [        5        U R                  [         5        U R                  ["        5        SU l        g )Nparamsr   context_settingsauto_envvar_prefixFLASKF)listr   extend_env_file_option_app_option_debug_optionrb   version_optionr   superrY   r   r   r   add_commandrun_commandshell_commandroutes_command_loaded_plugin_commands)	r   add_default_commandsr   add_version_optionr   r   extrar   	__class__s	           r   rY   FlaskGroup.__init__  s     eii$/526
 	'mDEMM.)U*(*E$% !,,-A7K00%0$&,[)]+^,',$r   c                    U R                   (       a  g [        R                  S:  a  SSKJn  OSS KnUR                  SS9 H-  nU R                  UR                  5       UR                  5        M/     SU l         g )N)   
   r   )ry   zflask.commands)r   T)
r   r5   version_inforx   ry   importlib_metadataentry_pointsr   loadrS   )r   ry   eps      r   _load_plugin_commands FlaskGroup._load_plugin_commands$  sb    ''w&*
 2''.>'?BRWWY0 @ (,$r   c                  > U R                  5         [        TU ]	  X5      nUb  U$ UR                  [        5      n UR                  5       n[        (       a  [        R                  " 5       ULa  UR                  UR                  5       5        UR                  R                  X5      $ ! [         a2  n[        R                  " SUR                  5        S3SSS9   S nAg S nAff = fNzError: 
Tred)errfg)r   r   get_commandr   r   r   r   r{   sechoformat_messager   _get_current_objectr   r   cli)r   r   rS   rvr   r   r1   r   s          r   r   FlaskGroup.get_command5  s    ""$ W +>I  ,	--/C {k==?sJcoo/0ww""3--  	KK'!"2"2"4!5R8duM	s   B) )
C%3(C  C%c                  > U R                  5         [        [        TU ]  U5      5      nUR	                  [
        5      n UR                  UR                  5       R                  R                  U5      5        [!        U5      $ ! [         a2  n[        R                  " SUR                  5        S3SSS9   S nANBS nAf[         a/    [        R                  " [        R                  " 5        S3SSS9   N}f = fr   )r   setr   list_commandsr   r   updater   r   r   r{   r   r   	Exceptionrm   rn   sorted)r   r   r   r   r1   r   s        r   r  FlaskGroup.list_commandsP  s    ""$&s+,  ,		KIIdmmo))77<= bz  	N KK'!"2"2"4!5R8duM 	K KK9//12"54EJ	Ks    8B 
C6(B::9C65C6c                  > S[         R                  S'   [        U R                  5      (       a
  [        5         SU;  a1  SU R                  ;  a!  [        U R                  U R                  S9US'   [        TU ]$  " X4SU0UD6$ )NtrueFLASK_RUN_FROM_CLIobj)r   r   parent)
r[   r   r   r   r   r   r   r   r   make_context)r   	info_namerJ   r  r   r   s        r   r  FlaskGroup.make_contexte  sz     ,2

'( 4++,,M%t/D/D"D%??4;N;NE%L w#ILFLeLLr   c                   > U(       d?  U R                   (       a.  [        R                  U0 / 5        [        R                  U0 / 5        [        TU ]  X5      $ r   )no_args_is_helpr   handle_parse_resultr   r   
parse_args)r   r   rJ   r   s      r   r  FlaskGroup.parse_args}  sD    ,, 00b"=++CR8w!#,,r   )r   r   r   r   )TNTTT)r   r   r   r   r   r   r   r   r   r   r   t.Anyr   r   r   )
r  r   rJ   	list[str]r  zclick.Context | Noner   r  r   click.Context)r   r  rJ   r  r   r  )r   r   r   r   r   rY   r   r   r  r  r  r   __classcell__r   s   @r   r   r     s    < &*48#' ##-"#- 2#- !	#-
 #- #- #- 
#- #-J,".62 (,	MM M %	M
 M 
M M0- -r   r   c                    [         R                  R                  X[        U 5      S R	                  [         R
                  5      5      U:H  $ )zTake ``other`` and remove the length of ``path`` from it. Then join it
to ``path``. If it is the original value, ``path`` is an ancestor of
``other``.N)r[   r\   rd   r'   lstripsep)r\   others     r   _path_is_ancestorr    s6     77<<CIK077?@EIIr   c                    SSK nU b5  [        R                  R	                  U 5      (       a  UR                  U S
S9$ g	S	nS H.  nUR                  USS9n U (       d  M  UR                  U S
S9  SnM0     U$ ! [         ah    U (       dH  [        R                  R	                  S5      (       d$  [        R                  R	                  S5      (       a  [
        R                  " SSSS9   g	f = f)a  Load "dotenv" files in order of precedence to set environment variables.

If an env var is already set it is not overwritten, so earlier files in the
list are preferred over later files.

This is a no-op if `python-dotenv`_ is not installed.

.. _python-dotenv: https://github.com/theskumar/python-dotenv#readme

:param path: Load the file at this location instead of searching.
:return: ``True`` if a file was loaded.

.. versionchanged:: 2.0
    The current directory is not changed to the location of the
    loaded file.

.. versionchanged:: 2.0
    When loading the env files, set the default encoding to UTF-8.

.. versionchanged:: 1.1.0
    Returns ``False`` when python-dotenv is not installed, or when
    the given path isn't a file.

.. versionadded:: 1.0
r   N.env	.flaskenvz^ * Tip: There are .env or .flaskenv files present. Do "pip install python-dotenv" to use them.yellowT)r   r   Fzutf-8)encoding)r   r!  )usecwd)	r   rl   r[   r\   isfiler{   r   r   find_dotenv)r\   r   loadedrS   s       r   r   r     s    4 77>>$%%dW%==F%!!$t!44'2 & M=  	277>>&))RWW^^K-H-HKK?	 	s   A6 6A/C('C(c                    [        5       (       a  gUb  [        R                  " SU S35        U b#  [        R                  " SU (       a  SOS 35        gg)zUShow extra startup messages the first time the server is run,
ignoring the reloader.
Nz * Serving Flask app ''z * Debug mode: onoff)r   r{   r|   )r   r   s     r   show_server_bannerr,    sP      !!"

+O+<A>?

_UT$>?@ r   c                  (    \ rS rSrSrSrS rS rSrg)CertParamTypei  zClick option type for the ``--cert`` option. Allows either an
existing file, the string ``'adhoc'``, or an import for a
:class:`~ssl.SSLContext` object.
r\   c                :    [         R                  " SSSS9U l        g )NTFrc   r   resolve_path)r{   Path	path_type)r   s    r   rY   CertParamType.__init__  s    4%dSr   c                    SS K n U R	                  XU5      $ ! [         a    [        R                  " SUU5      S ef = f! [        R                   a    [        R
                  " XU5      R                  5       nUS:X  a1   SS KnO'! [         a    [        R                  " SUU5      S ef = fUs $ [        USS9n[        XdR                  5      (       a  Us $ e f = f)Nr   z?Using "--cert" requires Python to be compiled with SSL support.adhocz<Using ad-hoc certificates requires the cryptography library.T)silent)sslrl   r{   r   r3  STRINGlowercryptographyr	   r$   
SSLContext)r   rN   r   r   r8  r;  r  s          r   convertCertParamType.convert  s    		>>%44  	$$Q 		 !! 	LLs399;E '"  ,,V  	   d3C#~~..
)	s7    A  $= ?C BC$B))C0&CC)r3  N)	r   r   r   r   r   rS   rY   r=  r   r   r   r   r.  r.    s    
 DT r   r.  c                   U R                   R                  S5      nUS:H  n SSKn[        X5R                  5      nUbl  U(       a  [        R                  " SX5      eU(       a  [        R                  " SX5      eU(       d  [        R                  " SX5      eX24U R                   S'   U$ U(       a%  U(       d  U(       d  [        R                  " S	X5      eU$ ! [
         a    Sn Nf = f)
zThe ``--key`` option must be specified when ``--cert`` is a file.
Modifies the ``cert`` param to be a ``(cert, key)`` pair if needed.
certr6  r   NFz.When "--cert" is "adhoc", "--key" is not used.z:When "--cert" is an SSLContext object, "--key is not used.z "--cert" must also be specified.zRequired when using "--cert".)r   getr8  r$   r<  rl   r{   r   )r   r   rN   r@  is_adhocr8  
is_contexts          r   _validate_keyrD    s     ::>>&!DwH6  nn5
$$@#  $$Lc  $$%GTT![

6 L Z$$%DcQQL3  
s   C C'&C'c                  ,   ^  \ rS rSrSrU 4S jrSrU =r$ )SeparatedPathTypei-  zClick option type that accepts a list of values separated by the
OS's path separator (``:``, ``;`` on Windows). Each value is
validated as a :class:`click.Path` type.
c                v   > U R                  U5      n[        TU ]  nU Vs/ s H  oe" XbU5      PM     sn$ s  snf r   )split_envvar_valuer   r=  )r   rN   r   r   itemssuper_convertitemr   s          r   r=  SeparatedPathType.convert3  s;    ''.<ABEDd3/EBBBs   6r   )r   r   r   r   r   r=  r   r  r  s   @r   rF  rF  -  s    
C Cr   rF  runzRun a development server.)
short_helpz--hostz-hz	127.0.0.1zThe interface to bind to.)defaultr   z--portz-pi  zThe port to bind to.z--certz(Specify a certificate file to use HTTPS.)r   r   r   z--keyr0  z2The key file to use when specifying a certificate.)r   r   r   r   z--reload/--no-reloadzVEnable or disable the reloader. By default the reloader is active if debug is enabled.z--debugger/--no-debuggerzVEnable or disable the debugger. By default the debugger is active if debug is enabled.z --with-threads/--without-threadsz!Enable or disable multithreading.z--extra-fileszMExtra files that trigger a reload on change. Multiple paths are separated by r@   )rO  r   r   z--exclude-patternsznFiles matching these fnmatch patterns will not trigger a reload on change. Multiple patterns are separated by c	                (  ^  U R                  5       n	[        5       nUc  UnUc  Un[        XR                  5        [        UUU	UUUUUUS9	  g! [         a9  n
[        5       (       a"  [        R                  " 5         U
mU4S jn	 Sn
A
NvU
SeSn
A
ff = f)zRun a local development server.

This server is for development purposes only. It does not provide
the stability, security, or performance of production WSGI servers.

The reloader and debugger are enabled by default with the '--debug'
option.
c                
   > TS er   r   )r   start_responser   s     r   r   run_command.<locals>.app  s    t#r   N)use_reloaderuse_debuggerthreadedssl_contextextra_filesexclude_patterns)	r   r  r   rm   	print_excr   r,  r   r   )r   hostportreloaddebuggerwith_threadsr@  rX  rY  r   r1   r   r   s               @r   r   r   9  s    Pmmo  E~u223)
3  #%% !C$ $ s   A 
B,B	BBshellzRun a shell in the app context.c                    SSK n S[        R                   S[        R                   S[        R
                   S[        R                   3n0 n[        R                  R                  S5      nU(       a]  [        R                  R                  U5      (       a9  [        U5       n[        [        UR                  5       US5      U5        SSS5        UR!                  [        R"                  " 5       5        [%        [        S	S5      nUb3   SSKnSS
KJn  UR-                  U" U5      R.                  5        U" 5         U R3                  XS9  g! , (       d  f       N= f! [0         a     N4f = f)a&  Run an interactive Python shell in the context of a given
Flask application.  The application will populate the default
namespace of this shell according to its configuration.

This is useful for executing small snippets of management code
without having to manually configure the application.
r   Nru   z on z
App: z
Instance: PYTHONSTARTUPexec__interactivehook__)	Completer)bannerlocal)coder5   rz   r}   r   r   instance_pathr[   r   rA  r\   r%  openr>   compilereadr  make_shell_contextr#   readlinerlcompleterre  set_completercompleterl   interact)rh  rf  r   startupr;   interactive_hookrn  re  s           r   r   r     s$     #++d3<<. 1''( ) ../	1 
 C jjnn_-G277>>'**']a7F3S9  JJ{--/0
 s$94@#	<- ""9S>#:#:;MMM+/ ]  		s   "&E	
E 
E
E)(E)routeszShow the routes for the app.z--sortz-s)endpointmethodsdomainrulematchrv  zgMethod to sort routes by. 'match' is the order that Flask will match routes when dispatching a request.)r   rO  r   z--all-methodszShow HEAD and OPTIONS methods.)r   r   c                B  ^
^ [        [        R                  R                  5       5      nU(       d  [        R
                  " S5        gU(       a
  [        5       OSS1n[        R                  R                  m[        U4S jU 5       5      n/ nU H  nUR                  SR                  [        UR                  =(       d
    [        5       U-
  5      5      /nU(       a7  UR                  T(       a  UR                  OUR                  =(       d    S5        UR                  UR                   5        UR                  U5        M     SS	/nS
S/n	U(       a+  UR                  T(       a  SOS5        U	R                  S5        UR                  S5        U	R                  S5         UR#                  [%        U	R'                  U 5      5      S9  UR+                  SU5        [-        [/        U5      5       V
^
s/ s H  m
[1        U
4S jU 5       5      PM     nn
UR+                  SU Vs/ s H  nSU-  PM
     sn5        SR                  S [3        U5       5       5      nU H&  n[        R
                  " UR4                  " U6 5        M(     g! [(         a     Nf = fs  sn
f s  snf )z6Show all registered routes with endpoints and methods.zNo routes were registered.NHEADOPTIONSc              3  b   >#    U  H$  nT(       a  UR                   OUR                  v   M&     g 7fr   )r[  	subdomain).0ry  host_matchings     r   	<genexpr>!routes_command.<locals>.<genexpr>  s"     VPU-TYYT^^CPUs   ,/z, r"   EndpointMethodsrv  rw  Host	Subdomainrx  Rulery  )keyr   c              3  @   >#    U  H  n[        UT   5      v   M     g 7fr   )r'   )r  rowis     r   r  r    s     .##c!f++s   r
   -z  c              3  8   #    U  H  u  pS U SU S3v   M     g7f){z:<}Nr   )r  r  ws      r   r  r    s"     G5FTQ2aS1#R5Fs   )r   r   url_map
iter_rulesr{   r|   r  r  anyrv  rd   r  rw  rb   r[  r  ry  sortr   indexrO   re   ranger'   max	enumerateformat)r  all_methodsrulesignored_methods
has_domainrowsry  r  headerssortsr  widthsr  templater  s             `   @r   r   r     s    $$//12E

/0*ce0CO''55MVPUVVJDMMIIfdll3ceFGH

 JJ]		M2N

499C  9%G#EvK@XNN6	LL		jT!23	4 	KK78=c'l8KL8K1c...8KFLKKV,VC!GV,-yyGYv5FGGH

8??C()    M,s   "'J 2J#J

JJrs   zA general utility script for Flask applications.

An application to load must be given with the '--app' option,
'FLASK_APP' environment variable, or with a 'wsgi.py' or 'app.py' file
in the current directory.
)rS   r   c                 ,    [         R                  5         g r   )r   mainr   r   r   r  r  '  s    HHJr   __main__)T)r   r  r   click.OptionrN   r   r   r   )r   r  r   r  rN   r   r   zbool | Noner   )r\   zstr | os.PathLike | Noner   r   )r   r   )r  strr  r   r   r   )N
__future__r   rA   importlib.metadatarx   r(   r[   r}   r   r5   rm   typingt	functoolsr   operatorr   r{   
click.corer   rt   r   werkzeug.servingr   werkzeug.utilsr	   globalsr   helpersr   r   TYPE_CHECKINGr   r   
UsageErrorr   r2   r+   rW   ri   rq   r   Optionr   r   make_pass_decoratorpass_script_infor   r   r   r   r   r   r   r   r2  r   r   r  r   r,  	ParamTyper.  rD  rF  r   optionr\   pathsepr   r   re   r   Choicer   r   r  r   r   r   r   <module>r     s"   " 
   	  	 
   $   &  5 (   # $??>U%% >2j4IX':40  M	"A AH ,,ZE (28u{{ 8> ll	7O	
 " 			+4>2 <<	<	4%	0	V c- c-LJ:zA+EOO +\"J	C

 	C u!<=hk8SThd1GH		3	 	4%d	C	= 
% 
% &	,
 			WW__/q	2 			GGOOa	!	 8 	 I U >j8v     !] + w#DE,,  F,,^ x$BC	H	I	'	 ot2RS.*  T	 D.*b 	
	 zF r   