ó
    Ð]j;¨  ã                  ó´  • S r 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Jr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Jr  SS
KJrJrJrJrJrJ r J!r!  SSK"J#r#J$r$J%r%J&r&J'r'J(r(J)r)J*r*J+r+J,r,  SSK-J.r.  SSK/J0r0  SSK1J2r2J3r3  SSK4J5r5  SSK6J7r7  SRq                  5       r9SRq                  5       r:\;" \	S5      (       d  S/\	l<        Sr=\R|                  R                  SS5      r@\@Rƒ                  5       S;   a  SrBO"\@Rƒ                  5       S;   a  SrBO\C" S\@-  5      e\	Rˆ                  =(       a    \	Rˆ                  R‹                  S5      rF\RŽ                  " S\R�                  S\R’                  4   S 9rJ\R–                  \R˜                  S!4   rM\RH                  \N\R’                  4   rO\R                   \RN                  \N      rQ\RN                  \R¤                  \      rSS,S" jrT " S# S$\U5      rV " S% S&\R®                  5      rX " S' S(\5      rY\YR´                  r[\YR¸                  r]S-S.S) jjr^S/S* jr_\`S+:X  a  \YRÃ                  5         gg)0z,A base class for a configurable application.é    )ÚannotationsN)ÚOrderedDictÚdefaultdict)Úsuppress)Údeepcopy)Ú
dictConfig)Údedent)ÚConfigurableÚSingletonConfigurable)ÚArgumentErrorÚConfigÚConfigFileNotFoundÚDeferredConfigStringÚJSONFileConfigLoaderÚKVArgParseConfigLoaderÚPyFileConfigLoader)
ÚBoolÚDictÚEnumÚInstanceÚListÚ
TraitErrorÚUnicodeÚdefaultÚobserveÚobserve_compat)ÚBunch)Únested_update)ÚindentÚwrap_paragraphsé   )Úcast_unicode)Úimport_itemzÜ
The options below are convenience aliases to configurable class-options,
as listed in the "Equivalent to" description-line of the aliases.
To see all configurable class-options for some <cmd>, use:
    <cmd> --help-all
zþ
The command-line option below sets the respective configurable class-parameter:
    --Class.parameter=value
This line is evaluated in Python, so simple expressions are allowed.
For instance, to set `C.a=[0,1,2]`, you may type this:
    --C.a='range(3)'
ÚargvÚ zp
Subcommands are launched as `{app} cmd [args]`. For information on using
subcommand 'cmd', do: `{app} cmd -h`.
Ú-TRAITLETS_APPLICATION_RAISE_CONFIG_FILE_ERROR>   Ú1ÚtrueT>   r%   Ú0ÚfalseFz�Unsupported value for environment variable: 'TRAITLETS_APPLICATION_RAISE_CONFIG_FILE_ERROR' is set to '%s' which is none of  {'0', '1', 'false', 'true', ''}.zpythonw.exeÚT.)Úboundzlogging.LoggerAdapter[t.Any]c                ó|   ^ • [         R                  " T 5      SU 4S jj5       n[        R                  " [        U5      $ )a  Method decorator for catching invalid config (Trait/ArgumentErrors) during init.

On a TraitError (generally caused by bad config), this will print the trait's
message, and exit the app.

For use on init methods, to prevent invoking excepthook on invalid input.
c                óþ   >•  T" U /UQ70 UD6$ ! [         [        4 a]  nU R                  R                  SU5        U R                  R	                  SU R
                  5        U R                  S5         S nAg S nAff = f)Nz0Bad config encountered during initialization: %szConfig at the time: %sé   )r   r   ÚlogÚfatalÚdebugÚconfigÚexit)ÚappÚargsÚkwargsÚeÚmethods       €ÚY/home/mande/repo/quber/.venv/lib/python3.13/site-packages/traitlets/config/application.pyÚinnerÚ!catch_config_error.<locals>.inners   si   ø€ ð	Ù˜#Ð/ Ò/¨Ñ/Ð/øÜœMÐ*ó 	Ø�G‰G�M‰MÐLÈaÔPØ�G‰G�M‰MÐ2°C·J±JÔ?Ø�H‰H�Q�K‰Kûð	ús   ƒ �A<ŸAA7Á7A<)r5   ÚApplicationr6   út.Anyr7   r>   Úreturnr>   )Ú	functoolsÚwrapsÚtÚcastr+   )r9   r;   s   ` r:   Úcatch_config_errorrD   j   s3   ø€ ô ‡_‚_�VÓöó ðô �6Š6”!�UÓÐó    c                  ó   • \ rS rSrSrg)ÚApplicationErroré   © N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__static_attributes__rI   rE   r:   rG   rG      s   † ÚrE   rG   c                  óL   ^ • \ rS rSrSr\R                  rSrSU 4S jjr	Sr
U =r$ )ÚLevelFormatteréƒ   zùFormatter with additional `highlevel` record

This field is empty if log level is less than highlevel_limit,
otherwise it is formatted with self.highlevel_format.

Useful for adding 'WARNING' to warning messages,
without adding 'INFO' to info, etc.
z %(levelname)s |c                ó¢   >• UR                   U R                  :¼  a  U R                  UR                  -  Ul        OSUl        [
        TU ]  U5      $ )Nr%   )ÚlevelnoÚhighlevel_limitÚhighlevel_formatÚ__dict__Ú	highlevelÚsuperÚformat)ÚselfÚrecordÚ	__class__s     €r:   rY   ÚLevelFormatter.format�   sC   ø€ Ø�>‰>˜T×1Ñ1Ó1Ø#×4Ñ4°v·±ÑFˆFÕà!ˆFÔÜ‰w‰~˜fÓ%Ð%rE   rI   )r[   zlogging.LogRecordr?   Ústr)rJ   rK   rL   rM   Ú__doc__ÚloggingÚWARNrT   rU   rY   rN   Ú__classcell__©r\   s   @r:   rP   rP   ƒ   s#   ø† ñð —l‘l€OØ)Ð÷&õ &rE   rP   c                  ó$  ^ • \ rS rSr% Sr\" S5      rS\S'   \" S5      rS\S'   \" \	5      r	S\S'   \" \
5      r
S\S	'   \" \5      rS\S
'   \r\r\" 5       rS\S'   / rS\S'    Si   SjS jjr\" S5      rS\S'   \" 5       rS\S'   \" \5      r\" S\R6                  SS9R9                  SS9r\r\" SSS9R9                  SS9r \" SSS9R9                  SS9r!SkS jr"\#" SS S!S"5      SlS# j5       r$\#" S$S%S&9SlS' j5       r%SmS( jr&\'" S$5      SnS) j5       r(\)" S*S9R9                  SS9r*S+S,0r+S\S-'   S S!\RX                  00S.4S S/S00S04S S1S00S24S3.r-S\S4'   \)" 5       r.S5\S6'   \/" S7SS89r0\" \" 5       5      r1\/" \2S90 S:S9r3\" 5       r4S;\S<'   \" S=S9R9                  SS9r5\" S>S9R9                  SS9r6\#" S15      SlS? j5       r7\#" S/5      SlS@ j5       r8SoSA jr9\#" SB5      \:SlU 4SC jj5       5       r;\<SiSpSD jj5       r=SmSE jr>SmSF jr?SmSG jr@SqSH jrASmSI jrBSqSJ jrCSmSK jrDSqSL jrESmSM jrFSqSN jrGSrSO jrHSsStSP jjrISsSrSQ jjrJSuSR jrKSmSS jrLSqST jrMSmSU jrNSqSV jrOSmSW jrP\<SiSvSX jj5       rQSwSY jrR          SxSZ jrS\TSsSyS[ jj5       rU\TSmS\ j5       rV\<SiSpS] jj5       rW\T  Sz         S{S^ jj5       rX\YS|S_ j5       rZ\< Si     S}S` jj5       r[\<SmSa j5       r\ Si   SjSb jjr]SiS~Sc jjr^SmSd jr_SS€Se jjr`SmSf jra\TSiS�Sg jj5       rbShrcU =rd$ )‚r=   é˜   z8A singleton application with full configuration support.Úapplicationzstr | Unicode[str, str | bytes]ÚnamezThis is an application.ÚdescriptionÚoption_descriptionÚkeyvalue_descriptionÚsubcommand_descriptionÚexamplesÚClassesTypeÚclassesc              #  óö   #   • Uc  U R                   n[        5       nU HV  n[        UR                  5       5       H6  n[	        U[
        5      (       d  M  XB;  d  M!  UR                  U5        Uv •  M8     MX     g7f)zòIterate through configurable classes, including configurable parents

:param classes:
    The list of classes to iterate; if not set, uses :attr:`classes`.

Children should always be after parents, and each class should only be
yielded once.
N)rn   ÚsetÚreversedÚmroÚ
issubclassr
   Úadd)rZ   rn   ÚseenÚcÚparents        r:   Ú_classes_inc_parentsÚ Application._classes_inc_parents±   s^   é € ð ‰?Ø—l‘lˆGä‹uˆÛˆAä" 1§5¡5£7Ö+�Ü˜f¤l×3Ó3¸Õ9KØ—H‘H˜VÔ$Ø ”Ló ,ò ùs   ‚AA9ÁA9ÁA9z0.0Úversionzlist[str] | List[str]r$   )r   é
   é   é   é(   é2   ÚDEBUGÚINFOra   ÚERRORÚCRITICALz#Set the log level by value or name.)Údefault_valueÚhelpT©r3   z%Y-%m-%d %H:%M:%Sz8The date format used by logging formatters for `asctime`)r…   z#[%(name)s]%(highlevel)s %(message)szThe Logging format templateÚStrDictc                óD  • SSSS[         R                  " U R                  5      SS.0SU R                  R                   SU R                  R
                   3U R                  U R                  S.0U R                  R
                  SS/S	.0S
S.n[        (       a  US	 US	 U$ )aO  Return the base logging configuration.

The default is to log to stderr using a StreamHandler, if no default
handler already exists.

The log handler level starts at logging.WARN, but this can be adjusted
by setting the ``log_level`` attribute.

The ``logging_config`` trait is merged into this allowing for finer
control of logging.

r/   Úconsolezlogging.StreamHandlerzext://sys.stderr)ÚclassÚ	formatterÚlevelÚstreamÚ.)rŠ   rY   Údatefmtr€   )rŒ   ÚhandlersF)rz   r�   Ú
formattersÚloggersÚdisable_existing_loggersr�   r’   )
r`   ÚgetLevelNameÚ	log_levelÚ_log_formatter_clsrK   rJ   Ú
log_formatÚlog_datefmtr\   Ú
IS_PYTHONW©rZ   r3   s     r:   Úget_default_logging_configÚ&Application.get_default_logging_configã   sÆ   € ð àØ4Ø!*Ü$×1Ò1°$·.±.ÓAØ0ñ	ðð à×2Ñ2×=Ñ=Ð>Ø˜D×3Ñ3×<Ñ<Ð=ð?ð #Ÿo™oØ#×/Ñ/ñð	ð —‘×'Ñ'Ø$Ø!* ñ*ðð ).ñ5
ˆ÷: Š:ð �zÐ"Ø�yÐ!àˆrE   r˜   r—   r•   Úlogging_configc                óÂ   • U R                   n[        U[        5      (       a.  [        R                  " [
        [        [        U5      5      U l         U R                  5         g ©N)	r•   Ú
isinstancer^   rB   rC   ÚintÚgetattrr`   Ú_configure_logging)rZ   Úchanger•   s      r:   Ú_observe_logging_changeÚ#Application._observe_logging_change  s?   € ð —N‘Nˆ	Ü�i¤×%Ñ%ÜŸVšV¤C¬´¸)Ó)DÓEˆDŒNØ×ÑÕ!rE   r0   r   )Útypec                ó$   • U R                  5         g rŸ   )r£   ©rZ   r¤   s     r:   Ú_observe_logging_defaultÚ$Application._observe_logging_default  s   € à×ÑÕ!rE   c                ó„   • U R                  5       n[        XR                  =(       d    0 5        [        U5        SU l        g )NT)r›   r   r�   r   Ú_logging_configuredrš   s     r:   r£   ÚApplication._configure_logging"  s3   € Ø×0Ñ0Ó2ˆÜ�f×1Ñ1×7°RÔ8Ü�6Ôà#'ˆÕ rE   c                óâ   • [         R                  " U R                  R                  5      nSUl        UnUb8  UR
                  (       a  U$ UR                  (       d   U$ UR                  nUb  M8  U$ )z#Start logging for this application.F)r`   Ú	getLoggerr\   rJ   Ú	propagater�   rw   )rZ   r0   Ú_logs      r:   Ú_log_defaultÚApplication._log_default)  se   € ô ×Ò §¡× 7Ñ 7Ó8ˆØˆŒØˆØÑØ�}�}Ø�
Ø—>—>Øàˆ
ð —;‘;ˆDð Óð ˆ
rE   a!  
            Configure additional log handlers.

            The default stderr logs handler is configured by the
            log_level, log_datefmt and log_format settings.

            This configuration can be used to configure additional handlers
            (e.g. to output the log to a file) or for finer control over the
            default handlers.

            If provided this should be a logging configuration dictionary, for
            more information see:
            https://docs.python.org/3/library/logging.config.html#logging-config-dictschema

            This dictionary is merged with the base logging configuration which
            defines the following:

            * A logging formatter intended for interactive use called
              ``console``.
            * A logging handler that writes to stderr called
              ``console`` which uses the formatter ``console``.
            * A logger with the name of this application set to ``DEBUG``
              level.

            This example adds a new handler that writes to a file:

            .. code-block:: python

               c.Application.logging_config = {
                   "handlers": {
                       "file": {
                           "class": "logging.FileHandler",
                           "level": "DEBUG",
                           "filename": "<path/to/file>",
                       }
                   },
                   "loggers": {
                       "<application-name>": {
                           "level": "DEBUG",
                           # NOTE: if you don't list the default "console"
                           # handler here then it will be disabled
                           "handlers": ["console", "file"],
                       },
                   },
               }

        z	log-levelzApplication.log_levelÚaliasesz5Set log-level to debug, for the most verbose logging.Úshow_configz<Show the application's configuration (human-readable format)Úshow_config_jsonz2Show the application's configuration (json format))r2   zshow-configzshow-config-jsonÚflagsz#dict[str, t.Any] | Dict[str, t.Any]Úsubcommandsz(traitlets.config.application.Application)Ú
allow_nonerI   zÁThe subset of our configuration that came from the command-line

        We re-load this configuration after loading config files,
        to ensure that it maintains highest priority.
        z	List[str]Ú_loaded_config_fileszAInstead of starting the Application, dump configuration to stdoutzKInstead of starting the Application, dump configuration to stdout (as JSON)c                ó&   • UR                   U l        g rŸ   )Únewr¶   r©   s     r:   Ú_show_config_json_changedÚ%Application._show_config_json_changed°  s   € à!Ÿ:™:ˆÕrE   c                ól   • UR                   (       a#  U R                  U l        U R                  U l        g g rŸ   )r½   ÚstartÚ_save_startÚstart_show_configr©   s     r:   Ú_show_config_changedÚ Application._show_config_changed´  s'   € à�:�:Ø#Ÿz™zˆDÔØ×/Ñ/ˆD�Jð rE   c                ó  • [         R                  " U 40 UD6  U R                  nX R                  ;  aU  U R                  UR                  L a  U/U R                  QU l        g U R                  R	                  SU R                  5        g g )Nr   )r   Ú__init__r\   rn   Úinsert)rZ   r7   Úclss      r:   rÇ   ÚApplication.__init__º  sj   € Ü×&Ò& tÑ6¨vÒ6ð �n‰nˆØ—l‘lÓ"Ø�|‰|˜sŸ{™{Ò*à #Ð3 d§l¡lÐ3�•à—‘×#Ñ# A t§~¡~Õ6ð #rE   r3   c                óp   >• [         TU ]  U5        U R                  R                  SUR                  5        g )NzConfig changed: %r)rX   Ú_config_changedr0   r2   r½   )rZ   r¤   r\   s     €r:   rÌ   ÚApplication._config_changedÆ  s)   ø€ ô 	‰Ñ Ô'Ø�‰�‰Ð+¨V¯Z©ZÕ8rE   c                ó&   • U R                  U5        g)z=Do the basic steps to configure me.

Override in subclasses.
N)Úparse_command_line)rZ   r$   s     r:   Ú
initializeÚApplication.initializeÌ  s   € ð 	×Ñ Õ%rE   c                ó”   • U R                   b;  [        U R                   [        5      (       d   eU R                   R                  5       $ g)z1Start the app mainloop.

Override in subclasses.
N)Úsubappr    r=   rÁ   ©rZ   s    r:   rÁ   ÚApplication.startÔ  s=   € ð
 �;‰;Ñ"Ü˜dŸk™k¬;×7Ñ7Ð7Ð7Ø—;‘;×$Ñ$Ó&Ð&ð #rE   c                ó&  • U R                   R                  5       nU R                  R                  5        HG  nUR                  U;   d  M  XR                     nUR                  SS5        UR                  SS5        MI     U R                  (       aJ  [        R                  " U[        R                  SS[        S9  [        R                  R                  S5        gU R                  (       a6  [        S5        U R                   H  n[        S	U-   5        M     [        5         [        U5       Ha  nX   nU(       d  M  [        U5        [!        S
SS9n[        U5       H-  nXh   n	[        SU S["        R$                  " U	40 UD6 35        M/     Mc     g)z,start function used when show_config is Truer¶   Nr·   r/   T)r   Ú	sort_keysr   Ú
zLoaded config files:z  é   )r   Úcompactz  .z = )r3   Úcopyr\   rr   rJ   Úpopr·   ÚjsonÚdumpÚsysÚstdoutÚreprÚwriter»   ÚprintÚsortedÚdictÚpprintÚpformat)
rZ   r3   rÉ   Ú
cls_configÚfÚ	classnameÚclass_configÚpformat_kwargsÚ	traitnameÚvalues
             r:   rÃ   ÚApplication.start_show_configÝ  s5  € à—‘×!Ñ!Ó#ˆà—>‘>×%Ñ%Ö'ˆCØ�|‰|˜vÕ%Ø#§L¡LÑ1�
Ø—‘˜}¨dÔ3Ø—‘Ð1°4Ö8ñ	 (ð × × Ü�IŠI�fœcŸj™j°¸dÌDÒQä�J‰J×Ñ˜TÔ"Øà×$×$ÜÐ(Ô)Ø×.Ô.�Ü�d˜Q‘h–ñ /äŒGä žˆIØ!Ñ,ˆLÞÙÜ�)ÔÜ&*°!¸TÑ&BˆNä# LÖ1�	Ø$Ñ/�Ü˜˜I˜; c¬&¯.ª.¸Ñ*QÀ.Ñ*QÐ)RÐSÖTó 2ò (rE   c                óT   • [        SR                  U R                  5       5      5        g)z"Print the alias parts of the help.rØ   N)rã   ÚjoinÚemit_alias_helprÔ   s    r:   Úprint_alias_helpÚApplication.print_alias_helpþ  s   € äˆd�i‰i˜×,Ñ,Ó.Ó/Õ0rE   c              #  óh  #   • U R                   (       d  g0 nU R                   HU  nUR                  5       SS  H;  n[        R                  " [        R
                  [           U5      XR                  '   M=     MW     U R                   R                  5        Hæ  u  pE [        U[        5      (       a  Uu  pVOSnUR                  S5      SS u  pxUS-   U-   nX   nUR                  SS9U   n	UR                  X–S9R                  5       n
[        U[        5      (       d  U4n[        U[         S9nS	R#                  S
 U 5       5      nU
S   R%                  SU-   U5      U
S'   U
 Sh  v•N   ['        SU-  5      v •  Mè     g N! [(         a"  nU R*                  R-                  SXK5        e SnAff = f7f)z+Yield the lines for alias part of the help.NéýÿÿÿrŽ   éþÿÿÿTr†   )Úhelptext©Úkeyú, c              3  óN   #   • U  H  n[        U5      S :”  a  SOSU-  v •  M     g7f©r/   z--%sz-%sN©Úlen©Ú.0Úms     r:   Ú	<genexpr>Ú.Application.emit_alias_help.<locals>.<genexpr>  ó#   é € Ð!WÒQVÈA¬S°«V°a«Z¡6¸UÀaÖ"GÒQVùó   ‚#%r   ú--zEquivalent to: [--%s]z7Failed collecting help-message for alias %r, due to: %s)rµ   rn   rr   rB   rC   ÚTyper
   rJ   Úitemsr    ÚtupleÚsplitÚclass_traitsÚclass_get_trait_helpÚ
splitlinesrä   rÿ   rñ   Úreplacer   Ú	Exceptionr0   Úerror)rZ   Ú	classdictrÉ   rv   ÚaliasÚlongnameÚfhelprê   rí   ÚtraitÚfhelp_linesÚexs               r:   rò   ÚApplication.emit_alias_help  s�  é € à�|�|Øà35ˆ	Ø—<”<ˆCà—W‘W“Y˜s “^�Ü()¯ª¬q¯v©v´lÑ/CÀQÓ(G�	Ÿ*™*Ó%ó $ñ  ð  $Ÿ|™|×1Ñ1Ö3‰OˆEðÜ˜h¬×.Ñ.Ø&.‘O�H˜eà �EØ'/§~¡~°cÓ':¸2¸3Ð'?Ñ$�	Ø$ s™?¨YÑ6�ØÑ*�à×(Ñ(°Ð(Ð5°iÑ@�Ø!×6Ñ6°uÐ6ÐM×XÑXÓZ�ä! %¬×/Ñ/Ø"˜H�EÜ˜u¬#Ñ.�ØŸ	™	Ñ!WÑQVÓ!WÓW�ð "-¨Q¡×!7Ñ!7¸¸x¹ÈÓ!O�˜A‘Ø&×&Ð&ÜÐ4°xÑ?Ó@Ô@ò+  4ñ( 'øäó Ø—‘—‘ÐXÐZ_ÔdØûðüs=   ‚BF2ÂCFÅ'FÅ(FÅ<F2ÆFÆ
F/ÆF*Æ*F/Æ/F2c                óT   • [        SR                  U R                  5       5      5        g)z Print the flag part of the help.rØ   N)rã   rñ   Úemit_flag_helprÔ   s    r:   Úprint_flag_helpÚApplication.print_flag_help(  s   € äˆd�i‰i˜×+Ñ+Ó-Ó.Õ/rE   c              #  ó*  #   • U R                   (       d  gU R                   R                  5        H°  u  nu  p# [        U[        5      (       d  U4n[	        U[
        S9nSR                  S U 5       5      nUv •  [        [        UR                  5       5      5      v •  SR                  S UR                  5        5       5      nSU-  n[        [        U5      5      v •  M²     g! [         a"  nU R                  R                  SX5        e SnAff = f7f)	z.Yield the lines for the flag part of the help.Nrù   rû   c              3  óN   #   • U  H  n[        U5      S :”  a  SOSU-  v •  M     g7frý   rþ   r   s     r:   r  Ú-Application.emit_flag_help.<locals>.<genexpr>6  r  r  Ú c              3  óp   #   • U  H,  u  pUR                  5         H  u  p4S U SU SU 3v •  M     M.     g7f)r  rŽ   Ú=N)r	  )r  ÚclnameÚ
props_dictÚpropÚvals        r:   r  r   9  sE   é € ð $â.9Ñ*˜Ø%/×%5Ñ%5×%7™	˜ð ˜˜  $  q¨¨Õ.á%7ñ /Ú.9ùs   ‚46zEquivalent to: [%s]z6Failed collecting help-message for flag %r, due to: %s)r¸   r	  r    r
  rä   rÿ   rñ   r   r	   Ústripr  r0   r  )rZ   r¸   Úcfgr  Úcfg_listÚcfg_txtr  s          r:   r  ÚApplication.emit_flag_help,  sæ   é € à�z�zØà#'§:¡:×#3Ñ#3Ö#5ÑˆE‘<�CðÜ! %¬×/Ñ/Ø"˜H�EÜ˜u¬#Ñ.�ØŸ	™	Ñ!WÑQVÓ!WÓW�Ø’ÜœV E§K¡K£MÓ2Ó3Ò3ØŸ8™8ñ $à.1¯i©i¬kó$ó �ð
 0°(Ñ:�ÜœV G›_Ó-Ô-ò $6øô ó Ø—‘—‘ÐWÐY^ÔcØûðüs)   ‚5D¸B'C$ÃDÃ$
DÃ.DÄDÄDc                óT   • [        SR                  U R                  5       5      5        g)z#Print the options part of the help.rØ   N)rã   rñ   Úemit_options_helprÔ   s    r:   Úprint_optionsÚApplication.print_optionsD  s   € äˆd�i‰i˜×.Ñ.Ó0Ó1Õ2rE   c              #  ó6  #   • U R                   (       d  U R                  (       d  gSnUv •  S[        U5      -  v •  [        U R                  5       H  nUv •  Sv •  M     U R                  5        Sh  v•N   U R                  5        Sh  v•N   Sv •  g N! N7f)z1Yield the lines for the options part of the help.NÚOptionsr#  r%   )r¸   rµ   rÿ   r    ri   r  rò   )rZ   ÚheaderÚps      r:   r.  ÚApplication.emit_options_helpH  s€   é € à�z�z $§,§,ØØˆØŠØ”C˜“KÑÒÜ  ×!8Ñ!8Ö9ˆAØŠGØŒHñ :ð ×&Ñ&Ó(×(Ð(Ø×'Ñ'Ó)×)Ð)Ø‹ñ 	)Ù)ùs$   ‚A1BÁ3BÁ4BÂBÂ
BÂBc                óT   • [        SR                  U R                  5       5      5        g)z&Print the subcommand part of the help.rØ   N)rã   rñ   Úemit_subcommands_helprÔ   s    r:   Úprint_subcommandsÚApplication.print_subcommandsW  s   € äˆd�i‰i˜×2Ñ2Ó4Ó5Õ6rE   c              #  óˆ  #   • U R                   (       d  gSnUv •  S[        U5      -  v •  [        U R                  R	                  U R
                  S95       H  nUv •  Sv •  M     U R                   R                  5        H9  u  nu  pEUv •  U(       d  M  [        [        UR                  5       5      5      v •  M;     Sv •  g7f)z4Yield the lines for the subcommand part of the help.NÚSubcommandsr#  )r5   r%   )
r¹   rÿ   r    rk   rY   rg   r	  r   r	   r(  )rZ   r3  r4  ÚsubcÚ_r…   s         r:   r7  Ú!Application.emit_subcommands_help[  s¤   é € à××ØàˆØŠØ”C˜“KÑÒÜ  ×!<Ñ!<×!CÑ!CÈÏ	É	Ð!CÐ!RÖSˆAØŠGØŒHñ Tð  $×/Ñ/×5Ñ5Ö7‰OˆD‘)�1ØŠJßˆtÜœV D§J¡J£LÓ1Ó2Ô2ñ  8ð ‹ùs   ‚BCÂ-Cc              #  ó,   #   • U(       d	  Sv •  Sv •  gg7f)zjYield the very bottom lines of the help message.

If classes=False (the default), print `--help-all` msg.
z5To see all available configurables, use `--help-all`.r%   NrI   ©rZ   rn   s     r:   Úemit_help_epilogueÚApplication.emit_help_epiloguel  s   é € ö
 ØIÒIØ‹Hð ùs   ‚c                óR   • [        SR                  U R                  US95      5        g)z�Print the help for each Configurable class in self.classes.

If classes=False (the default), only flags and aliases are printed.
rØ   ©rn   N)rã   rñ   Ú	emit_helpr@  s     r:   Ú
print_helpÚApplication.print_helpu  s    € ô
 	ˆd�i‰i˜Ÿ™¨w˜Ð7Ó8Õ9rE   c              #  óÜ  #   • U R                  5        Sh  v•N   U R                  5        Sh  v•N   U R                  5        Sh  v•N   U(       a^  U R                  5       nUb,  Sv •  Sv •  [	        U R
                  5       H  nUv •  Sv •  M     U H  nUR                  5       v •  Sv •  M     U R                  5        Sh  v•N   U R                  U5       Sh  v•N   g NË Nµ NŸ N$ N7f)z‡Yield the help-lines for each Configurable class in self.classes.

If classes=False (the default), only flags and aliases are printed.
NzClass optionsz=============r%   )	Úemit_descriptionr7  r.  Ú_classes_with_config_traitsr    rj   Úclass_get_helpÚemit_examplesrA  )rZ   rn   Úhelp_classesr4  rÉ   s        r:   rE  ÚApplication.emit_help|  sÛ   é € ð
 ×(Ñ(Ó*×*Ð*Ø×-Ñ-Ó/×/Ð/Ø×)Ñ)Ó+×+Ð+æØ×;Ñ;Ó=ˆLØÑ'Ø%Ò%Ø%Ò%Ü(¨×)BÑ)BÖC�AØ’GØ”Hñ Dó $�Ø×(Ñ(Ó*Ò*Ø”ñ $ð ×%Ñ%Ó'×'Ð'à×*Ñ*¨7Ó3×3Ñ3ñ% 	+Ù/Ù+ñ 	(á3ùsV   ‚C,–C"—C,®C$¯C,ÁC&ÁA<C,ÃC(ÃC,ÃC*ÃC,Ã$C,Ã&C,Ã(C,Ã*C,c                óN   • SR                  S U R                  5        5       5      $ )zgGenerate rST format documentation for the config options this application

Returns a multiline string.
rØ   c              3  ó@   #   • U  H  oR                  5       v •  M     g 7frŸ   )Úclass_config_rst_doc)r  rv   s     r:   r  Ú6Application.document_config_options.<locals>.<genexpr>š  s   é € ÐWÒ;V°a×/Ñ/×1Ð1Ò;Vùs   ‚)rñ   rx   rÔ   s    r:   Údocument_config_optionsÚ#Application.document_config_options•  s"   € ð
 �y‰yÑW¸4×;TÑ;TÔ;VÓWÓWÐWrE   c                óT   • [        SR                  U R                  5       5      5        g)z"Print the application description.rØ   N)rã   rñ   rI  rÔ   s    r:   Úprint_descriptionÚApplication.print_descriptionœ  s   € äˆd�i‰i˜×-Ñ-Ó/Ó0Õ1rE   c              #  óŒ   #   • [        U R                  =(       d    U R                  =(       d    S5       H  nUv •  Sv •  M     g7f)z-Yield lines with the application description.r%   N)r    rh   r_   )rZ   r4  s     r:   rI  ÚApplication.emit_description   s3   é € ä  ×!1Ñ!1×!G°T·\±\×!GÀRÖHˆAØŠGØŒHò Iùs   ‚AAc                óT   • [        SR                  U R                  5       5      5        g)z1Print usage and examples (see `emit_examples()`).rØ   N)rã   rñ   rL  rÔ   s    r:   Úprint_examplesÚApplication.print_examples¦  s   € äˆd�i‰i˜×*Ñ*Ó,Ó-Õ.rE   c              #  ó¬   #   • U R                   (       a?  Sv •  Sv •  Sv •  [        [        U R                   R                  5       5      5      v •  Sv •  gg7f)z¤Yield lines with the usage and examples.

This usage string goes at the end of the command line help string
and should contain examples of the application's usage.
ÚExamplesz--------r%   N)rl   r   r	   r(  rÔ   s    r:   rL  ÚApplication.emit_examplesª  sF   é € ð �=�=ØÒØÒØŠHÜœ §¡× 3Ñ 3Ó 5Ó6Ó7Ò7Ø‹Hð ùs   ‚AAc                ó.   • [        U R                  5        g)zPrint the version string.N)rã   rz   rÔ   s    r:   Úprint_versionÚApplication.print_version·  s   € äˆd�l‰lÕrE   c                óÌ  • U R                   R                  U5      nUc   eUu  pE[        U[        5      (       a  [	        U5      n[        U[
        5      (       aD  [        U[        5      (       a/  U R                  R                  5         UR                  U S9U l        O,[        U5      (       a  U" U 5      U l        O[        SU-  5      eU R                  R                  U5        g)z"Initialize a subcommand with argv.N)rw   z%Invalid mappings for subcommand '%s'!)r¹   Úgetr    r^   r#   r§   rs   r=   r\   Úclear_instanceÚinstancerÓ   ÚcallableÚAssertionErrorrÐ   )rZ   r<  r$   r'  rÓ   r=  s         r:   Úinitialize_subcommandÚ!Application.initialize_subcommand»  sº   € ð ×Ñ×"Ñ" 4Ó(ˆØ‰ÐˆØ‰	ˆä�fœc×"Ñ"Ü  Ó(ˆFô �fœd×#Ñ#¬
°6¼;×(GÑ(Gà�N‰N×)Ñ)Ô+à Ÿ/™/°˜/Ð6ˆD�KÜ�f×Ñá  ›,ˆD�Kä Ð!HÈ4Ñ!OÓPÐPð 	�‰×Ñ˜tÕ$rE   c                óZ  • [        [        5      nU R                   HF  nUR                  nUR	                  5       SS  H   nXR                     R                  U5        M"     MH     0 nU R                  R                  5        H  u  pg[        U[        5      (       a  Uu  pxUR                  SS5      u  p)X   n
[        U
5      S:X  a  U
S   n[        U[        5      (       d  U4nU H  nSR                  X)/5      X['   M     M�     0 nU R                  R                  5        H…  u  nu  pï0 nUR                  5        H?  u  nnX   n
[        U
5      S:X  a  U
S   nUU;   a  UU   R                  U5        M:  UUU'   MA     [        U[        5      (       d  U4nU H
  nUU4UU'   M     M‡     XÅ4$ )a¬  Flatten flags and aliases for loaders, so cl-args override as expected.

This prevents issues such as an alias pointing to InteractiveShell,
but a config file setting the same trait in TerminalInteraciveShell
getting inappropriate priority over the command-line arg.
Also, loaders expect ``(key: longname)`` and not ``key: (longname, help)`` items.

Only aliases with exactly one descendent in the class list
will be promoted.

r/   rö   rŽ   r   )r   Úlistrn   rJ   rr   Úappendrµ   r	  r    r
  r  rÿ   rñ   r¸   Úupdate)rZ   Úmro_treerÉ   Úclsnamerw   rµ   r  r  r=  r  ÚchildrenÚalr¸   rú   Úflagdictr…   ÚnewflagÚsubdictÚks                      r:   Úflatten_flagsÚApplication.flatten_flagsÔ  s—  € ô œtÓ$ˆØ—<”<ˆCØ—l‘lˆGØŸ'™'›) A b›/�àŸ™Ñ)×0Ñ0°Ö9ó *ñ  ð #%ˆØ#Ÿ|™|×1Ñ1Ö3‰OˆEÜ˜(¤E×*Ñ*Ø&‘�Ø!Ÿ™¨¨QÓ/‰JˆCØ‘}ˆHÜ�8‹} Ó!à˜q‘k�Ü˜g¤u×-Ñ-Ø˜�Û�Ø!Ÿh™h¨ |Ó4�“ó ñ  4ð ˆØ%)§Z¡Z×%5Ñ%5Ö%7Ñ!ˆCÑ!�(Ø*,ˆGØ (§¡Ö 0‘��WØ#™=�ä�x“= AÓ%Ø" 1™+�Cà˜'“>Ø˜C‘L×'Ñ'¨Ö0à#*�G˜C“Lñ !1ô ˜c¤5×)Ñ)Ø�f�Û�Ø# T˜?��a“ó ñ &8ð" ˆ~ÐrE   c           	     óB   • [        XX4U R                  U R                  S9$ )N)rn   r0   r¹   )r   r0   r¹   )rZ   r$   rµ   r¸   rn   s        r:   Ú_create_loaderÚApplication._create_loader  s$   € ô &Ø˜5°t·x±xÈT×M]ÑM]ñ
ð 	
rE   c                óÌ   • U(       a)  S[         R                  ;   a   SSKJn  U" 5       nUc   eU$ [        R                  $ ! [        [
        4 a     [        R                  $ f = f)a7  Get `sys.argv` or equivalent from `argcomplete`

`argcomplete`'s strategy is to call the python script with no arguments,
so ``len(sys.argv) == 1``, and run until the `ArgumentParser` is constructed
and determine what completions are available.

On the other hand, `traitlet`'s subcommand-handling strategy is to check
``sys.argv[1]`` and see if it matches a subcommand, and if so then dynamically
load the subcommand app and initialize it with ``sys.argv[1:]``.

This helper method helps to take the current tokens for `argcomplete` and pass
them through as `argv`.
Ú_ARGCOMPLETEr   )Úget_argcomplete_cwords)ÚosÚenvironÚ#traitlets.config.argcomplete_configr~  ÚImportErrorÚModuleNotFoundErrorrß   r$   )rÉ   Úcheck_argcompleter~  Úcwordss       r:   Ú_get_sys_argvÚApplication._get_sys_argv  sa   € ö  ´2·:±:Ó!=ðÝVá/Ó1�ØÑ)Ð)Ð)Ø�ô �x‰xˆøô  Ô!4Ð5ó ØÜ�x‰xˆðús   �A ÁA#Á"A#c                óv   • S[         R                  ;  a  g SSKJn  U" 5         g! [        [
        4 a     gf = f)a¯  Helper for `argcomplete` to recognize `traitlets` subcommands

`argcomplete` does not know that `traitlets` has already consumed subcommands,
as it only "sees" the final `argparse.ArgumentParser` that is constructed.
(Indeed `KVArgParseConfigLoader` does not get passed subcommands at all currently.)
We explicitly manipulate the environment variables used internally by `argcomplete`
to get it to skip over the subcommand tokens.
r}  Nr   )Úincrement_argcomplete_index)r  r€  r�  r‰  r‚  rƒ  )rÉ   r‰  s     r:   Ú"_handle_argcomplete_for_subcommandÚ.Application._handle_argcomplete_for_subcommand4  s9   € ð ¤§¡Ó+Øð	ÝWá'Õ)øÜÔ0Ð1ó 	Ùð	ús   —% ¥8·8c                ó>  ^	• [        U[        5      (       a   eUc%  U R                  [        U R                  5      S9SS nU Vs/ s H  n[        U5      PM     snU l        U(       a  US   S:X  a	  USS S/-   nU R                  (       ad  [        U5      S:”  aU  US   USS pC[        R                  " SU5      (       a0  X0R                  ;   a!  U R                  5         U R                  X45      $  USUR                  S5       m	[        U	4S	 jS
 5       5      (       a%  U R                  ST	;   5        U R!                  S5        ST	;   d  ST	;   a!  U R#                  5         U R!                  S5        U R%                  5       u  pV['        U R)                  5       5      nU R+                  XXWS9n [-        UR/                  5       5      U l        U R5                  U R0                  5        UR6                  U l        gs  snf ! [         a    Um	 GNf = f! [2         a    e f = f)z!Parse the command line arguments.N)r„  r/   r   r…   ú-hz^\w(\-?\w)*$r  c              3  ó,   >#   • U  H	  oT;   v •  M     g 7frŸ   rI   )r  ÚxÚinterpreted_argvs     €r:   r  Ú1Application.parse_command_line.<locals>.<genexpr>e  s   øé € ÐMÒ.L¨Ð$Ö$Ò.Lùs   ƒ)r�  ú
--help-allz--helpr’  z	--versionz-VrD  )r    r^   r†  Úboolr¹   r"   r$   rÿ   ÚreÚmatchrŠ  ri  ÚindexÚ
ValueErrorÚanyrF  r4   ra  rw  rl  rJ  rz  r   Úload_configÚ
cli_configÚ
SystemExitÚupdate_configÚ
extra_args)
rZ   r$   Úargr<  Úsubargvr¸   rµ   rn   Úloaderr�  s
            @r:   rÏ   ÚApplication.parse_command_lineH  sø  ø€ ô ˜d¤C×(Ñ(Ð(Ð(Ø‰<Ø×%Ñ%¼¸T×=MÑ=MÓ8NÐ%ÐOÐPQÐPRÐSˆDÙ26Ó7²$¨3”\ #Ö&±$Ñ7ˆŒ	æ�D˜‘G˜vÓ%à˜˜�8˜t˜fÑ$ˆDà××¤ D£	¨A£à  ™G T¨!¨" X�'Ü�xŠx˜¨×.Ñ.°4×;KÑ;KÓ3Kà×7Ñ7Ô9Ø×1Ñ1°$Ó@Ð@ð	$Ø#Ð$6 d§j¡j°Ó&6Ð7Ðô ÔMÑ.LÓM×MÑMØ�O‰O˜LÐ,<Ñ<Ô=Ø�I‰I�aŒLàÐ*Ó*¨dÐ6FÓ.FØ×ÑÔ Ø�I‰I�aŒLð ×+Ñ+Ó-‰ˆÜ�t×7Ñ7Ó9Ó:ˆØ×$Ñ$ T°EÐ$ÐKˆð	Ü& v×'9Ñ'9Ó';Ó<ˆDŒOð
 	×Ñ˜4Ÿ?™?Ô+à ×+Ñ+ˆ�ùòW 8øô( ó 	$Ø#Óð	$ûô" ó 	ð ð	ús$   ÁG8Ã1G= Æ-H Ç=HÈHÈHc              #  ó  #   • [         R                  R                  U5      (       a  S/n[        U[        5      (       d  Uc  U/n[        U5       GH]  nU R                  US-   XSS9nU(       a.  UR                  SX=(       d    [         R                  " 5       5        U R                  US-   XSS9n/ n/ n	Xg4 Hó  n
Sn U
R                  5       nU(       a  UR                  SU
R                  5        U(       d  MB  [        X˜5       Hg  u  pÍUR!                  U5      nU(       d  M  U(       d  M(  UR#                  S
R%                  UU
R                  [&        R(                  " USS95      5        Mi     XºR                  4v •  UR+                  U5        U	R+                  U
R                  5        Mõ     GM`     g! [         a     NÐ[         a9    U
R                  =(       d    UnU(       a  e U(       a  UR                  SUSS	9   GNf = f7f)zULoad config files (py,json) by filename and path.

yield each config object in turn.
Nz.py)Úpathr0   zLooking for %s in %sz.jsonzLoaded config file: %sz&Exception while loading config file %sT)Úexc_infozMCollisions detected in {0} and {1} config files. {1} has higher priority: {2}r!   )r   )r  r£  Úisabsr    r^   rq   Úpython_config_loader_classr2   ÚgetcwdÚjson_config_loader_classr™  Úfull_filenamer   r  r  ÚzipÚ
collisionsÚwarningrY   rÝ   Údumpsrm  )rÉ   Úbasefilenamer£  r0   Úraise_config_file_errorsÚcurrentÚpyloaderÚ
jsonloaderÚloadedÚ	filenamesr   r3   ÚfilenameÚearlier_configr«  s                  r:   Ú_load_config_filesÚApplication._load_config_files{  sË  é € ô �7‰7�=‰=˜×&Ñ&Ø�6ˆDÜ�dœC× Ñ  D¡LØ�6ˆDÜ —~ˆGà×5Ñ5°lÀUÑ6JÐQXÐ5ÐbˆHÞØ—	‘	Ð0°,×@VÌ2Ï9Ê9Ë;ÔWØ×5Ñ5°lÀWÑ6LÐSZÐ5ÐdˆJØ"$ˆFØ#%ˆIØ#Ó0�Ø�ðRØ#×/Ñ/Ó1�Fö ØŸ	™	Ð":¸F×<PÑ<PÔQß�6Ü47¸	Ö4JÑ0˜Ø%3×%>Ñ%>¸vÓ%F˜
ß%˜:¯#¨#ØŸK™Kð!@ß@FÁØ$,Ø$*×$8Ñ$8Ü$(§J¢J¨zÀ!Ñ$DóA"öñ 5Kð "×#7Ñ#7Ð8Ò8Ø—M‘M &Ô)Ø×$Ñ$ V×%9Ñ%9Ö:ôA 1ò &øô *ó ÙÜ ó eð  &×3Ñ3×C°|�Hæ/ØÞØŸ	™	Ð"JÈHÐ_c˜	ÑdúðeüsI   ‚B9HÂ<F3Ã(HÃ8&HÄ"HÄ+BHÆ3
HÆ=HÆ?>HÇ=HÈ HÈHc                ó    • U R                   SS $ )z$Currently loaded configuration filesN)r»   rÔ   s    r:   Úloaded_config_filesÚApplication.loaded_config_filesµ  s   € ð ×(Ñ(©Ð+Ð+rE   c                óŠ  • [         R                  R                  U5      u  p[        5       nU R	                  UUU R
                  U R                  S9 HB  u  pVUR                  U5        X`R                  ;  d  M'  U R                  R                  U5        MD     UR                  U R                  5        U R                  U5        g)z'Load config files by filename and path.)r£  r0   r¯  N)r  r£  Úsplitextr   r·  r0   r¯  Úmerger»   rm  rš  rœ  )rZ   rµ  r£  ÚextÚ
new_configr3   Úfnames          r:   Úload_config_fileÚApplication.load_config_fileº  s¥   € ô
 Ÿ™×(Ñ(¨Ó2‰ˆÜ“Xˆ
Ø!×4Ñ4ØØØ—‘Ø%)×%BÑ%Bð	 5ó 
‰MˆFð ×Ñ˜VÔ$à×6Ñ6Õ6à×)Ñ)×0Ñ0°Ö7ñ
ð 	×Ñ˜Ÿ™Ô)Ø×Ñ˜:Õ&rE   c                ó"  • U R                   R                  5       R                  SS5      n[        5       nU R                  R                  SU5        [        R                  R                  5        Hq  u  p4UR                  U5      (       d  M  U R                  R                  SX45        UR                  S5      GtpVnUnU H  n	X‰   nM	     [        X‡[        U5      5        Ms     UR                  U R                  5        U R                  U5        g)z!Load config files by environment.Ú-r=  z1Looping through config variables with prefix "%s"zSeeing environ "%s"="%s"Ú__N)rg   Úupperr  r   r0   r2   r  r€  r	  Ú
startswithr  Úsetattrr   r¾  rš  rœ  )
rZ   ÚPREFIXrÀ  rv  Úvr=  r£  rú   Úsectionr4  s
             r:   Úload_config_environÚApplication.load_config_environÐ  sÑ   € ð —‘—‘Ó"×*Ñ*¨3°Ó4ˆÜ“Xˆ
à�‰�‰ÐJÈFÔSä—J‘J×$Ñ$Ö&‰DˆAØ�|‰|˜F×#Ó#Ø—‘—‘Ð9¸1Ô@ð !"§¡¨£‘�˜#Ø$�Û�AØ%™j’Gñ ä˜Ô&:¸1Ó&=Ö>ñ 'ð 	×Ñ˜Ÿ™Ô)Ø×Ñ˜:Õ&rE   c              #  óF  ^^#   • Uc  U R                   n[        S U R                  U5       5       5      mSU4S jjm TR                  5       n[        U4S jTR	                  5        5       5      mTU:X  a  OM<  TR	                  5        H  u  p4U(       d  M  Uv •  M     g7f)aƒ  
Yields only classes with configurable traits, and their subclasses.

:param classes:
    The list of classes to iterate; if not set, uses :attr:`classes`.

Thus, produced sample config-file will contain all classes
on which a trait-value may be overridden:

- either on the class owning the trait,
- or on its subclasses, even if those subclasses do not define
  any traits themselves.
Nc              3  óV   #   • U  H  nU[        UR                  S S95      4v •  M!     g7f)Tr†   N)r“  Úclass_own_traits)r  rÉ   s     r:   r  Ú:Application._classes_with_config_traits.<locals>.<genexpr>ù  s/   é € ð $
â9�ð ”$�s×+Ñ+°4Ð+Ð8Ó9Õ:Ú9ùs   ‚')c                óB   >• [        U4S jU R                   5       5      $ )Nc              3  óD   >#   • U  H  oT;   =(       a    TU   v •  M     g 7frŸ   rI   )r  ÚbÚcls_to_configs     €r:   r  ÚZApplication._classes_with_config_traits.<locals>.is_any_parent_included.<locals>.<genexpr>ÿ  s!   øé € ÐVÊÀ1˜MÑ)×>¨m¸AÑ.>Ô>Êùs   ƒ )r˜  Ú	__bases__)rÉ   rÖ  s    €r:   Úis_any_parent_includedÚGApplication._classes_with_config_traits.<locals>.is_any_parent_includedþ  s   ø€ ÜÔVÈÏÊÓVÓVÐVrE   c              3  óL   >#   • U  H  u  pX=(       d    T" U5      4v •  M     g 7frŸ   rI   )r  rÉ   Úinc_yesrÙ  s      €r:   r  rÒ    s(   øé € ð (â$9‘L�Cð ×<Ñ!7¸Ó!<Õ=Ú$9ùs   ƒ!$)rÉ   r>   r?   r“  )rn   r   rx   rÛ   r	  )rZ   rn   Úto_incl_origÚclrÜ  rÖ  rÙ  s        @@r:   rJ  Ú'Application._classes_with_config_traitsæ  s¤   ùé € ð  ‰?Ø—l‘lˆGä#ñ $
à×0Ñ0°Ô9ó$
ó 
ˆ÷
	Wð Ø(×-Ñ-Ó/ˆLÜ'ô (à$1×$7Ñ$7Ô$9ó(ó ˆMð  Ó,Øñ ð )×.Ñ.Ö0‰KˆBßˆwØ”ò 1ùs   „BB!Â	B!c                óR  • SU R                   -  /nUR                  S5        UR                  S5        UR                  S5        Uc  U R                  OUn[        U R	                  U5      5      nU H#  nUR                  UR                  U5      5        M%     SR                  U5      $ )z/generate default config file from Configurablesz# Configuration file for %s.r%   zc = get_config()  #noqarØ   )rg   rm  rn   rl  rJ  Úclass_config_sectionrñ   )rZ   rn   ÚlinesÚconfig_classesrÉ   s        r:   Úgenerate_config_fileÚ Application.generate_config_file  sŒ   € à/°$·)±)Ñ;Ð<ˆØ�‰�RÔØ�‰Ð3Ô4Ø�‰�RÔØ")¡/�$—,’,°wˆÜ˜d×>Ñ>¸wÓGÓHˆÛ!ˆCØ�L‰L˜×1Ñ1°.ÓAÖBñ "à�y‰y˜ÓÐrE   c                óæ   • [        U SS5      (       aM  U R                  R                   H+  n[        [        5         UR                  5         S S S 5        M-     SU l        g g ! , (       d  f       MG  = f)Nr­   F)r¢   r0   r�   r   r  Úcloser­   )rZ   Úhandlers     r:   Úclose_handlersÚApplication.close_handlers  sY   € Ü�4Ð.°×6Ñ6ð  Ÿ8™8×,Ô,�ÜœiÕ(Ø—M‘M”O÷ )Ñ(ñ -ð (-ˆDÕ$ð 7÷
 )Ö(ús   »A!Á!
A0	c                óœ   • U R                   R                  SU R                  5        U R                  5         [        R
                  " U5        g )NzExiting application: %s)r0   r2   rg   ré  rß   r4   )rZ   Úexit_statuss     r:   r4   ÚApplication.exit&  s1   € Ø�‰�‰Ð0°$·)±)Ô<Ø×ÑÔÜ�Š�ÕrE   c                óv   • [        [        5         U R                  5         S S S 5        g ! , (       d  f       g = frŸ   )r   r  ré  rÔ   s    r:   Ú__del__ÚApplication.__del__+  s$   € ô ”iÕ Ø×ÑÔ!÷ !× Ö ús   �*ª
8c                ój   • U R                   " S0 UD6nUR                  U5        UR                  5         g)ztLaunch a global instance of this Application

If a global instance already exists, this reinitializes and starts it
NrI   )rf  rÐ   rÁ   )rÉ   r$   r7   r5   s       r:   Úlaunch_instanceÚApplication.launch_instance2  s*   € ð �lŠlÑ$˜VÑ$ˆØ�‰�tÔØ�	‰	�rE   )
r­   rÂ   r$   rn   rš  r�  r•   r¶   rÁ   rÓ   rŸ   )rn   úClassesType | Noner?   z+t.Generator[type[Configurable], None, None])r?   r‡   )r¤   r   r?   ÚNone)r?   rõ  )r?   Ú	AnyLogger)r7   r>   r?   rõ  )r$   ÚArgvTyper?   rõ  )r?   út.Generator[str, None, None])rn   r“  r?   rø  )F)rn   r“  r?   rõ  )r?   r^   )r<  r^   r$   r÷  r?   rõ  )r?   z)tuple[dict[str, t.Any], dict[str, t.Any]])
r$   zlist[str] | Nonerµ   r‡   r¸   r‡   rn   rô  r?   r   )r„  r“  r?   ú	list[str])NF)
r®  r^   r£  ú#str | t.Sequence[str | None] | Noner0   zAnyLogger | Noner¯  r“  r?   zt.Generator[t.Any, None, None])r?   rù  )rµ  r^   r£  rú  r?   rõ  )rn   rô  r?   r^   )r   )rì  zint | str | Noner?   rõ  )r$   r÷  r7   r>   r?   rõ  )erJ   rK   rL   rM   r_   r   rg   Ú__annotations__rh   ri   rj   rk   r   r¦  r   r¨  rl   rn   rx   rz   r   r$   r   r&   r¯  r   r`   ra   Útagr•   rP   r–   r˜   r—   r›   r   r¥   rª   r£   r   r³   r   r�   rµ   r€   r¸   r¹   r   rÓ   r�  r   rš  r»   r¶   r·   r¾   rÄ   rÇ   r   rÌ   rD   rÐ   rÁ   rÃ   ró   rò   r  r  r/  r.  r8  r7  rA  rF  rE  rS  rV  rI  r[  rL  ra  ri  rw  rz  Úclassmethodr†  rŠ  rÏ   r·  Úpropertyrº  rÂ  rÍ  rJ  rä  ré  r4   rï  rò  rN   rb   rc   s   @r:   r=   r=   ˜   s  ø‡ ÙBñ -4°MÓ,B€DÐ
)ÓBñ 4;Ð;TÓ3U€KÐ0ÓUá:AÐBTÓ:UÐÐ7ÓUÙ<CÐDXÓ<YÐÐ9ÓYÙ>EÐF\Ó>]ÐÐ;Ó]à!3ÐØ3Ðñ 18³	€HÐ-Ó9ð €Gˆ[Óð -1ð!Ø)ð!à	4õ!ñ. 07°u«~€GÐ,Ó=ñ #'£&€DÐ
Ó(ñ  $Ð$QÓRÐñ ØMØ—l‘lØ2ñ÷ 
�c�€cÐð	 ð (ÐáØØGñ÷ 
�c�€cÐð ñ
 Ø-Ø*ñ÷ 
�c�€cÐð ô
1ñf ˆ]˜L¨+Ð7GÓHó"ó Ið"ñ ˆU˜Ñ#ó"ó $ð"ô(ñ ˆUƒ^óó ðñ ð.ñ0÷` 
�c�€cÐða ðn $Ð%<Ð=€GˆWÓ=ð Ø §¡ð ðð
 Dð
ð Ø! 4ð ðð
 Kð
ð Ø&¨ð ðð
 Að
ñ#€Eˆ7ó ñ@ 8<³v€KÐ4Ó=áÐ@ÈTÑR€Fñ ‘g“i“€JáØØ
Ø
ðñ		€Jñ '+£fÐ˜)Ó,áØPñç	�c�€cÐð ñ ØZñç	�c�€cÐð ñ ÐÓ ó&ó !ð&ñ ˆ]Óó0ó ð0ô

7ñ ˆXÓØö9ó ó ð9ð õ&ó ð&ô'ôUôB1ô$ôL0ôô03ôô7ôô"ö:ö4ô2Xô2ôô/ôôð õ%ó ð%ô09ðv	
àð	
ð ð	
ð ð		
ð
 $ð	
ð 
 ô	
ð õó ðð2 óó ðð& õ0,ó ð0,ðd ð
 !%Ø).ð7;àð7;ð 2ð7;ð ð	7;ð
 #'ð7;ð 
(ô7;ó ð7;ðr ó,ó ð,ð àIMð'Øð'Ø#Fð'à	ô'ó ð'ð* ó'ó ð'ð, -1ð(Ø)ð(à	4õ(öT
 ô-öô
"ð õó örE   r=   c                óŠ   • U=(       d    SU-  nU=(       d    SU-  nUR                  S5      u  pEXES00nXES00nXU4SU -   Xs40$ )a»  Helper for building basic --trait, --no-trait flags.

Parameters
----------
name : str
    The name of the flag.
configurable : str
    The 'Class.trait' string of the trait to be set/unset with the flag
set_help : unicode
    help string for --name flag
unset_help : unicode
    help string for --no-name flag

Returns
-------
cfg : dict
    A dict with two keys: 'name', and 'no-name', for setting and unsetting
    the trait, respectively.
zset %s=Truezset %s=FalserŽ   TFzno-)r  )rg   ÚconfigurableÚset_helpÚ
unset_helprÉ   r  ÚsetterÚunsetters           r:   Úboolean_flagr  E  se   € ð* ×7˜=¨<Ñ7€HØ×<˜~°Ñ<€Jà×#Ñ# CÓ(�J€Cà˜4�=Ð!€FØ˜U�^Ð$€HØ˜8Ð$ e¨d¡l°XÐ4JÐKÐKrE   c                 ó„   • [         R                  5       (       a  [         R                  5       R                  $ [	        5       $ )ztGet the config object for the global Application instance, if there is one

otherwise return an empty config object
)r=   Úinitializedrf  r3   r   rI   rE   r:   Ú
get_configr  d  s/   € ô
 ×Ñ× Ñ Ü×#Ñ#Ó%×,Ñ,Ð,ä‹xˆrE   Ú__main__)r9   r+   r?   r+   )r%   r%   )
rg   r^   r   r^   r  r^   r  r^   r?   r‡   )r?   r   )br_   Ú
__future__r   r@   rÝ   r`   r  ræ   r”  rß   ÚtypingrB   Úcollectionsr   r   Ú
contextlibr   rÛ   r   Úlogging.configr   Útextwrapr	   Útraitlets.config.configurabler
   r   Útraitlets.config.loaderr   r   r   r   r   r   r   Útraitlets.traitletsr   r   r   r   r   r   r   r   r   r   Útraitlets.utils.bunchr   Útraitlets.utils.nested_updater   Útraitlets.utils.textr   r    Úutilsr"   Úutils.importstringr#   r(  ri   rj   Úhasattrr$   rk   r€  rd  Ú_envvarÚlowerr&   r—  Ú
executableÚendswithr™   ÚTypeVarÚCallableÚAnyr+   ÚUnionÚLoggerrö  r^   r‡   ÚOptionalr÷  r  rm   rD   r  rG   Ú	FormatterrP   r=   rµ   Údefault_aliasesr¸   Údefault_flagsr  r  rJ   rò  rI   rE   r:   Ú<module>r&     s  ðÙ 2õ #ã Û Û Û 	Û Û 	Û 
Û ß 0Ý Ý Ý %Ý ç M÷÷ ñ ÷÷ ÷ õ (Ý 7ß 8å  Ý ,ð÷
 
�EƒGð ð÷ 
�EƒGð ñ ˆs�F×ÑØˆt€C„HðÐ ð �*‰*�.‰.ÐHÈ"Ó
M€Ø
‡=�=ƒ?�mÓ#Ø48Ñ1Ø‡]�]ƒ_Ð*Ó*Ø49Ñ1á
ð 	hØ
ñ	óð ð �^‰^×F §¡× 7Ñ 7¸Ó F€
à‡I‚Iˆc˜Ÿ™ C¨¯© JÑ/Ñ0€Ø�G‰G�G—N‘NÐ$BÐBÑC€	Ø
�&‰&��a—e‘e�Ñ
€Ø�:‰:�a—f‘f˜S‘kÑ"€Ø�f‰f�Q—V‘V˜LÑ)Ñ*€ôô*	�yô 	ô&�W×&Ñ&ô &ô*bÐ'ô bðR ×%Ñ%€Ø×!Ñ!€öLô>ð ˆzÓØ×ÑÕ!ð rE   