
    ^h                         S r SSKrSSKJr  SSKJrJrJr  SSKJ	r	  \R                  " S5      r\ " S S\5      5       rg)	z9Implementation of configuration-related magic functions.
    N)
UsageError)Magicsmagics_class
line_magic)errorz
^\w+\.\w+$c                   8   ^  \ rS rSrU 4S jr\S 5       rSrU =r$ )ConfigMagics   c                 :   > [         [        U ]  U5        / U l        g N)superr	   __init__configurables)selfshell	__class__s     T/home/james-whalen/.local/lib/python3.13/site-packages/IPython/core/magics/config.pyr   ConfigMagics.__init__   s    lD*51    c                    SSK Jn  [        [        U R                  R
                   Vs/ s H%  nUR                  R                  SS9(       d  M#  UPM'     sn5      S S9nU Vs/ s H  o3R                  R                  PM     nnUR                  5       nU(       d!  [        S5        U H  n[        SU5        M     g	Xe;   aw  XER                  U5         nUR                  nUR                  U5      n	[        R                  " [        R                  " S
[        R                   5      SU	5      n	[        U	5        g	["        R%                  U5      (       a0  UR'                  S5      u  p[)        XER                  U5         U
5      $ SU;  aE  SnUR+                  5       nU H   nXR+                  5       :X  d  M  USU-  -   n  O   [-        X-  5      eU" 5       n[/        SU-   U R                  R0                  [3        5       5        U H  n UR5                  U5        M     g	s  snf s  snf ! [6         a  n[9        U5         S	nAM?  S	nAff = f)a  configure IPython

    %config Class[.trait=value]

This magic exposes most of the IPython config system. Any
Configurable class should be able to be configured with the simple
line::

    %config Class.trait=value

Where `value` will be resolved in the user's namespace, if it is an
expression or variable name.

Examples
--------

To see what classes are available for config, pass no arguments::

    In [1]: %config
    Available objects for config:
        AliasManager
        DisplayFormatter
        HistoryManager
        IPCompleter
        LoggingMagics
        MagicsManager
        OSMagics
        PrefilterManager
        ScriptMagics
        TerminalInteractiveShell

To view what is configurable on a given class, just pass the class
name::

    In [2]: %config LoggingMagics
    LoggingMagics(Magics) options
    ---------------------------
    LoggingMagics.quiet=<Bool>
        Suppress output of log state when logging is enabled
        Current: False

but the real use is in setting values::

    In [3]: %config LoggingMagics.quiet = True

and these values are read from the user_ns if they are variables::

    In [4]: feeling_quiet=False

    In [5]: %config LoggingMagics.quiet = feeling_quiet

r   )ConfigT)configc                 .    U R                   R                  $ r   )r   __name__)xs    r   <lambda>%ConfigMagics.config.<locals>.<lambda>_   s    q{{7K7Kr   )keyzAvailable objects for config:z   Nz^-- .=z>Invalid config statement: %r, should be `Class.trait = value`.z!
Did you mean %s (note the case)?zcfg.)traitlets.config.loaderr   sortedsetr   r   r   class_traitsr   stripprintindexclass_get_helpresubcompile	MULTILINEregmatchsplitgetattrlowerr   execuser_nslocalsupdate_config	Exceptionr   )r   sr   cr   
classnameslinenameclshelpattrmsgll	classnamecfgconfigurablees                    r   r   ConfigMagics.config#   s   l 	3 s

0H0H $'0H1()(@(@(@(M &'0H $'  (-KM 6CD]{{++]
Dwwy12"eT" # ..t45A++C%%a(D66"**VR\\:BED$KYYt__

3IC=)9)9#)>?EE_5C B'	** Dy PPC (
 cj))
 hVD[$**,,fh7)L**3/ *W$' EV  as)   "HH$H"H''
I1II)r   )	r   
__module____qualname____firstlineno__r   r   r   __static_attributes____classcell__)r   s   @r   r	   r	      s      h hr   r	   )__doc__r*   IPython.core.errorr   IPython.core.magicr   r   r   loggingr   r,   r.   r	    r   r   <module>rQ      sI    
 * ? ?  	jjo6 o or   