
    +d                     l    d Z ddlZ ej        e          ZddlZddZddZd Z G d	 d
e	          Z
dS )z6 Provide a ``main`` function to run intake commands.

    N   c                 d    t          | t          j                   t          j        |           dS )a  Print an error message and exit.
    This function will call ``sys.exit`` with the given ``status`` and the
    process will terminate.

    Args:
        message (str) : error message to print

        status (int) : the exit status to pass to ``sys.exit``

    )fileN)printsysstderrexit)messagestatuss     /lib/python3.11/site-packages/intake/cli/util.pydier       s/     
'
####HV    , orc                     d | D             } t          |           dk    s||                    |           S |                    | dd                   d|d| d         S )a  Join together sequences of strings into English-friendly phrases using
    a conjunction when appropriate.

    Args:
        seq (seq[str]) : a sequence of strings to nicely join

        sep (str, optional) : a sequence delimiter to use (default: ", ")

        conjunction (str or None, optional) : a conjunction to use for the last
            two items, or None to reproduce basic join behavior (default: "or")

    Returns:
        a joined string

    Examples:
        >>> nice_join(["a", "b", "c"])
        'a, b or c'

    c                 ,    g | ]}t          |          S  )str).0xs     r   
<listcomp>znice_join.<locals>.<listcomp>C   s    


a3q66


r   r   N )lenjoin)seqsepconjunctions      r   	nice_joinr   /   ss    (  
3


C
3xx1} G Gxx}} XXc#2#h////c"ggFFr   c           	          | |                                          }t          |                                          D ],}t          d                    ||||                              -dS )r   z
[{}] {}={}N)describesortedkeysr   format)catalognameinfokeys       r   print_entry_infor)   K   sg    4=!!##Ddiikk"" 9 9l!!$T#Y7788889 9r   c                   $    e Zd ZdZd Zd Zd ZdS )
Subcommanda  Abstract base class for subcommands

    Subclasses should define a class variable ``name`` that will be used as the
    subparser name, and a docstring, that will be used as the subparser help.
    After initialization, the parser for this comman will be avaialble as
    ``self.parser``.

    Subclasses must also implement:

    * an ``initialize(self)`` method that configures ``self.parser``

    * an ``invoke(self, args)`` method that accepts a set of argparse
      processed arguments as input.

    c                 <    || _         |                                  dS )z$Configure a parser for this command.N)parser
initialize)selfr-   s     r   __init__zSubcommand.__init__c   s    r   c                      t          d          )zpImplement in subclasses to configure self.parser with any arguments
        or additional sub-parsers.

        z&Subclasses must implement initialize()NotImplementedError)r/   s    r   r.   zSubcommand.initializeh   s    
 ""JKKKr   c                      t          d          )zAImplement in subclasses to perform the actual work of the commandz"Subclasses must implement invoke()r2   )r/   argss     r   invokezSubcommand.invokeo   s    !"FGGGr   N)__name__
__module____qualname____doc__r0   r.   r6   r   r   r   r+   r+   R   sS            
L L LH H H H Hr   r+   )r   )r   r   )r:   logging	getLoggerr7   logr   r   r   r)   objectr+   r   r   r   <module>r?      s     g!! 


   G G G G89 9 9H H H H H H H H H Hr   