o
    (j6h@                     @  sT  d dl mZ d dlZd dlmZ d dlZd dlZd dl	Z	d dl
Z
d dlZd dlZd dlZd dlZd dlmZ d dlmZ d dlmZ d dlZd dlmZ d dlmZ d dlmZ d d	lmZ d
dlm Z  d
dl!m"Z" d
dl!m#Z# ej$rd dl%Z%d dl&m'Z' d dl&m(Z( d dl&m)Z) d
dl*m+Z+ G dd dej,Z-dddZ.dddZ/dd!d"Z0dd$d%Z1ej2	&ddd+d,Z3ej2	-ddd0d,Z3	&ddd1d,Z3dd9d:Z4ej5d;gd<d=e4d&d&d>Z6G d?d@ d@Z7ej8e7d&dAZ9ej:dBej;d-ej<f dCZ=ddDdEZ>G dFdG dGej?Z@ddIdJZAej5dKdLgdMdNd&d=eAdOZBddQdRZCej5dSgdTd=eCdUZDddVdWZEej5dXdYgejFd&d=dZd[d&d=eEd\ZGG d]d^ d^e@ZHdd`daZI	&dddddeZJddhdiZKG djdk dkejLZMddldmZNG dndo doejFZOejPdpdqdrejQdsdtdudvdwejQdxdydzd{dwejQd|eM d}d&d~ejQdejFd&d=d&deNd=ddejQddddwejQddddwejQdd&ddwejQddeO de	jRjSddejQddeO de	jRjSdde9dddZTeTjUVd eD ejPdddre>dddZWejPdddrejQddeXddddejQdd&dde>dddZYeHdddZZdddZ[e\dkr(e[  dS dS )    )annotationsN)update_wrapper)
itemgetter)
ModuleType)ParameterSource)
run_simple)is_running_from_reloader)import_string   )current_app)get_debug_flag)get_load_dotenv)StartResponse)WSGIApplication)WSGIEnvironmentFlaskc                   @  s   e Zd ZdZdS )NoAppExceptionz3Raised if an application cannot be found or loaded.N)__name__
__module____qualname____doc__ r   r   X/var/www/html/chefvision.cloud.itp360.com/venv/lib/python3.10/site-packages/flask/cli.pyr   %   s    r   moduler   returnr   c                   s*  ddl m  dD ]}t| |d}t| r|  S q fdd| j D }t|dkr0|d S t|dkrCtd| j d	| j d
dD ]B}t| |d}t	
|rz| }t| r`|W   S W qE ty } zt|sn td| d| j d| j d| d	|d}~ww qEtd| j d	| j d)zwGiven a module instance this tries to find the best possible
    application in the module or raises an exception.
    r
   r   )appapplicationNc                   s   g | ]	}t | r|qS r   )
isinstance).0vr   r   r   
<listcomp>7   s    z!find_best_app.<locals>.<listcomp>r   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   getattrr   __dict__valueslenr   r   inspect
isfunction	TypeError_called_with_wrong_args)r   	attr_namer   matchesapp_factoryer   r   r   find_best_app)   s^   



r2   ft.Callable[..., Flask]boolc                 C  sF   t  d }z|dur|jj| ju rW ~dS |j}|dusW ~dS ~w )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.
       NFT)sysexc_infotb_framef_code__code__tb_next)r3   tbr   r   r   r-   ^   s   	
r-   app_namestrc           
   
   C  s  ddl m} ztj| ddj}W n ty"   td|ddw t|tj	r1|j
}g }i }nDt|tjrmt|jtj	sFtd|d	|jj
}zd
d |jD }dd |jD }W n tyl   td|d	dw td|dzt| |}W n ty } ztd|d| jd	|d}~ww t|rz	||i |}	W n  ty } zt|s td|d| jd|d}~ww |}	t|	|r|	S td| j d| d)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: .c                 S  s   g | ]}t |qS r   )astliteral_eval)r   argr   r   r   r!      s    z&find_app_by_string.<locals>.<listcomp>c                 S  s&   i | ]}|j d ur|j t|jqS N)rE   rC   rD   value)r   kwr   r   r   
<dictcomp>   s
    
z&find_app_by_string.<locals>.<dictcomp>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   rC   parsestripbodySyntaxErrorr   r   NameidCallfuncargskeywords
ValueErrorr&   AttributeErrorr   r*   r+   r,   r-   )
r   r>   r   exprnamerR   kwargsattrr1   r   r   r   r   find_app_by_stringx   s   







rZ   pathc                 C  s   t j| } t j| \}}|dkr|} t j| dkr"t j| } g }	 t j| \} }|| t jt j	| ds>nq%t
jd | krMt
jd|  d	|ddd S )	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__Tz__init__.pyr   rB   N)osr[   realpathsplitextbasenamedirnamesplitappendexistsjoinr7   insert)r[   fnameextmodule_namerW   r   r   r   prepare_import   s    
rk   Trj   
str | Noneraise_if_not_foundt.Literal[True]c                 C     d S rF   r   rj   r>   rm   r   r   r   
locate_app      rq   .t.Literal[False]Flask | Nonec                 C  ro   rF   r   rp   r   r   r   rq      rr   c              	   C  s   zt |  W n) ty/   t d jr!td| dt  d |r,td| dd Y d S w tj|  }|d u r=t	|S t
||S )Nr6   zWhile importing z, an ImportError was raised:

zCould not import rB   )
__import__ImportErrorr7   r8   r<   r   	traceback
format_excmodulesr2   rZ   )rj   r>   rm   r   r   r   r   rq      s&   

ctxclick.Contextparamclick.ParameterrG   t.AnyNonec                 C  sX   |r| j rd S tjd}tjd}tjdt  d| d| | jd | 	  d S )NflaskwerkzeugPython z
Flask z

Werkzeug )color)
resilient_parsing	importlibmetadataversionclickechoplatformpython_versionr   exit)rz   r|   rG   flask_versionwerkzeug_versionr   r   r   get_version  s   
r   z	--versionzShow the Flask version.F)helpexpose_valuecallbackis_flagis_eagerc                   @  s.   e Zd ZdZ				ddddZdddZdS )
ScriptInfoa  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.

    .. versionchanged:: 3.1
        Added the ``load_dotenv_defaults`` parameter and attribute.
    NTapp_import_pathrl   r"   t.Callable[..., Flask] | Noneset_debug_flagr5   load_dotenv_defaultsr   r   c                 C  s.   || _ || _i | _|| _t|| _	 d | _d S rF   )r   r"   datar   r   r   _loaded_app)selfr   r"   r   r   r   r   r   r\   1  s   

zScriptInfo.__init__r   c                 C  s   | j dur| j S d}| jdur|  }n5| jr3tjd| jdddg dd \}}t|}t||}ndD ]}t|}t|ddd}|durH nq5|du rQtd	| jrXt	 |_
|| _ |S )
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
   )maxsplitr6   )zwsgi.pyzapp.pyF)rm   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   rerc   rk   rq   r   r   r   debug)r   r   r[   rW   import_namer   r   r   load_appM  s2   


zScriptInfo.load_app)NNTT)
r   rl   r"   r   r   r5   r   r5   r   r   )r   r   )r   r   r   r   r\   r   r   r   r   r   r   %  s    r   )ensureF)boundc                   s   t jd
 fdd}t| S )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.
    rz   r{   rR   r~   rX   r   c                  s8   t s| t }| |  | j g|R i |S rF   )r   ensure_objectr   r   with_resourceapp_contextinvoke)rz   rR   rX   r   r3   r   r   	decorator  s   z"with_appcontext.<locals>.decoratorN)rz   r{   rR   r~   rX   r~   r   r~   )r   pass_contextr   )r3   r   r   r   r   with_appcontext|  s   
r   c                      s0   e Zd ZdZd fddZd fd
dZ  ZS )AppGroupa   This 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`.
    rR   r~   rX   r   3t.Callable[[t.Callable[..., t.Any]], click.Command]c                   s&    ddd
 fdd}|S )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   Tr3   t.Callable[..., t.Any]r   click.Commandc                   s&   rt | } ttji | S rF   )r   superr   commandr   )	__class__rR   rX   r   wrap_for_ctxr   r   r     s   z#AppGroup.command.<locals>.decoratorN)r3   r   r   r   )pop)r   rR   rX   r   r   )rR   rX   r   r   r   r     s   zAppGroup.command1t.Callable[[t.Callable[..., t.Any]], click.Group]c                   s   | dt t j|i |S )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   group)r   rR   rX   r   r   r   r     s   zAppGroup.group)rR   r~   rX   r~   r   r   )rR   r~   rX   r~   r   r   )r   r   r   r   r   r   __classcell__r   r   r   r   r     s    r   click.Optionc                 C  s    |d u rd S |  t}||_|S rF   )r   r   r   )rz   r|   rG   infor   r   r   _set_app  s
   
r   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   bool | Nonec                 C  s>   |  |j}|d ur|tjtjfv rd S |rdndtjd< |S )N10FLASK_DEBUG)get_parameter_sourcerW   r   DEFAULTDEFAULT_MAPr^   environ)rz   r|   rG   sourcer   r   r   
_set_debug  s   
r   z--debug/--no-debugzSet debug mode.)r   r   r   c                 C  s^   zdd l }W n ty   |d urtjd| |dd Y nw |d us%| jjr-t|| jjd |S )Nr   z4python-dotenv must be installed to load an env file.)rz   r|   )load_defaults)dotenvrv   r   BadParameterobjr   load_dotenv)rz   r|   rG   r   r   r   r   _env_file_callback  s    r   z-ez
--env-file)re   dir_okayzLoad environment variables from this file, taking precedence over those set by '.env' and '.flaskenv'. Variables set directly in the environment take highest precedence. python-dotenv must be installed.)typer   r   r   r   c                      st   e Zd ZdZ					d&d' fddZd(ddZd) fddZd* fddZ	d+d, fd"d#Zd- fd$d%Z	  Z
S ).
FlaskGroupa  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:: 3.1
        ``-e path`` takes precedence over default ``.env`` and ``.flaskenv`` files.

    .. 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.
    TNadd_default_commandsr5   r"   r   add_version_optionr   r   extrar~   r   r   c                   s   t |dd pd}|tttf |r|t d|vr!i |d< |d dd t	 j
dd|i| || _|| _|| _|rN| t | t | t d| _d S )Nparamsr   context_settingsauto_envvar_prefixFLASKF)listr   extend_env_file_option_app_option_debug_optionrd   version_optionr   r   r\   r"   r   r   add_commandrun_commandshell_commandroutes_command_loaded_plugin_commands)r   r   r"   r   r   r   r   r   r   r   r   r\   3  s    	




zFlaskGroup.__init__c                 C  sX   | j rd S tjdkrddlm} ndd l}|jddD ]}| | |j	 qd| _ d S )N)   
   r   )r   zflask.commands)r   T)
r   r7   version_infor   r   importlib_metadataentry_pointsr   loadrW   )r   r   epr   r   r   _load_plugin_commandsX  s   

z FlaskGroup._load_plugin_commandsrz   r{   rW   r?   click.Command | Nonec              
     s   |    t ||}|d ur|S |t}z| }W n! ty= } ztjd|	  dddd W Y d }~d S d }~ww t
rFt
 |urM||  |j||S NzError: 
Tred)errfg)r   r   get_commandr   r   r   r   r   sechoformat_messager   _get_current_objectr   r   cli)r   rz   rW   rvr   r   r1   r   r   r   r   i  s   
zFlaskGroup.get_command	list[str]c              
     s   |    tt |}|t}z|| j| W t|S  t	yD } zt
jd|  dddd W Y d }~t|S d }~w ty\   t
jt  dddd Y t|S w r   )r   setr   list_commandsr   r   updater   r   r   r   r   r   	Exceptionrw   rx   sorted)r   rz   r   r   r1   r   r   r   r     s   

&zFlaskGroup.list_commands	info_namerl   rR   parentclick.Context | Nonec                   sN   dt jd< d|vrd| jvrt| j| j| jd|d< t j||fd|i|S )NtrueFLASK_RUN_FROM_CLIr   )r"   r   r   r  )	r^   r   r   r   r"   r   r   r   make_context)r   r   rR   r  r   r   r   r   r    s   


zFlaskGroup.make_contextc                   sR   |s| j st|dkr"|d | |v r"t|i g  t|i g  t ||S )Nr
   r   )no_args_is_helpr)   get_help_option_namesr   handle_parse_resultr   r   
parse_args)r   rz   rR   r   r   r   r	    s
   
zFlaskGroup.parse_args)TNTTT)r   r5   r"   r   r   r5   r   r5   r   r5   r   r~   r   r   r   r   )rz   r{   rW   r?   r   r   )rz   r{   r   r   rF   )
r   rl   rR   r   r  r  r   r~   r   r{   )rz   r{   rR   r   r   r   )r   r   r   r   r\   r   r   r   r  r	  r   r   r   r   r   r     s    !
%r   otherc                 C  s&   t j| |t| d t j|kS )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[   rf   r)   lstripsep)r[   r  r   r   r   _path_is_ancestor  s   &r  str | os.PathLike[str] | Noner   c                 C  s   zddl }W n  ty&   | stjdstjdr#tjdddd Y d	S w i }|rCd
D ]}|j|dd }s9q-||j|ddO }q-| durVtj| rV||j| ddO }|	 D ]\}}|tj
v sg|du rhqZ|tj
|< qZt|S )ac  Load "dotenv" files to set environment variables. A given path takes
    precedence over ``.env``, which takes precedence over ``.flaskenv``. After
    loading and combining these files, values are only set if the key is not
    already set in ``os.environ``.

    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.
    :param load_defaults: Search for and load the default ``.flaskenv`` and
        ``.env`` files.
    :return: ``True`` if at least one env var was loaded.

    .. versionchanged:: 3.1
        Added the ``load_defaults`` parameter. A given path takes precedence
        over default files.

    .. 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	.flaskenvzH * Tip: There are .env files present. Install python-dotenv to use them.yellowT)r   r   F)r  r  )usecwdzutf-8)encoding)r   rv   r^   r[   isfiler   r   find_dotenvdotenv_valuesitemsr   r5   )r[   r   r   r   default_namedefault_pathkeyrG   r   r   r   r     s0   "r   r   r   c                 C  sL   t  rdS |durtd| d | dur$td| rdnd  dS dS )z]Show 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   r   r   r   show_server_banner  s   r  c                   @  s(   e Zd ZdZdZdddZdddZdS )CertParamTypezClick option type for the ``--cert`` option. Allows either an
    existing file, the string ``'adhoc'``, or an import for a
    :class:`~ssl.SSLContext` object.
    r[   r   r   c                 C  s   t jdddd| _d S )NTFre   r   resolve_path)r   Path	path_type)r   r   r   r   r\     s   zCertParamType.__init__rG   r~   r|   click.Parameter | Nonerz   r  c                 C  s   zdd l }W n ty   td||d w z| |||W S  tjy]   t||| }|dkrLz	dd l}W | Y S  tyK   td||d w t|dd}t	||j
r\| Y S  w )Nr   z?Using "--cert" requires Python to be compiled with SSL support.adhocz<Using ad-hoc certificates requires the cryptography library.T)silent)sslrv   r   r   r$  STRINGlowercryptographyr	   r   
SSLContext)r   rG   r|   rz   r(  r+  r   r   r   r   convert  sB   
	zCertParamType.convertNr
  rG   r~   r|   r%  rz   r  r   r~   )r   r   r   r   rW   r\   r-  r   r   r   r   r     s
    
r   c                 C  s   | j d}|dk}zddl}W n ty   d}Y nw t||j}|durJ|r/td| ||r8td| ||sAtd| |||f| j d< |S |rW|sW|sWtd	| ||S )
zThe ``--key`` option must be specified when ``--cert`` is a file.
    Modifies the ``cert`` param to be a ``(cert, key)`` pair if needed.
    certr&  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   getr(  rv   r   r,  r   r   )rz   r|   rG   r/  is_adhocr(  
is_contextr   r   r   _validate_keyD  s4   r3  c                      s"   e Zd ZdZd fd	d
Z  ZS )SeparatedPathTypezClick 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.
    rG   r~   r|   r%  rz   r  r   c                   s(   |  |}t j fdd|D S )Nc                   s   g | ]}| qS r   r   )r   itemrz   r|   super_convertr   r   r!   w  s    z-SeparatedPathType.convert.<locals>.<listcomp>)split_envvar_valuer   r-  )r   rG   r|   rz   r  r   r6  r   r-  q  s   
zSeparatedPathType.convertr.  )r   r   r   r   r-  r   r   r   r   r   r4  k  s    r4  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--keyr!  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 rB   )r;  r   r   z--exclude-patternsznFiles matching these fnmatch patterns will not trigger a reload on change. Multiple patterns are separated by r   hostportintreloaddebuggerwith_threadsr/  Cssl.SSLContext | tuple[str, str | None] | t.Literal['adhoc'] | Noneextra_fileslist[str] | Noneexclude_patternsc	                   s   z|   }	W n& ty, }
 zt rt  |
 d fdd}	n|
d	W Y d	}
~
nd	}
~
ww t }|d	u r6|}|d	u r<|}t|| j t|||	||||||d
	 d	S )a  Run 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.
    r   r   start_responser   r   cabc.Iterable[bytes]c                   s    d rF   r   )r   rF  r   r   r   r     s   zrun_command.<locals>.appN)use_reloaderuse_debuggerthreadedssl_contextrC  rE  )r   r   rF  r   r   rG  )	r   r   r   rw   	print_excr   r  r   r   )r   r<  r=  r?  r@  rA  r/  rC  rE  r   r1   r   r   rH  r   r   z  s8   H
r   shellzRun a shell in the app context.c                  C  s   ddl } dtj dtj dtj dtj }i }tj	d}|rEtj
|rEt|}tt| |d| W d   n1 s@w   Y  |t  ttd	d}|durwzddl}dd
lm} W n	 tyk   Y n	w |||j |  | j||d dS )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   Nr   z on z
App: z
Instance: PYTHONSTARTUPexec__interactivehook__)	Completer)bannerlocal)coder7   r   r   r   r   instance_pathr^   r   r0  r[   r  openr@   compilereadr   make_shell_contextr&   readlinerlcompleterrR  rv   set_completercompleteinteract)rU  rS  rz   startupr3   interactive_hookr[  rR  r   r   r   r     s2   

r   routeszShow the routes for the app.z--sortz-s)endpointmethodsdomainrulematchrc  zgMethod to sort routes by. 'match' is the order that Flask will match routes when dispatching a request.)r   r;  r   z--all-methodszShow HEAD and OPTIONS methods.)r   r   sortall_methodsc                   s  t tj }|std dS |rt nddh}tjj t fdd|D }g |D ],}|j	d
t|jp8t | g}|rM| rG|jn|jpKd ||j | q,d	d
g}ddg}|rq| ridnd |d |d |d zjt|| d W n	 ty   Y nw d| fddtt|D }	ddd |	D  d
dd t|	D }
D ]
}t|
j|  qdS )z6Show all registered routes with endpoints and methods.zNo routes were registered.NHEADOPTIONSc                 3  s     | ]} r	|j n|jV  qd S rF   )r<  	subdomain)r   rf  )host_matchingr   r   	<genexpr>7  s    z!routes_command.<locals>.<genexpr>z, r%   EndpointMethodsrc  rd  Host	Subdomainre  Rulerf  )r  r   c                   s"   g | ] t  fd dD qS )c                 3  s    | ]	}t |  V  qd S rF   )r)   )r   rowir   r   rn  V  s    z,routes_command.<locals>.<listcomp>.<genexpr>)max)r   )rowsru  r   r!   V  s   " z"routes_command.<locals>.<listcomp>r
   c                 S  s   g | ]}d | qS )-r   )r   wr   r   r   r!   W  s    z  c                 s  s&    | ]\}}d | d| dV  qdS ){z:<}Nr   )r   rv  rz  r   r   r   rn  X  s   $ )r   r   url_map
iter_rulesr   r   r   rm  anyrc  rf   r   rd  rd   r<  rl  rf  rh  r   indexrT   rg   ranger)   	enumerateformat)rh  ri  rulesignored_methods
has_domainrf  rt  headerssortswidthstemplater   )rm  rx  r   r      sF   



r   r   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.
)rW   r   c                   C  s   t   d S rF   )r   mainr   r   r   r   r  j  s   r  __main__)r   r   r   r   )r3   r4   r   r5   )r   r   r>   r?   r   r   )r[   r?   r   r?   )T)rj   r?   r>   rl   rm   rn   r   r   ).)rj   r?   r>   rl   rm   rs   r   rt   )rj   r?   r>   rl   rm   r5   r   rt   )rz   r{   r|   r}   rG   r~   r   r   )r3   r   r   r   )rz   r{   r|   r   rG   rl   r   rl   )rz   r{   r|   r   rG   r5   r   r   )r[   r?   r  r?   r   r5   )NT)r[   r  r   r5   r   r5   )r   r5   r   rl   r   r   )rz   r{   r|   r}   rG   r~   r   r~   )r   r   r<  r?   r=  r>  r?  r5   r@  r5   rA  r5   r/  rB  rC  rD  rE  rD  r   r   r
  )rh  r?   ri  r5   r   r   )]
__future__r   rC   collections.abcabccabcimportlib.metadatar   r*   r^   r   r   r7   rw   typingt	functoolsr   operatorr   typesr   r   
click.corer   r   r   werkzeug.servingr   werkzeug.utilsr	   globalsr   helpersr   r   TYPE_CHECKINGr(  _typeshed.wsgir   r   r   r   r   
UsageErrorr   r2   r-   rZ   rk   overloadrq   r   Optionr   r   make_pass_decoratorpass_script_infoTypeVarCallableAnyr   r   Groupr   r   r   r   r   r   r#  r   r   r  r   r  	ParamTyper   r3  r4  r   optionr[   pathsepr   r   rg   r   Choicer   r   r  r   r   r   r   r   <module>   sB   

5

P

R

#

 
)
D
0'	
 =/
1


