
    `j;                     \    S r SSKrSSKrSSKrSSKrSrS r " S S\R                  5      r	g)zLSupport CLI plugins with click and entry points.

See :func:`with_plugins`.
    Nz2.0c                    ^  U 4S jnU$ )a  Decorator for loading and attaching plugins to a ``click.Group()``.

Plugins are loaded from an ``importlib.metadata.EntryPoint()``. Each entry
point must point to a ``click.Command()``. An entry point that fails to
load will be wrapped in a ``BrokenCommand()`` to allow the CLI user to
discover and potentially debug the problem.

>>> from importlib.metadata import entry_points
>>>
>>> import click
>>> from click_plugins import with_plugins
>>>
>>> @with_plugins('group_name')
>>> @click.group()
>>> def group():
...     '''Group'''
>>>
>>> @with_plugins(entry_points('group_name'))
>>> @click.group()
>>> def group():
...     '''Group'''
>>>
>>> @with_plugins(importlib.metadata.EntryPoint(...))
>>> @click.group()
>>> def group():
...     '''Group'''
>>>
>>> @with_plugins("group1")
>>> @with_plugins("group2")
>>> def group():
...     '''Group'''

:param str or EntryPoint or sequence[EntryPoint] entry_points:
    Entry point group name, a single ``importlib.metadata.EntryPoint()``,
    or a sequence of ``EntryPoint()``s.

:rtype function:
c                   > [        U [        R                  5      (       d  [        S[	        U 5       35      e[        T[
        5      (       a  [        R                  R                  TS9nO/[        T[        R                  R                  5      (       a  T/nOTnU H#  n U R                  UR                  5       5        M%     U $ ! [         a%  nU R                  [        X#5      5         S nAMS  S nAff = f)NzDplugins can only be attached to an instance of 'click.Group()' not: )group)
isinstanceclickGroup	TypeErrorreprstr	importlibmetadataentry_points
EntryPointadd_commandload	ExceptionBrokenCommand)r   all_entry_pointseper   s       a/var/www/html/Sattelite-Image/venv/lib/python3.13/site-packages/rasterio/_vendor/click_plugins.py	decoratorwith_plugins.<locals>.decoratorf   s    %--))-e78 8
 lC(((11>>"  ?  $ i&8&8&C&CDD ,~  ,"B8!!"''), #   8!!-"6778s    C
C4C//C4 )r   r   s   ` r   with_pluginsr   2   s    hB     c                   8   ^  \ rS rSrSrU 4S jrS rS rSrU =r	$ )r      zRepresents a plugin ``click.Command()`` that failed to load.

Can be executed just like a ``click.Command()``, but prints information
for debugging and exits with an error code.
c           	      0  > [         TU ]  UR                  5        [        R                  R                  U5      nSR                  UR                  UR                  [        R                  SR                  UR                  5       5      S9U l        SU l        g)z
:param importlib.metadata.EntryPoint entry_point:
    Entry point that failed to load.
:param Exception exception:
    Raised when attempting to load the entry point associated with
    this instance.
zf{ls}ERROR: entry point '{module}:{name}' could not be loaded. Contact its author for help.{ls}{ls}{tb} )modulenamelstbuO   † Warning: could not load plugin. Invoke command with '--help' for traceback.N)super__init__r"   	tracebackTracebackExceptionfrom_exceptionformatr!   oslinesepjoinhelp
short_help)selfentry_point	exceptiontbe	__class__s       r   r&   BrokenCommand.__init__   s     	))*
 **99)D89?%%!!zzwwszz|$	 :@ :
 		' 	r   c                 z    [         R                  " U R                  UR                  SS9  UR	                  S5        g)zVPrint traceback and debugging message.

:param click.Context ctx:
    Active context.
T)colorerr   N)r   echor.   r7   exit)r0   ctxs     r   invokeBrokenCommand.invoke   s'     	

499CII48r   c                     U$ )zPass arguments along without parsing.

:param click.Context ctx:
    Active context.
:param list args:
    List of command line arguments.
r   )r0   r<   argss      r   
parse_argsBrokenCommand.parse_args   s	      r   )r.   r/   )
__name__
__module____qualname____firstlineno____doc__r&   r=   rA   __static_attributes____classcell__)r4   s   @r   r   r      s    '
R	 r   r   )
rG   importlib.metadatar   r+   r'   r   __version__r   Commandr   r   r   r   <module>rM      s9   D  	   UpLEMM Lr   