Sindbad~EG File Manager
�
�X�f|�����dZdZgd�ZddlZddlZddlZddl Z ddl
m
ZmZdZ
dZdZd Zd
ZdZdZGd
�de�Zd�ZGd�de�ZGd�de�ZGd�de�ZGd�de�ZGd�de�Zd�ZGd�de�ZGd�de�ZGd�d e�Z e�Z!Gd!�d"e �Z"Gd#�d$e �Z#Gd%�d&e �Z$Gd'�d(e$�Z%Gd)�d*e$�Z&Gd+�d,e �Z'Gd-�d.e �Z(Gd/�d0e �Z)Gd1�d2e �Z*Gd3�d4e �Z+Gd5�d6e �Z,Gd7�d8e'�Z-Gd9�d:e�Z.Gd;�d<e�Z/Gd=�d>e�Z0Gd?�d@e0�Z1GdA�dBe1�Z2GdC�dDee0�Z3y)Ea�
Command-line parsing library
This module is an optparse-inspired command-line parsing library that:
- handles both optional and positional arguments
- produces highly informative usage messages
- supports parsers that dispatch to sub-parsers
The following is a simple usage example that sums integers from the
command-line and writes the result to a file::
parser = argparse.ArgumentParser(
description='sum the integers at the command line')
parser.add_argument(
'integers', metavar='int', nargs='+', type=int,
help='an integer to be summed')
parser.add_argument(
'--log', default=sys.stdout, type=argparse.FileType('w'),
help='the file where the sum should be written')
args = parser.parse_args()
args.log.write('%s' % sum(args.integers))
args.log.close()
The module contains the following public classes:
- ArgumentParser -- The main entry point for command-line parsing. As the
example above shows, the add_argument() method is used to populate
the parser with actions for optional and positional arguments. Then
the parse_args() method is invoked to convert the args at the
command-line into an object with attributes.
- ArgumentError -- The exception raised by ArgumentParser objects when
there are errors with the parser's actions. Errors raised while
parsing the command-line are caught by ArgumentParser and emitted
as command-line messages.
- FileType -- A factory for defining types of files to be created. As the
example above shows, instances of FileType are typically passed as
the type= argument of add_argument() calls.
- Action -- The base class for parser actions. Typically actions are
selected by passing strings like 'store_true' or 'append_const' to
the action= argument of add_argument(). However, for greater
customization of ArgumentParser actions, subclasses of Action may
be defined and passed as the action= argument.
- HelpFormatter, RawDescriptionHelpFormatter, RawTextHelpFormatter,
ArgumentDefaultsHelpFormatter -- Formatter classes which
may be passed as the formatter_class= argument to the
ArgumentParser constructor. HelpFormatter is the default,
RawDescriptionHelpFormatter and RawTextHelpFormatter tell the parser
not to change the formatting for help text, and
ArgumentDefaultsHelpFormatter adds information about argument defaults
to the help.
All other classes in this module are considered implementation details.
(Also note that HelpFormatter and RawDescriptionHelpFormatter are only
considered public as object names -- the API of the formatter objects is
still considered an implementation detail.)
z1.1)�ArgumentParser�
ArgumentError�ArgumentTypeError�BooleanOptionalAction�FileType�
HelpFormatter�ArgumentDefaultsHelpFormatter�RawDescriptionHelpFormatter�RawTextHelpFormatter�MetavarTypeHelpFormatter� Namespace�Action�ONE_OR_MORE�OPTIONAL�PARSER� REMAINDER�SUPPRESS�ZERO_OR_MORE�N)�gettext�ngettextz==SUPPRESS==�?�*�+zA...�...�_unrecognized_argsc�"�eZdZdZd�Zd�Zd�Zy)�_AttributeHolderaAbstract base class that provides __repr__.
The __repr__ method returns a string in the format::
ClassName(attr=name, attr=name, ...)
The attributes are determined either by a class-level attribute,
'_kwarg_names', or by inspecting the instance __dict__.
c��t|�j}g}i}|j�D]}|jt |���|j�D]1\}}|j
�r|j|�d|����-|||<�3|r|jdt |�z�|�ddj|��d�S)N�=z**%s�(�, �))�type�__name__� _get_args�append�repr�_get_kwargs�isidentifier�join)�self� type_name�arg_strings� star_args�arg�name�values �&/usr/src/Python-3.12.7/Lib/argparse.py�__repr__z_AttributeHolder.__repr__vs�����J�'�'� ���� ��>�>�#�C����t�C�y�)�$��+�+�-�K�D�%�� � �"��"�"�d�E�#:�;�"'� �$�� .�
����v��Y��7�8�$�d�i�i��&<�=�=�c�H�t|jj��S�N)�list�__dict__�items�r+s r2r(z_AttributeHolder._get_kwargs�s���D�M�M�'�'�)�*�*r4c��gSr6�r:s r2r%z_AttributeHolder._get_args�s��� r4N)r$�
__module__�__qualname__�__doc__r3r(r%r<r4r2rrms���
>�+�r4rc�`�|�gSt|�tur|ddSddl}|j|�S�Nr)r#r7�copy)r9rBs r2�_copy_itemsrC�s5���}�� ��E�{�d���Q�x����9�9�U��r4c���eZdZdZ dd�Zd�Zd�ZGd�de�Zd�Z d �Z
d
�Zd�Zd d�Z
d
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zy)!rz�Formatter for generating usage messages and argument help strings.
Only the name of this class is considered a public API. All the methods
provided by the class are considered an implementation detail.
Nc��|�#ddl}|j�j}|dz}||_||_t|t
|dz
|dz��|_||_d|_ d|_
d|_|j|d�|_
|j|_tj dtj"�|_tj d�|_y)Nr��z\s+z\n\n\n+)�shutil�get_terminal_size�columns�_prog�_indent_increment�min�max�_max_help_position�_width�_current_indent�_level�_action_max_length�_Section�
_root_section�_current_section�_re�compile�ASCII�_whitespace_matcher�_long_break_matcher)r+�prog�indent_increment�max_help_position�widthrHs r2�__init__zHelpFormatter.__init__�s����=���,�,�.�6�6�E��Q�J�E���
�!1���"%�&7�&)�%�"�*�6F��6J�&K�#M������ ������"#���!�]�]�4��6��� $� 2� 2���#&�;�;�v�s�y�y�#A�� �#&�;�;�z�#:�� r4c�l�|xj|jz
c_|xjdz
c_y�N��rQrLrRr:s r2�_indentzHelpFormatter._indent�s'������ 6� 6�6�����q��r4c��|xj|jzc_|jdk\sJd��|xjdzc_y)NrzIndent decreased below 0.rcrdr:s r2�_dedentzHelpFormatter._dedent�sA������ 6� 6�6���#�#�q�(�E�*E�E�(����q��r4c��eZdZdd�Zd�Zy)�HelpFormatter._SectionNc�<�||_||_||_g|_yr6)� formatter�parent�headingr9)r+rkrlrms r2r`zHelpFormatter._Section.__init__�s��&�D�N� �D�K�"�D�L��D�Jr4c ��|j�|jj�|jj}||jD��cgc]
\}}||���c}}�}|j�|jj�|sy|jturM|j�A|jj}td�t|j��z}d|d|fz}nd}|d||dg�Scc}}w)N�z%(heading)s:)rm�%*s%s
�
)rlrkre�_join_partsr9rgrmrrQ�_�dict)r+r*�func�args� item_help�current_indent�heading_textrms r2�format_helpz"HelpFormatter._Section.format_help�s����{�{�&����&�&�(��>�>�-�-�D��D�J�J�G�J�j�d�D�d�D�k�J�G�H�I��{�{�&����&�&�(����|�|�8�+����0H�!%���!?�!?�� ��0�4����3M�M��#�~�r�<�&H�H������w� �4�8�9�9��#Hs�C;
r6)r$r=r>r`rzr<r4r2rTri�s�� � :r4rTc�R�|jjj||f�yr6)rVr9r&)r+rurvs r2� _add_itemzHelpFormatter._add_item�s �����#�#�*�*�D�$�<�8r4c��|j�|j||j|�}|j|jg�||_yr6)rerTrVr|rz)r+rm�sections r2�
start_sectionzHelpFormatter.start_section�s?�������-�-��d�&;�&;�W�E�����w�*�*�B�/� '��r4c�Z�|jj|_|j�yr6)rVrlrgr:s r2�end_sectionzHelpFormatter.end_section�s�� $� 5� 5� <� <������r4c�V�|tur!|�|j|j|g�yyyr6)rr|�_format_text)r+�texts r2�add_textzHelpFormatter.add_text�s-���x��D�$4��N�N�4�,�,�t�f�5�%5�r4c�Z�|tur#||||f}|j|j|�yyr6)rr|�
_format_usage)r+�usage�actions�groups�prefixrvs r2� add_usagezHelpFormatter.add_usages1���� ��'�6�6�1�D��N�N�4�-�-�t�4�!r4c��|jtur�|j}t||��|jzg}|j|�D]/}|j
t||��|jz��1t|�}t|j|�|_|j|j|g�yyr6)�helpr�_format_action_invocation�lenrQ�_iter_indented_subactionsr&rNrSr|�_format_action)r+�action�get_invocation�invocation_lengths� subaction�
action_lengths r2�add_argumentzHelpFormatter.add_arguments����;�;�h�&�"�;�;�N�"%�n�V�&<�"=��@T�@T�"T�!U��!�;�;�F�C� �"�)�)�#�n�Y�.G�*H�4�K_�K_�*_�`�D� � 2�3�M�&)�$�*A�*A�*7�'9�D�#�
�N�N�4�.�.���9�'r4c�4�|D]}|j|��yr6)r�)r+r�r�s r2�
add_argumentszHelpFormatter.add_argumentss���F����f�%�r4c��|jj�}|r0|jjd|�}|j d�dz}|S)N�
rq)rUrzr[�sub�strip)r+r�s r2rzzHelpFormatter.format_helpsI���!�!�-�-�/����+�+�/�/���=�D��:�:�d�#�d�*�D��r4c�^�dj|D�cgc]}|r
|tur|��c}�Scc}w)Nro)r*r)r+�part_strings�parts r2rrzHelpFormatter._join_parts$s=���w�w�$0�:�$0�D��D��$8��$0�:�;� ;��:s�*c����|�td�}|�|t|j��z}�nB|�|sdt|j��z}�n#|�� dt|j��z}g}g}|D]1}|jr|j |��!|j |��3|j
} | ||z|�}
dj
||
fD�cgc]}|s�|�� c}�}|j|jz
�t|�t|�z�kD�r]d}| ||�}
| ||�}tj||
�}tj||�}dj
|�|
k(sJ�dj
|�|k(sJ�d�fd� }t|�t|�zd�zkr[dt|�t|�zdzz}|r'||g|z||�}|j|||��nw|r||g|z||�}nf|g}nbdt|�z}||z}|||�}t|�dkDr2g}|j|||��|j|||��|g|z}d j
|�}|�|�d
�Scc}w)Nzusage: �r\z%(prog)s� z%\(.*?\)+(?=\s|$)|\[.*?\]+(?=\s|$)|\S+c���g}g}t|�}|�t|�dz
}n|dz
}|D]d}|dzt|�z�kDr,|r*|j|dj|�z�g}|dz
}|j|�|t|�dzz
}�f|r#|j|dj|�z�|�|d|d|d<|S)Nrcr�r)r�r&r*) �parts�indentr��lines�line�
indent_length�line_lenr��
text_widths �r2� get_linesz.HelpFormatter._format_usage.<locals>.get_linesYs�����E��D�$'��K�M��)�#&�v�;��?��#0�1�#4�� %��#�a�<�#�d�)�3�j�@�T�!�L�L��#�(�(�4�.�)@�A�#%�D�'4�q�'8�H����D�)� �C��I��M�1��
!&�����V�c�h�h�t�n�%<�=��)�#(��8�M�N�#;��a�� �Lr4g�?rcrqr�r6)
rsrtrK�option_stringsr&�_format_actions_usager*rPrQr�rW�findall�extend)r+r�r�r�r�r\� optionals�positionalsr��format�action_usage�s�part_regexp� opt_usage� pos_usage� opt_parts� pos_partsr�r�r�r�r�s @r2r�zHelpFormatter._format_usage)s�����>��y�\�F����D�d�j�j�1�1�E��]�7���4�:�:�!6�6�E��]���$�*�*� 5�5�D��I��K�!���(�(��$�$�V�,��&�&�v�.� "��/�/�F�!�)�k�"9�6�B�L��H�H�$��)=�C�)=�A��a�)=�C�D�E����t�';�';�;�J��6�{�S��Z�'�*�4���
#�9�f�5� �"�;��7� ��K�K��Y�?� ��K�K��Y�?� ��x�x� �*�i�7�7�7��x�x� �*�i�7�7�7�!�,�v�;��T��*�d�Z�.?�?� �C��K�#�d�)�$;�a�$?�@�F� � )�4�&�9�*<�f�f� M�����Y�y�&�%A�B�"� )�4�&�9�*<�f�f� M��!%���!�3�v�;�.�F�%� �1�E�%�e�V�4�E��5�z�A�~� "�����Y�y�&�%A�B����Y�y�&�%A�B�!�F�U�N�E�� � �%�(��$�U�+�+��GDs�
I5�I5c���t�}i}|D�]4}|jstd|���� |j|jd�}t |j�}||z}||||jk(s�jd} |jD]+}
|j|
�|
jtus�'| dz
} �-|| z
}|s��|js/||vr||xxdz
cc<nd||<||vr||xxdz
cc<n9d||<n3|dkDr.||vr||xxdz
cc<nd||<||vr||xxd z
cc<nd ||<t|dz|�D]}d
||<� ��7g}
t|�D�]U\}}
|
jturd|
jd�|j|�d
k(r|j|��P|j|dz�d
k(s�h|j|dz��}|
jsN|j|
�}|j!|
|�}|
|vr|ddk(r
|ddk(r|dd}|
j|���|
jd}|
j"dk(r|
j%�}n*|j'|
�}|j!|
|�}|�d|��}|
js |
|vrd
|z}|
j|���Xt)|d��D]}||g|
||�
dj+|
D�cgc]}|��|�� c}�}d}d}t-j.d|zd|�}t-j.d|zd|�}t-j.|�d|��d|�}|j1�}|S#t$rY��MwxYwcc}w)Nzempty group rrcz [�[�]z (r r"�|���r��[%s]T)�reversez[\[(]z[\])]z(%s) z\1� (%s)z *ro)�set�_group_actions�
ValueError�indexr��addr�r�required�range� enumerater&�get�popr��#_get_default_metavar_for_positional�_format_args�nargs�format_usage�!_get_default_metavar_for_optional�sortedr*rWr�r�)r+r�r��
group_actions�inserts�group�start�group_action_count�end�suppressed_actions_countr��exposed_actions_count�ir��defaultr��
option_string�args_string�itemr��open�closes r2r�z#HelpFormatter._format_actions_usage�s�����
����E��'�'� �<��w�!7�8�8�&
)��
�
�e�&:�&:�1�&=�>��&)��)=�)=�%>�"��0�0���5��%��)=�)=�=�/0�,�"'�"6�"6��%�)�)�&�1�!�;�;�(�2�4��9�4�#7�
-?�AY�,Y�)�0� � �>�>� �G�+�#�E�N�d�2�N�-0�G�E�N��'�>�#�C�L�C�/�L�+.�G�C�L�.��2� �G�+�#�E�N�d�2�N�-0�G�E�N��'�>�#�C�L�C�/�L�+.�G�C�L�"�5�1�9�c�2��%(���
�3�S�Z��"�7�+�I�A�v��{�{�h�&����T�"��;�;�q�>�S�(��K�K��N��[�[��Q��'�3�.��K�K��A��&��*�*��B�B�6�J���(�(���9���]�*��A�w�#�~�$�r�(�c�/�#�A�b�z�����T�"�!'� 5� 5�a� 8�
��<�<�1�$�!�.�.�0�D�
#�D�D�V�L�G�"&�"3�"3�F�G�"D�K�&3�[�A�D����6��+F�!�D�=�D����T�"�[,�`���.�A�!�!�*��E�!�A�J�/��x�x�%�D�%�$�4�3C��%�D�E�������w�w�x�$���t�4���w�w�x�%�'���5���w�w�D�%�0�#�t�<���z�z�|�����O�
��
��xEs�M�M �M � M�Mc���d|vr|t|j��z}t|j|jz
d�}d|jz}|j|||�dzS)Nz%(prog)r��r�r�)rtrKrNrPrQ�
_fill_text)r+r�r�r�s r2r�zHelpFormatter._format_text�s`������$�D�J�J�/�/�D�����t�';�';�;�R�@�
��t�+�+�+�����t�Z��8�6�A�Ar4c�`�t|jdz|j�}t|j|z
d�}||j
z
dz
}|j
|�}|js|j
d|f}d|z}n<t|�|kr|j
d||f}d|z}d}n|j
d|f}d|z}|}|g}|jr{|jj�ra|j|�} | rp|j| |�}
|jdd|
dfz�|
ddD]}|jd|d|fz��n"|jd�s|jd�|j|�D]"}|j|j|���$|j!|�S) NrFr�rorpz %*s%-*s rrcrq)rMrSrOrNrPrQr�r�r�r��_expand_help�_split_linesr&�endswithr�r�rr)
r+r��
help_position�
help_width�action_width�
action_header�tup�indent_firstr�� help_text�
help_linesr�r�s
r2r�zHelpFormatter._format_actions����D�3�3�a�7� �3�3�5�
�����}�4�b�9�
�$�t�';�';�;�a�?���6�6�v�>�
��{�{��&�&��M�9�C�%��O�M���
�<�
/��&�&��L�-�G�C�'�#�-�M��L��&�&��M�9�C�%��O�M�(�L�����;�;�6�;�;�,�,�.��)�)�&�1�I��!�.�.�y�*�E�
����Y�,��J�q�M�)J�J�K�&�q�r�N�D��L�L��m�R��-F�!F�G�+��'�'��-��L�L����7�7��?�I��L�L��,�,�Y�7�8�@�����&�&r4c��|js-|j|�}|j||�d�\}|Sg}|jdk(r|j |j�nJ|j|�}|j
||�}|jD]}|j|�d|����dj|�S)Nrcrr�r!) r�r��_metavar_formatterr�r�r�r�r&r*)r+r�r��metavarr�r�r�s r2r�z'HelpFormatter._format_action_invocation4s����$�$��>�>�v�F�G�?�t�.�.�v�w�?��B�H�G��N��E��|�|�q� ����V�2�2�3�
�@�@��H��"�/�/���@��%+�%:�%:�M��L�L�M�;�!G�H�&;��9�9�U�#�#r4c����|j�
|j�nE|j�7|jD�cgc]
}t|���}}ddj|�z�n|��fd�}|Scc}w)Nz{%s}�,c�4��t�t�r�S�f|zSr6)�
isinstance�tuple)�
tuple_size�results �r2r�z0HelpFormatter._metavar_formatter.<locals>.formatUs����&�%�(��
��z�J�.�.r4)r��choices�strr*)r+r��default_metavar�choice�choice_strsr�r�s @r2r�z HelpFormatter._metavar_formatterLsf����>�>�%��^�^�F�
�^�^�
'�5;�^�^�D�^�6�3�v�;�^�K�D��c�h�h�{�3�3�F�$�F� /�
�
��Es�A'c��|j||�}|j�
d|d�z}|S|jtk(r
d|d�z}|S|jtk(r$|d�}t |�dk(rd|z}|Sd|z}|S|jt
k(r
d|d�z}|S|jtk(rd}|S|jtk(r
d |d�z}|S|jtk(rd
}|S t|j�D�cgc]}d��}}dj|�||j�z}|Scc}w#t$r
td�d�wxYw)
Nz%srcr�rFz
[%s [%s ...]]z[%s ...]z%s [%s ...]rz%s ...rozinvalid nargs valuer�)
r�r�rrr�rrrrr�� TypeErrorr�r*)r+r�r��get_metavarr�r�rs�formatss r2r�zHelpFormatter._format_args\s����-�-�f�o�F���<�<���K��N�*�F�.�
�-�\�\�X�
%��k�!�n�,�F�*�
�)�\�\�\�
)�!�!�n�G��7�|�q� �(�7�2��"�
�$�g�-���
��\�\�[�
(�"�[��^�3�F��
��\�\�Y�
&��F��
��\�\�V�
#���A��.�F��
��\�\�X�
%��F��
�
B�).�v�|�|�)<�=�)<�A�4�)<��=��X�X�g�&��V�\�\�)B�B�F��
�� >���
B� �!6�7�T�A�
B�s�2D?� D:�D?�:D?�?Ec��tt|�|j��}t|�D]}||tus�||=�t|�D]$}t||d�s�||j||<�&|jd��0dj|dD�cgc]
}t|���c}�}||d<|j|�|zScc}w)Nr�r$r�r!)rt�varsrKr7r�hasattrr$r�r*r��_get_help_string)r+r��paramsr0�c�choices_strs r2r�zHelpFormatter._expand_helpxs����d�6�l����4����L�D��d�|�x�'��4�L�!���L�D��v�d�|�Z�0�%�d�|�4�4��t��!��:�:�i� �,��)�)�V�I�5F�$G�5F��S��V�5F�$G�H�K� +�F�9���$�$�V�,�v�5�5��%Hs�Cc#�K� |j}|j�|�Ed{���|j�y7�#t$rYywxYw�wr6)�_get_subactionsrerg�AttributeError)r+r��get_subactionss r2r�z'HelpFormatter._iter_indented_subactions�sN���� �#�3�3�N�
�L�L�N�%�'�'�'��L�L�N�
(�� � �� �s1�A�A�A�A�A� A�A�
A�Ac��|jjd|�j�}ddl}|j ||�S)Nr�r)rZr�r��textwrap�wrap)r+r�r_rs r2r�zHelpFormatter._split_lines�s9���'�'�+�+�C��6�<�<�>�� ��}�}�T�5�)�)r4c��|jjd|�j�}ddl}|j ||||��S)Nr�r)�initial_indent�subsequent_indent)rZr�r�r�fill)r+r�r_r�rs r2r�zHelpFormatter._fill_text�sF���'�'�+�+�C��6�<�<�>����}�}�T�5�,2�/5��7� 7r4c��|jSr6)r��r+r�s r2rzHelpFormatter._get_help_string�����{�{�r4c�6�|jj�Sr6)�dest�upperrs r2r�z/HelpFormatter._get_default_metavar_for_optional�s���{�{� � �"�"r4c��|jSr6)rrs r2r�z1HelpFormatter._get_default_metavar_for_positional�rr4)rF�Nr6) r$r=r>r?r`rerg�objectrTr|rr�r�r�r�r�rzrrr�r�r�r�r�r�r�r�r�r�r�rr�r�r<r4r2rr�s����#$�#%�� ;�>��
:�6�:�@9�(��6�5�
:�"&��;�
_,�Bq�fB�.'�`$�0� �86��*�7��#�r4rc��eZdZdZd�Zy)r z�Help message formatter which retains any formatting in descriptions.
Only the name of this class is considered a public API. All the methods
provided by the class are considered an implementation detail.
c�X��dj�fd�|jd��D��S)Nroc3�(�K�|] }�|z���y�wr6r<)�.0r�r�s �r2� <genexpr>z9RawDescriptionHelpFormatter._fill_text.<locals>.<genexpr>�s�����P�1O��v��}�1O�s�T)�keepends)r*�
splitlines)r+r�r_r�s `r2r�z&RawDescriptionHelpFormatter._fill_text�s#����w�w�P����$��1O�P�P�Pr4N)r$r=r>r?r�r<r4r2r r �s
���Qr4r c��eZdZdZd�Zy)r
z�Help message formatter which retains formatting of all help text.
Only the name of this class is considered a public API. All the methods
provided by the class are considered an implementation detail.
c�"�|j�Sr6)r&)r+r�r_s r2r�z!RawTextHelpFormatter._split_lines�s����� � r4N)r$r=r>r?r�r<r4r2r
r
�s���!r4r
c��eZdZdZd�Zy)rz�Help message formatter which adds default values to argument help.
Only the name of this class is considered a public API. All the methods
provided by the class are considered an implementation detail.
c��|j}|�d}d|vrF|jtur4ttg}|j
s|j|vr|td�z
}|S)a6
Add the default value to the option help message.
ArgumentDefaultsHelpFormatter and BooleanOptionalAction when it isn't
already present. This code will do that, detecting cornercases to
prevent duplicates or cases where it wouldn't make sense to the end
user.
roz
%(default)z (default: %(default)s))r�r�rrrr�r�rs)r+r�r��defaulting_nargss r2rz.ArgumentDefaultsHelpFormatter._get_help_string�s`���{�{���<��D��t�#��~�~�X�-�$,�l�#;� ��(�(�F�L�L�<L�,L��A�7�8�8�D��r4N)r$r=r>r?rr<r4r2rr�s���r4rc��eZdZdZd�Zd�Zy)raHelp message formatter which uses the argument 'type' as the default
metavar value (instead of the argument 'dest')
Only the name of this class is considered a public API. All the methods
provided by the class are considered an implementation detail.
c�.�|jjSr6�r#r$rs r2r�z:MetavarTypeHelpFormatter._get_default_metavar_for_optional�����{�{�#�#�#r4c�.�|jjSr6r.rs r2r�z<MetavarTypeHelpFormatter._get_default_metavar_for_positional�r/r4N)r$r=r>r?r�r�r<r4r2rr�s���$�$r4rc�2�|�y|jrdj|j�S|jdtfvr|jS|jdtfvr|jS|j
r!ddj|j
�zdzSy)N�/�{r��})r�r*r�rrr�)�arguments r2�_get_action_namer6�s������ � � ��x�x��/�/�0�0� � � �$��!1� 1����� ���t�X�.� .��}�}�� � � ��S�X�X�h�.�.�/�/�#�5�5�r4c��eZdZdZd�Zd�Zy)rz�An error from creating or using an argument (optional or positional).
The string value of this exception is the message, augmented with
information about the argument that caused it.
c�2�t|�|_||_yr6)r6�
argument_name�message)r+r5r:s r2r`zArgumentError.__init__s��-�h�7�����r4c�~�|j�d}ntd�}|t|j|j��zS)Nz%(message)sz'argument %(argument_name)s: %(message)s)r:r9)r9rsrtr:)r+r�s r2�__str__zArgumentError.__str__sA�����%�"�F��@�A�F���T�\�\�+/�+=�+=�?�?� ?r4N)r$r=r>r?r`r<r<r4r2rr�s����?r4rc��eZdZdZy)rz@An error from trying to convert a command line string to a type.N)r$r=r>r?r<r4r2rrs��J�r4rc�<�eZdZdZ dd�Zd�Zd�Zdd�Zy) r
a\ Information about how to convert command line strings to Python objects.
Action objects are used by an ArgumentParser to represent the information
needed to parse a single argument from one or more strings from the
command line. The keyword arguments to the Action constructor are also
all attributes of Action instances.
Keyword Arguments:
- option_strings -- A list of command-line option strings which
should be associated with this action.
- dest -- The name of the attribute to hold the created object(s)
- nargs -- The number of command-line arguments that should be
consumed. By default, one argument will be consumed and a single
value will be produced. Other values include:
- N (an integer) consumes N arguments (and produces a list)
- '?' consumes zero or one arguments
- '*' consumes zero or more arguments (and produces a list)
- '+' consumes one or more arguments (and produces a list)
Note that the difference between the default and nargs=1 is that
with the default, a single value will be produced, while with
nargs=1, a list containing a single value will be produced.
- const -- The value to be produced if the option is specified and the
option uses an action that takes no values.
- default -- The value to be produced if the option is not specified.
- type -- A callable that accepts a single string argument, and
returns the converted value. The standard Python types str, int,
float, and complex are useful examples of such callables. If None,
str is used.
- choices -- A container of values that should be allowed. If not None,
after a command-line argument has been converted to the appropriate
type, an exception will be raised if it is not a member of this
collection.
- required -- True if the action must always be specified at the
command line. This is only meaningful for optional command-line
arguments.
- help -- The help string describing the argument.
- metavar -- The name to be used for the option's argument with the
help string. If None, the 'dest' value will be used as the name.
Nc��||_||_||_||_||_||_||_||_| |_|
|_ yr6�
r�rr��constr�r#r�r�r�r�)r+r�rr�rAr�r#r�r�r�r�s r2r`zAction.__init__LsK��-����� ���
���
������ ���� ��
��� ���r4c�L�gd�}|D�cgc]}|t||�f��c}Scc}w)Nr@��getattr�r+�namesr0s r2r(zAction._get_kwargsbs/��
��9>�>����w�t�T�*�+��>�>��>��!c� �|jdSrA)r�r:s r2r�zAction.format_usageqs���"�"�1�%�%r4c�*�ttd���)Nz.__call__() not defined)�NotImplementedErrorrs�r+�parser� namespace�valuesr�s r2�__call__zAction.__call__ts��!�!�$=�">�?�?r4�NNNNNFNNr6)r$r=r>r?r`r(r�rOr<r4r2r
r
s7��0�j���������,
?�&�@r4r
c�:��eZdZdeeddef�fd� Zdd�Zd�Z�xZS)rNFc �b��g} |D]>}
| j|
�|
jd�s�&d|
ddz}
| j|
��@dD].}t�|tus�t j
|dd���0|turd}|turd}|turd}t�|�| |d||||||� � y)
N�--�--no-rF)r#r�r�zP{name!r} is deprecated as of Python 3.12 and will be removed in Python {remove}.)��)�remover) r�rr�r�r#r�r�r�r�)r&�
startswith�locals�_deprecated_default�warnings�_deprecated�superr`)
r+r�rr�r#r�r�r�r��_option_stringsr��
field_name� __class__s
�r2r`zBooleanOptionalAction.__init__|s������+�M��"�"�=�1��'�'��-� '�-���*;� ;�
��&�&�}�5�,�9�J��x�
�#�+>�>��$�$��2�"� $�9��&�&��D��)�)��G��)�)��G�
���*��������� � r4c�p�||jvr(t||j|jd��yy)NrT)r��setattrrrXrKs r2rOzBooleanOptionalAction.__call__�s3���D�/�/�/��I�t�y�y�m�.F�.F�w�.O�*O�P�0r4c�8�dj|j�S)Nz | )r*r�r:s r2r�z"BooleanOptionalAction.format_usage�s���z�z�$�-�-�.�.r4r6)r$r=r>rZr`rOr��
__classcell__�r`s@r2rr{s(����)�,���,�-�`Q�/r4rc�8��eZdZ d�fd� Zdd�Z�xZS)�_StoreActionc���|dk(rtd��|�|tk7rtdtz��tt|�||||||||| |
��
y)Nrz�nargs for store actions must be != 0; if you have nothing to store, actions such as store true or store const may be more appropriate� nargs must be %r to supply constr@)r�rr]rgr`�r+r�rr�rAr�r#r�r�r�r�r`s �r2r`z_StoreAction.__init__�ss����A�:��K�L�
L����(�!2��?�(�J�K�K�
�l�D�*�)���������� +�
r4c�2�t||j|�yr6)rbrrKs r2rOz_StoreAction.__call__�s��� �4�9�9�f�-r4rPr6�r$r=r>r`rOrdres@r2rgrg�s'���
���������:.r4rgc�2��eZdZ d�fd� Zdd�Z�xZS)�_StoreConstActionc �:��tt|�||d||||��y)Nr)r�rr�rAr�r�r�)r]rnr`� r+r�rrAr�r�r�r�r`s �r2r`z_StoreConstAction.__init__�s/��� ���/�)������� 0� r4c�F�t||j|j�yr6)rbrrArKs r2rOz_StoreConstAction.__call__�s��� �4�9�9�d�j�j�1r4�NNFNNr6rlres@r2rnrn�s���
������"2r4rnc�&��eZdZ d�fd� Z�xZS)�_StoreTrueActionc�8��tt|�||d|||��y)NT�r�rrAr�r�r�)r]rtr`�r+r�rr�r�r�r`s �r2r`z_StoreTrueAction.__init__�s,��� ���.�)������
/� r4)FFN�r$r=r>r`rdres@r2rtrt�s���
����r4rtc�&��eZdZ d�fd� Z�xZS)�_StoreFalseActionc�8��tt|�||d|||��y)NFrv)r]rzr`rws �r2r`z_StoreFalseAction.__init__s,��� ���/�)������
0� r4)TFNrxres@r2rzrz�s���
����r4rzc�8��eZdZ d�fd� Zdd�Z�xZS)�
_AppendActionc���|dk(rtd��|�|tk7rtdtz��tt|�||||||||| |
��
y)Nrz�nargs for append actions must be != 0; if arg strings are not supplying the value to append, the append const action may be more appropriaterir@)r�rr]r}r`rjs �r2r`z_AppendAction.__init__ss����A�:��O�P�
P����(�!2��?�(�J�K�K�
�m�T�+�)���������� ,�
r4c��t||jd�}t|�}|j|�t ||j|�yr6)rDrrCr&rb�r+rLrMrNr�r9s r2rOz_AppendAction.__call__/�:��� �4�9�9�d�3���E�"��
���V��� �4�9�9�e�,r4rPr6rlres@r2r}r}s'���
���������:-r4r}c�2��eZdZ d�fd� Zdd�Z�xZS)�_AppendConstActionc
�<��tt|�||d|||||��y)Nr)r�rr�rAr�r�r�r�)r]r�r`rps �r2r`z_AppendConstAction.__init__8s2��� � �$�0�)�������� 1� r4c��t||jd�}t|�}|j|j�t||j|�yr6)rDrrCr&rArbr�s r2rOz_AppendConstAction.__call__Js>��� �4�9�9�d�3���E�"��
���T�Z�Z� �� �4�9�9�e�,r4rrr6rlres@r2r�r�6s���
������$-r4r�c�.��eZdZ d�fd� Zdd�Z�xZS)�_CountActionc�8��tt|�||d|||��y)Nr)r�rr�r�r�r�)r]r�r`rws �r2r`z_CountAction.__init__Ss+��� �l�D�*�)������
+� r4c�n�t||jd�}|�d}t||j|dz�y)Nrrc)rDrrb)r+rLrMrNr��counts r2rOz_CountAction.__call__as2��� �4�9�9�d�3���=��E�� �4�9�9�e�a�i�0r4)NFNr6rlres@r2r�r�Qs���
����1r4r�c�.��eZdZeedf�fd� Zdd�Z�xZS)�_HelpActionNc�6��tt|�|||d|��y)Nr�r�rr�r�r�)r]r�r`)r+r�rr�r�r`s �r2r`z_HelpAction.__init__js(���
�k�4�)�)����� *� r4c�D�|j�|j�yr6)�
print_help�exitrKs r2rOz_HelpAction.__call__vs���������
r4r6�r$r=r>rr`rOrdres@r2r�r�hs����!��
�r4r�c�0��eZdZdeedf�fd� Zdd�Z�xZS)�_VersionActionNc�^��|�td�}tt|�|||d|��||_y)Nz&show program's version number and exitrr�)rsr]r�r`�version)r+r�r�rr�r�r`s �r2r`z_VersionAction.__init__}sA����<��=�>�D�
�n�d�,�)����� -� ���r4c��|j}|�|j}|j�}|j|�|j|j �t
j�|j�yr6)r��_get_formatterr��_print_messagerz�_sys�stdoutr�)r+rLrMrNr�r�rks r2rOz_VersionAction.__call__�s[���,�,���?��n�n�G��)�)�+� ����7�#����i�3�3�5�t�{�{�C����
r4r6r�res@r2r�r�{s�����!��� r4r�c�R��eZdZGd�de�Zedddf�fd� Zd�Zd�Zd d�Z �xZ
S)
�_SubParsersActionc���eZdZ�fd�Z�xZS)�&_SubParsersAction._ChoicesPseudoActionc���|x}}|r|ddj|�zz
}ttj|�}|j g|||��y)Nr�r!)r�rr�r�)r*r]r��_ChoicesPseudoActionr`)r+r0�aliasesr�r�r�supr`s �r2r`z/_SubParsersAction._ChoicesPseudoAction.__init__�sU���!�!�G�d���7�T�Y�Y�w�%7�7�7���)�>�>��E�C��L�L���D�!(�
�
*r4rxres@r2r�r��s
��� *� *r4r�FNc ���||_||_i|_g|_tt
|�||t|j|||��y)N)r�rr�r�r�r�r�)�_prog_prefix�
_parser_class�_name_parser_map�_choices_actionsr]r�r`r) r+r�r\�parser_classrr�r�r�r`s �r2r`z_SubParsersAction.__init__�sU���!���)��� "��� "���
���/�)����)�)���� 0� r4c��|jd��|j�d|��|d<|jdd�}||jvrt |td�|z��|D](}||jvs�t |td�|z��d|vr?|jd�}|j
|||�}|jj|�|jdi|��}||j|<|D]}||j|<�|S)Nr\r�r�r<zconflicting subparser: %szconflicting subparser alias: %sr�)
r�r�r�r�rrsr�r�r&r�)r+r0�kwargsr��aliasr��
choice_actionrLs r2�
add_parserz_SubParsersAction.add_parser�s���:�:�f��%�(,�(9�(9�4�@�F�6�N��*�*�Y��+���4�(�(�(���a�(C�&D�t�&K�L�L��E���-�-�-�#��!�=�>��F�H�H���V���:�:�f�%�D� �5�5�d�G�T�J�M��!�!�(�(��7�$��#�#�-�f�-��&,����d�#��E�+1�D�!�!�%�(���
r4c��|jSr6)r�r:s r2r
z!_SubParsersAction._get_subactions�s���$�$�$r4c� �|d}|dd}|jturt||j|� |j|}|j|d�\} }t| �j�D]\}
}t||
|��|rAt|t�st|tg�t|t�j|�yy#t$r9|dj|j�d�}t
d�|z}t||��wxYw)Nrrcr!)�parser_namer�z5unknown parser %(parser_name)r (choices: %(choices)s))rrrbr��KeyErrorr*rsr�parse_known_argsrr9r�_UNRECOGNIZED_ARGS_ATTRrDr�)r+rLrMrNr�r�r-rv�msg�subnamespace�keyr1s r2rOz_SubParsersAction.__call__�s
���Q�i���Q�R�j���9�9�H�$��I�t�y�y�+�6� +��*�*�;�7�F�%+�$;�$;�K��$N�!��k��|�,�2�2�4�J�C���I�s�E�*�5���9�&=�>�� �#:�B�?��I�6�7�>�>�{�K���#� +�#.�#�y�y��)>�)>�?�A�D��K�L�t�S�C���c�*�*� +�s�C�AD
r6)r$r=r>r
r�rr`r�r
rOrdres@r2r�r��s2���*�v�*������.�<%�Lr4r�c��eZdZdd�Zy)�
_ExtendActionNc��t||jd�}t|�}|j|�t ||j|�yr6)rDrrCr�rbr�s r2rOz_ExtendAction.__call__�r�r4r6)r$r=r>rOr<r4r2r�r��s��-r4r�c�$�eZdZdZdd�Zd�Zd�Zy)ra�Factory for creating file object types
Instances of FileType are typically passed as type= arguments to the
ArgumentParser add_argument() method.
Keyword Arguments:
- mode -- A string indicating how the file is to be opened. Accepts the
same values as the builtin open() function.
- bufsize -- The file's desired buffer size. Accepts the same values as
the builtin open() function.
- encoding -- The file's encoding. Accepts the same values as the
builtin open() function.
- errors -- A string indicating how encoding and decoding errors are to
be handled. Accepts the same value as the builtin open() function.
Nc�<�||_||_||_||_yr6)�_mode�_bufsize� _encoding�_errors)r+�mode�bufsize�encoding�errorss r2r`zFileType.__init__s����
���
�!�����r4c�F��|dk(r�d�jvr8d�jvrtjjStjSt �fd�dD��r8d�jvrtj
jStj
St
d��jz}t|�� t|�j�j�j�j�S#t$r#}||d�}t
d�}t||z��d}~wwxYw) N�-�r�bc3�:�K�|]}|�jv���y�wr6)r�)r#r
r+s �r2r$z$FileType.__call__.<locals>.<genexpr>#s�����4�e��Q�$�*�*�_�e�s��waxzargument "-" with mode %r)�filename�errorz$can't open '%(filename)s': %(error)s)r�r��stdin�buffer�anyr�rsr�r�r�r�r��OSErrorr)r+�stringr��ervr:s` r2rOzFileType.__call__s�����S�=��d�j�j� �,/�4�:�:�,=�t�z�z�(�(�M�4�:�:�M��4�e�4�4�-0�D�J�J�->�t�{�{�)�)�O�D�K�K�O��3�4�t�z�z�A�� ��o�%� 4����
�
�D�M�M�4�>�>����&�
&��� 4� &��3�D��>�?�G�#�G�d�N�3�3�� 4�s�=6C4�4 D �=D�D c
�L�|j|jf}d|jfd|jfg}dj |D�cgc]}|dk7s� t|���c}|D��cgc]\}}|�|�d|����c}}z�}t
|�j�d|�d�Scc}wcc}}w)Nr�r�r!r�rr r")r�r�r�r�r*r'r#r$)r+rvr�r/�kw�args_strs r2r3zFileType.__repr__2s����z�z�4�=�=�(���t�~�~�.��4�<�<�0H�I���9�9�4�E�4�C�3�"�9�d�3�i�4�E�AG�2��g�b�#�!$��*,�S�1��2�2�3�� ��:�.�.��9�9��F��2s�
B�
B�#B )r�r�NN)r$r=r>r?r`rOr3r<r4r2rrs��� �4�(:r4rc�"�eZdZdZd�Zd�Zd�Zy)rz�Simple object for storing attributes.
Implements equality by attribute names and values, and provides a simple
string representation.
c�2�|D]}t||||��yr6)rb)r+r�r0s r2r`zNamespace.__init__Es���D��D�$��t��-�r4c�\�t|t�stSt|�t|�k(Sr6)r�r�NotImplementedr)r+�others r2�__eq__zNamespace.__eq__Is%���%��+�!�!��D�z�T�%�[�(�(r4c��||jvSr6)r8)r+r�s r2�__contains__zNamespace.__contains__Ns���d�m�m�#�#r4N)r$r=r>r?r`r�r�r<r4r2rr>s���.�)�
$r4rc���eZdZ�fd�Zd�Zdd�Zd�Zd�Zd�Zd�Z d�Z
d �Zd
�Zd�Z
d�Zd
�Zdd�Zd�Zd�Zd�Zd�Z�xZS)�_ActionsContainerc�@��tt|��||_||_||_||_i|_|jddt�|jddt�|jddt�|jddt�|jddt�|jddt�|jddt�|jddt�|jdd t �|jdd
t"�|jddt$�|jddt&�|j)�g|_i|_g|_g|_i|_t5j6d
�|_g|_y)Nr��store�store_const�
store_true�store_falser&�append_constr�r�r��parsersr�z^-\d+$|^-\d*\.\d+$)r]r�r`�description�argument_default�prefix_chars�conflict_handler�_registries�registerrgrnrtrzr}r�r�r�r�r�r��_get_handler�_actions�_option_string_actions�_action_groups�_mutually_exclusive_groups� _defaultsrWrX�_negative_number_matcher�_has_negative_number_optionals)r+r�r�r�r�r`s �r2r`z_ActionsContainer.__init__Ts\���
���/�1�&��� 0���(��� 0������
�
�
�h��l�3��
�
�h���6��
�
�h�
�/@�A��
�
�h��.>�?��
�
�h�
�/@�A��
�
�h��-�8��
�
�h��0B�C��
�
�h���6��
�
�h���4��
�
�h� �>�:��
�
�h� �+<�=��
�
�h��-�8�
������
�&(��#�!���*,��'����),���4I�(J��%�/1��+r4c�F�|jj|i�}|||<yr6)r��
setdefault)r+�
registry_namer1r�registrys r2r�z_ActionsContainer.register�s#���#�#�.�.�}�b�A�� ���r4c�@�|j|j||�Sr6)r�r�)r+r�r1r�s r2�
_registry_getz_ActionsContainer._registry_get�s �����
�.�2�2�5�'�B�Br4c��|jj|�|jD]%}|j|vs�||j|_�'yr6)r��updater�rr�)r+r�r�s r2�set_defaultsz_ActionsContainer.set_defaults�s@�������f�%��m�m�F��{�{�f�$�!'����!4���$r4c��|jD],}|j|k(s�|j�� |jcS|jj |d�Sr6)r�rr�r�r�)r+rr�s r2�get_defaultz_ActionsContainer.get_default�sH���m�m�F��{�{�d�"�v�~�~�'A��~�~�%�$��~�~�!�!�$��-�-r4c��|j}|rt|�dk(r.|dd|vr$|rd|vrtd��|j|i|��}n|j|i|��}d|vrA|d}||j
vr|j
||d<n|j�|j|d<|j|�}t|�std|�d���|di|��}|jd |j|j�}t|�st|�d
���|turt|�d���t|d�r! |j�j|d�|j!|�S#t$rtd
��wxYw)z�
add_argument(dest, ..., name=value, ...)
add_argument(option_string, option_string, ..., name=value, ...)
rcrrz+dest supplied twice for positional argumentr�Nzunknown action "�"r#z is not callablez: is a FileType class object, instance of it must be passedr�z,length of metavar tuple does not match nargsr<)r�r�r��_get_positional_kwargs�_get_optional_kwargsr�r��_pop_action_class�callabler�r#rrr�r�r�_add_action)r+rvr��charsr�action_classr�� type_funcs r2r�z_ActionsContainer.add_argument�s����!�!���s�4�y�A�~�$�q�'�!�*�E�*A���&�(� �!N�O�O�0�T�0�0�$�A�&�A�F�/�T�.�.��?��?�F��F�"��&�>�D��t�~�~�%�$(�N�N�4�$8��y�!��&�&�2�$(�$9�$9��y�!��-�-�f�5����%��l�D�E�E��'��'���&�&�v�v�{�{�F�K�K�H� �� �"��Y�@�A�A��� ��2;�>�?�
?��4�)�*�
Q��#�#�%�2�2�6�4�@�����'�'���
Q� �!O�P�P�
Q�s�8 E)�)E>c�Z�t|g|��i|��}|jj|�|Sr6)�_ArgumentGroupr�r&)r+rvr�r�s r2�add_argument_groupz$_ActionsContainer.add_argument_group�s/���t�5�d�5�f�5�����"�"�5�)��r4c�T�t|fi|��}|jj|�|Sr6)�_MutuallyExclusiveGroupr�r&)r+r�r�s r2�add_mutually_exclusive_groupz._ActionsContainer.add_mutually_exclusive_group�s*��'��7��7���'�'�.�.�u�5��r4c�V�|j|�|jj|�||_|jD]}||j
|<�|jD]F}|jj|�s�|jr�,|jjd��H|S)NT) �_check_conflictr�r&� containerr�r�r��matchr�)r+r�r�s r2rz_ActionsContainer._add_action�s������V�$�
�
�
���V�$����$�2�2�M�9?�D�'�'�
�6�3�$�2�2�M��,�,�2�2�=�A��:�:��7�7�>�>�t�D�3��
r4c�:�|jj|�yr6)r�rWrs r2�_remove_actionz _ActionsContainer._remove_action�s���
�
���V�$r4c��i}|jD]B}|j|vr#td�}t||jz��|||j<�Di}|jD]r}|j|vr?|j |j|j
|j��||j<|jD]}||j||<��t|jD]4}|j|j��}|jD]}|||<� �6|jD]#}|j||�j|��%y)Nz.cannot merge actions - two groups are named %r)�titler�r�)r�)r�rrsr�rr�r�r�r�rr�r�r�r)r+r�title_group_mapr�r�� group_mapr��mutex_groups r2�_add_container_actionsz(_ActionsContainer._add_container_actions�sG�����(�(�E��{�{�o�-��H�I�� �����!4�5�5�+0�O�E�K�K�(� )�� ��-�-�E��{�{�/�1�/3�/F�/F��+�+� %� 1� 1�%*�%;�%;�0G�0=�����,� �.�.��$3�E�K�K�$@� �&�!�/�.�"�9�9�E��;�;����<�)�K� �.�.��$/� �&�!�/�:� �(�(�F��M�M�&�$�'�3�3�F�;�)r4c��d|vrtd�}t|��|jd�}|ttt
tdfvrd|d<t||g��S)Nr�z1'required' is an invalid argument for positionalsr�rT�rr�)rsrr�rrrrrt)r+rr�r�r�s r2rz(_ActionsContainer._get_positional_kwargs#s]������G�H�C��C�.� ��
�
�7�#����<��H�a�H�H�!%�F�:���F��b�9�9r4c��g}g}|D]~}|d|jvr(||jd�}td�}t||z��|j|�t |�dkDs�\|d|jvs�n|j|���|jdd�}|�U|r|d}n|d}|j
|j�}|std�}t|z��|jdd�}t|||� �S)
Nr)�optionr�zNinvalid option string %(option)r: must start with a character %(prefix_chars)rrcrz%dest= is required for options like %rr�rsr) r�rsr�r&r�r��lstrip�replacert) r+rvr�r��long_option_stringsr�r�r�dest_option_strings r2rz&_ActionsContainer._get_optional_kwargs2s���� ��!�M� ��#�t�'8�'8�8�"/�(,�(9�(9�;���G�H�� ��t��,�,�
�!�!�-�0��=�!�A�%�-��*:�d�>O�>O�*O�#�*�*�=�9�"��z�z�&�$�'���<�"�%8��%;�"�%3�A�%6�"�%�,�,�T�->�->�?�D���?�@�� ��}�!4�5�5��<�<��S�)�D��F��n�E�Er4c�L�|jd|�}|jd||�S)Nr�)r�r�)r+r�r�r�s r2rz#_ActionsContainer._pop_action_classTs'�����H�g�.���!�!�(�F�F�;�;r4c��d|jz} t||�S#t$r$td�}t ||jz��wxYw)Nz_handle_conflict_%sz%invalid conflict_resolution value: %r)r�rDrrsr�)r+�handler_func_namer�s r2r�z_ActionsContainer._get_handlerXsV��1�D�4I�4I�I�� :��4�!2�3�3��� :��;�<�C��S�4�#8�#8�8�9�9� :�s ��-A
c���g}|jD]3}||jvs�|j|}|j||f��5|r|j�}|||�yyr6)r�r�r&r�)r+r��confl_optionalsr��confl_optionalr�s r2rz!_ActionsContainer._check_conflictasm����#�2�2�M��� ;� ;�;�!%�!<�!<�]�!K���&�&�
�~�'F�G�3��#�0�0�2���V�_�5�r4c��tddt|��}dj|D��cgc]\}}|�� c}}�}t||z��cc}}w)Nzconflicting option string: %szconflicting option strings: %sr!)rr�r*r)r+r��conflicting_actionsr:r��conflict_strings r2�_handle_conflict_errorz(_ActionsContainer._handle_conflict_errorosf���:�;��2�3�5���)�)�(;�%=�(;�*?���&3�(;�%=�>���F�G�o�$=�>�>��%=s�A
c���|D]d\}}|jj|�|jj|d�|jr�J|jj|��fyr6)r�rWr�r�rr)r+r�r+r�s r2�_handle_conflict_resolvez*_ActionsContainer._handle_conflict_resolvexs^��&9�!�M�6�
�!�!�(�(��7��'�'�+�+�M�4�@��(�(�� � �/�/��7�&9r4r6)r$r=r>r`r�r�r�r�r�rrrrrrrrr�rr-r/rdres@r2r�r�Rsc���01�j!�C�5�.�1(�f�
�
�*%�&<�P
:� F�D<�:�6�?�8r4r�c�>��eZdZd�fd� Z�fd�Z�fd�Z�fd�Z�xZS)rc���|j}|d|j�|d|j�|d|j�tt
|�}|dd|i|��||_g|_|j|_ |j|_
|j|_|j|_|j|_
|j|_y)Nr�r�r�r�r<)r�r�r�r�r]rr`rr�r�r�r�r�r�r�)r+rrr�r�r��
super_initr`s �r2r`z_ArgumentGroup.__init__�s�����"�"���!�9�#=�#=�>��~�y�5�5�6��!�9�#=�#=�>��>�4�9�
��5�{�5�f�5���
� ���%�0�0���!�*�*��
�&/�&F�&F��#�"�,�,����4�4�
�+�*3�*N�*N��'r4c�d��tt|�|�}|jj |�|Sr6)r]rrr�r&�r+r�r`s �r2rz_ArgumentGroup._add_action�s-����~�t�8��@�����"�"�6�*��
r4c�b��tt|�|�|jj |�yr6)r]rrr�rWr4s �r2rz_ArgumentGroup._remove_action�s&���
�n�d�2�6�:����"�"�6�*r4c�Z��tjdtd��t�|�|i|��S)Nz&Nesting argument groups is deprecated.rF��category�
stacklevel)r[�warn�DeprecationWarningr]r�r+rvr�r`s �r2rz!_ArgumentGroup.add_argument_group�s/����
�
�4�'��
�
�w�)�4�:�6�:�:r4�NN)r$r=r>r`rrrrdres@r2rr�s���O�,�
+�;�;r4rc�6��eZdZd�fd� Zd�Zd�Z�fd�Z�xZS)rc�H��tt|�|�||_||_yr6)r]rr`r��
_container)r+rr�r`s �r2r`z _MutuallyExclusiveGroup.__init__�s!���
�%�t�5�i�@� ��
�#��r4c��|jrtd�}t|��|jj |�}|j
j
|�|S)Nz-mutually exclusive arguments must be optional)r�rsr�r@rr�r&)r+r�r�s r2rz#_MutuallyExclusiveGroup._add_action�sK���?�?��C�D�C��S�/�!����,�,�V�4�����"�"�6�*��
r4c�p�|jj|�|jj|�yr6)r@rr�rWrs r2rz&_MutuallyExclusiveGroup._remove_action�s(�����&�&�v�.����"�"�6�*r4c�Z��tjdtd��t�|�|i|��S)Nz0Nesting mutually exclusive groups is deprecated.rFr7)r[r:r;r]rr<s �r2rz4_MutuallyExclusiveGroup.add_mutually_exclusive_group�s/����
�
�>�'��
�
�w�3�T�D�V�D�Dr4)F)r$r=r>r`rrrrdres@r2rr�s���$�
�+�E�Er4rc
���eZdZdZddddgedddddddf
�fd� Zd�Zd�Zd �Zd
�Z d�Z
d#d�Zd#d
�Zd�Z
d�Zd�Zd�Zd�Zd�Zd�Zd�Zd#d�Zd#d�Zd�Zd�Zd�Zd�Zd�Zd�Zd$d�Zd$d�Zd$d �Zd%d!�Z d"�Z!�xZ"S)&raKObject for parsing command line strings into Python objects.
Keyword Arguments:
- prog -- The name of the program (default:
``os.path.basename(sys.argv[0])``)
- usage -- A usage message (default: auto-generated from arguments)
- description -- A description of what the program does
- epilog -- Text following the argument descriptions
- parents -- Parsers whose arguments should be copied into this one
- formatter_class -- HelpFormatter class for printing help messages
- prefix_chars -- Characters that prefix optional arguments
- fromfile_prefix_chars -- Characters that prefix files containing
additional arguments
- argument_default -- The default value for all arguments
- conflict_handler -- String indicating how to handle conflicts
- add_help -- Add a -h/-help option
- allow_abbrev -- Allow long options to be abbreviated unambiguously
- exit_on_error -- Determines whether or not ArgumentParser exits with
error info when an error occurs
Nr�r�Tc ����tt|�
}|||| |
��|�0tjjtjd�}||_||_ ||_
||_||_||_
||_|
|_|j }|t#d��|_|t#d��|_d|_d�}|j+dd|�d|vrdn|d}|jr,|j-|dz|d zd
zd
t.t#d���|D];}|j1|� |j2}|j2j5|��=y#t6$rY�JwxYw)
N)r�r�r�r�rzpositional arguments�optionsc��|Sr6r<)r�s r2�identityz)ArgumentParser.__init__.<locals>.identitys���Mr4r#r��hrFr�zshow this help message and exit)r�r�r�)r]rr`�_os�path�basenamer��argvr\r��epilog�formatter_class�fromfile_prefix_chars�add_help�allow_abbrev�
exit_on_errorrrs�_positionals�
_optionals�_subparsersr�r�rrr�r�r)r+r\r�r�rN�parentsrOr�rPr�r�rQrRrS� superinit� add_grouprH�default_prefixrl�defaultsr`s �r2r`zArgumentParser.__init__�sp����.�$�8� ��k�+�#3�#3� 5��<��8�8�$�$�T�Y�Y�q�\�2�D��� ���
����.���%:��"� ��
�(���*����+�+� �%�a�(>�&?�@���#�A�i�L�1������ ��
�
�f�d�H�-�!$�|� 3���a����=�=�����s�"�N�1�$4�V�$;��x��8�9�
�
;��F��'�'��/�
0�!�+�+�����%�%�h�/���"�
��
�s�5E� E+�*E+c�L�gd�}|D�cgc]}|t||�f��c}Scc}w)N)r\r�r�rOr�rQrCrEs r2r(zArgumentParser._get_kwargs%s/��
��9>�>����w�t�T�*�+��>�>��>rGc��|j�tdtd���|jdt |��d|vsd|vrE|jdtd��}|jdd�}|j
||�|_n|j|_|jd��k|j�}|j�}|j}|j|j||d�|j�j�|d<|j!|d�}|d
d gi|��}|jj#|�|S)Nz(cannot have multiple subparser argumentsr�rr��subcommandsr\ror�r�r<)rVrrsr�r#r�rrTr�r��_get_positional_actionsr�r�r�rzr�rr) r+r�rr�rkr�r��
parsers_classr�s r2�add_subparserszArgumentParser.add_subparsers3s:�����'���a�(R�&S�T�T� ���.�$�t�*�5��f��
�� 7��J�J�w��-�(8�9�E� �*�*�]�D�9�K�#�6�6�u�k�J�D��#�0�0�D���:�:�f��%��+�+�-�I��6�6�8�K��4�4�F�����
�
�K���D�&�2�2�4�:�:�<�F�6�N��.�.�v�y�A�
��;�b�;�F�;�����$�$�V�,��
r4c��|jr|jj|�|S|jj|�|Sr6)r�rUrrTrs r2rzArgumentParser._add_actionRs?��� � ��O�O�'�'��/��
�
���)�)�&�1��
r4c�X�|jD�cgc]}|jr|��c}Scc}wr6�r�r�rs r2�_get_optional_actionsz$ArgumentParser._get_optional_actionsYs4��"�m�m�*�+�F��(�(��+�*� *��*��'c�X�|jD�cgc]}|js|��c}Scc}wr6rdrs r2r_z&ArgumentParser._get_positional_actions^s4��"�m�m�.�+�F��,�,��+�.� .��.rfc���|j||�\}}|rHtd�dj|�z}|jr|j |�|Std|��|S�Nzunrecognized arguments: %sr�)r�rsr*rSr�r�r+rvrMrMr�s r2�
parse_argszArgumentParser.parse_argsfsb���*�*�4��;�
��d���0�1�C�H�H�T�N�B�C��!�!��
�
�3����$�D�#�.�.��r4c��|�tjdd}nt|�}|�
t�}|jD]`}|j
tus�t||j
�r�-|jtus�@t||j
|j��b|jD])}t||�r�t|||j|��+|jr |j||�\}}n|j||�\}}t|t �r/|j#t%|t ��t'|t �||fS#t$r$}|jt|��Yd}~�kd}~wwxYwrb)r�rMr7rr�rrrr�rbr�rS�_parse_known_argsrr�r�r�r�rD�delattr)r+rvrMr�r�errs r2r�zArgumentParser.parse_known_argsps@���<��9�9�Q�R�=�D���:�D���!��I��m�m�F��{�{�(�*��y�&�+�+�6��~�~�X�5�� �6�;�;����G� $��N�N�D��9�d�+�� �4�����)=�>�#�
���
%�"&�"8�"8��y�"I�� �4�#�4�4�T�9�E�O�I�t��9�5�6��K�K�� �+B�C�D��I�6�7��$����!�
%��
�
�3�s�8�$�$��
%�s�"E� E=�E8�8E=c �F���������� �!�"��j��j���i��jD]h}|j}t |j�D]B\}}�j|g�}|j
|d|�|j
||dzd��D�ji�g}t��} t | �D]b\}��dk(r*|jd�| D]�|jd���5�j��}
|
�d}n|
�|<d}|j|��ddj|��t�� t��!d��� �!�fd� �"�������"fd�}�j�������"fd �}
g�d
}�rt��}nd}||kr_t�D�cgc] }||k\r|��c}�}||k7r|
|�}||kDr|}�8|}|�vr�||}�j
|�|}||�}||kr�_|
|�}�j
�|d�g}�jD]�}|� vs�|j r|jt#|���/|j$��<t'|j$t(�s�Wt+�|j,�s�n|j$t/�|j,�us��t1�|j,�j3||j$����|r't5dt7d�d
j|�z���jD]�}|j s�|jD]}|�!vs��&|jD�cgc]}|j8t:urt#|���!}}t7d�}t5d|dj|�z����fScc}wcc}w)NrcrSr��A�Oroc�2��� j|��j||�}|js|rQ�
j|��j|g�D]+}|�
vs�t d�}t|�}t
|||z��|tur|��||�yy)Nznot allowed with argument %s)r��_get_valuesr�r�rsr6rr)r��argument_stringsr��argument_values�conflict_actionr��action_name�action_conflictsrM�seen_actions�seen_non_default_actionsr+s �����r2�take_actionz5ArgumentParser._parse_known_args.<locals>.take_action�s�������V�$�"�.�.�v�7G�H�O��$�$�(8�(�,�,�V�4�'7�';�';�F�B�'G�O�&�*B�B�� >�?��&6��&G��+�F�C�+�4E�F�F� (H��h�.��t�Y���G�/r4c����|}t|�dkDrIdj|D����cgc] \}}}}|��c}}}}�}�|d�}td�}td||z��|d\}}}}�j} g}
|��j�|�|dzS|��| |d�}�j}|dk(r�|d|vr�|dk7r�|s|d|vrtd�}t|||z��|
j|g|f�|d}
|
|dz}�j}||vr$||}|dd}|sdx}}n�|dd k(rd }|dd}n�d}n��j|
|z�|dz}np|dk(r|dz}|g}|
j|||f�nNtd�}t|||z��|dz}�|d}| ||�}||z}�||}|
j|||f�n��E|
sJ�|
D]\}}}�|||��|Scc}}}}w)
Nrcr!)r�matchesz4ambiguous option: %(option)s could match %(matches)srrqrozignored explicit argument %rr)r�r*rsr�_match_argumentr&r�r�)�start_index�
option_tuplesr�r��sep�explicit_argrFrvr��match_argument�
action_tuples� arg_countr�char�
optionals_map�stopr��selected_patterns�
arg_stringr-�arg_strings_pattern�extras�option_string_indicesr+r|s �������r2�consume_optionalz:ArgumentParser._parse_known_args.<locals>.consume_optional�s����2�+�>�M��=�!�A�%��)�)�DQ�%S�DQ�@��
�s�L�&3�DQ�%S�T��",��A���N�O��#�D�#��*�5�5�7D�Q�7G�4�F�M�3��"�1�1�N��M���>��M�M�+�k�":�;�&��?�*� �+� .�v�s� ;�I�
!�-�-�E�!�Q��)�!�,�E�9�(�B�.��,�q�/�U�":�"#�$B�"C�C�"/���l�8J�"K�K�%�,�,�f�b�-�-H�I�,�Q�/��(,�|�A��(>�
�(,�(C�(C�
�(�M�9�%2�=�%A�F�+7���+;�L�#/�59� 9��l�!-�a��C�!7�&)��/;�A�B�/?��&(��"�M�M�$��*=�>�#.��?�D�!�#�a��*�Q��� ,�~��%�,�,�f�d�M�-J�K��
� >�?��+�F�C�,�4F�G�G�(�!�O�E�(;�E�F�(C�%� .�v�7H� I�I� �9�,�D�&�u�T�2�D�!�(�(�&�$�
�)F�G��E�L!� �=�/<�+���m��F�D�-�8�0=��K��k%Ss�Gc����
j}�|d}|� |�}t� |�D]�\}}�|||z}|jtk(r$�|dk(rY|ddk(sJ�|j d�n=|jt
k7r*�j
d|||z�dk\r|j d�||z
}�||���� t|�d� dd|S)Nr�rrS)�_match_arguments_partial�zipr�rrWr�findr�)r��
match_partial�selected_pattern�
arg_countsr�r�rvr-r�r�r+r|s �����r2�consume_positionalsz=ArgumentParser._parse_known_args.<locals>.consume_positionals;s���� �9�9�M�2�;�<�@��&�{�4D�E�J�&)��j�%A�!�� �"�;��i�0G�H���<�<�6�)�*�;�7�3�>�#�A�w�$��.�����D�)��\�\�Y�.�+�0�0��k�1<�y�1H�J�MN�O����D�)��y�(���F�D�)�&B� )��Z��)9�:�K��N��r4rr�z(the following arguments are required: %sr!z#one of the arguments %s is requiredr�r6)rP�_read_args_from_filesr�r�r�r�r��iterr&�_parse_optionalr*r�r_rNrMr�r�r6r�r�r�rrrDrb�
_get_valuerrsr�r)#r+r-rMrr�r��mutex_action� conflicts�arg_string_pattern_parts�arg_strings_iterr��patternr�r�r��max_option_string_indexr��next_option_string_index�positionals_end_index�strings�
stop_index�required_actionsr�r�rFr�ryr�r�r�r�r�rzr{r|s#``` @@@@@@@@@r2rmz ArgumentParser._parse_known_args�s������%�%�1��4�4�[�A�K����:�:�K�'�6�6�M�#,�[�-G�-G�#H���<�,�7�7��b�I� �� � ��r��!2�3�� � ��q�1�u�v�!6�7�$I�;�!#��#%� ���,��&�'7�8�M�A�z��T�!�(�/�/��4�"2�J�,�3�3�C�8�#3�!%� 4� 4�Z� @�
� �(�!�G�/<�)�!�,�!�G�(�/�/��8�#9�(!�g�g�&>�?���u��#&�5� � H� H�([ �[ �~�2�2�4�� � �:���� �&)�*?�&@�#�&(�#��4�4�(+�2�,)�2�E��K�'��2�,)�(*�$��6�6�(;�K�(H�%�)�;�6�"7�K��"7�K��"7�7�%�k�2J�K���
�
�g�&�6��+�;�7�K�5�4�4�:)��5�
� �
�
�k�*�+�.�/����m�m�F��\�)��?�?�$�+�+�,<�V�,D�E����2�"�6�>�>�3�7�� �6�;�;�7����'�)�V�[�[�*I�I�� �6�;�;� $������� G�I�$� ���a�(R�&S��y�y�!1�2�'3�4�
4��4�4�E��~�~�#�2�2�F��!9�9��3�,1�+?�+?�=�+?�� &���8� ;�.�f�5�+?��=��A�B�C�'��c�C�H�H�U�O�.C�D�D�5��&� � ��M,)��~=s�N�$Nc� �g}|D]�}|r|d|jvr|j|��( t|ddtj�tj
���5}g}|j
�j�D])}|j|�D]}|j|���+|j|�}|j|�ddd���|S#1swY�
xYw#t$r}tdt|���d}~wwxYw)Nrrc)r�r�)rPr&r�r��getfilesystemencoding�getfilesystemencodeerrors�readr&�convert_arg_line_to_argsr�r�r�rr�)r+r-�new_arg_stringsr�� args_file�arg_liner/ros r2r�z$ArgumentParser._read_args_from_files�s����%�J���A��d�6P�6P�!P��&�&�z�2�8��j���n�'+�'A�'A�'C�%)�%C�%C�%E�G�JS�&(��(1���(8�(C�(C�(E�H�'+�'D�'D�X�'N�� +� 2� 2�3� 7�(O�)F�'+�&@�&@��&M��'�.�.�{�;�G��&�,��G�G���8�'��c�#�h�7�7��8�s0�5C*�#A/C�C*�C' �#C*�* D
�3D�D
c��|gSr6r<)r+r�s r2r�z'ArgumentParser.convert_arg_line_to_args�s
���z�r4c�x�|j|�}tj||�}|�xdtd�ttd�t
td�i}|j
|j�}|�$tdd|j�|jz}t||��t|jd��S)Nzexpected one argumentzexpected at most one argumentzexpected at least one argumentzexpected %s argumentzexpected %s argumentsrc)�_get_nargs_patternrWrrsrrr�r�rrr�r�)r+r�r��
nargs_patternr�nargs_errorsr�s r2rzArgumentParser._match_argument�s����/�/��7�
�� � �-�)<�=���=��a�/�0��!�;�<��Q�?�@��L�
�"�"�6�<�<�0�C��{��5�6�%�|�|�-�/5�|�|�<�� ���,�,��5�;�;�q�>�"�"r4c ���tt|�dd�D]�}|d|}dj|D�cgc]}|j|���c}�}t j
||�}|��O|j
�D�cgc]
}t|���} }|j�t|�kr(||j�dk(r| r| ds| d=| r| ds�| cSgScc}wcc}w)Nrr�rorr)r�r�r*r�rWrr�r�)
r+r�r�r��
actions_slicer�r�rr�r�s
r2r�z'ArgumentParser._match_arguments_partial�s����s�7�|�Q��+�A�#�B�Q�K�M��g�g�-:�<�-:�6� $�6�6�v�>�-:�<�=�G��I�I�g�':�;�E�� �49�L�L�N�C�N�&�#�f�+�N��C��I�I�K�#�&9�":�:�+�E�I�I�K�8�C�?� ����"�2�J�!�����
�,�� ��<��Ds�C
�8Cc��|sy|d|jvry||jvr|j|}||ddfgSt|�dk(ry|jd�\}}}|r$||jvr|j|}||||fgS|j |�}|r|S|j
j
|�r
|jsyd|vryd|ddfgS)Nrrcrr�)r�r�r�� partition�_get_option_tuplesr�rr�)r+r�r�r�r�r�r�s r2r�zArgumentParser._parse_optional�s�����!�}�� 1� 1�1����4�4�4��0�0��<�F��Z��t�4�5�5��z�?�a���,6�+?�+?��+D�(�
�s�L��=�D�$?�$?�?��0�0��?�F��]�C��>�?�?��/�/�
�;�
�� � �
�(�(�.�.�z�:��6�6���*����z�4��.�/�/r4c��g}|j}|d|vry|d|vrr|jrd|jd�\}}}|sdx}}|jD]:}|j |�s�|j|}||||f}|j|��<|S|d|vr�|d|vr�|jd�\}}}|sdx}}|dd} |dd}
|jD]s}|| k(r'|j|}||d|
f}|j|��/|js�<|j |�s�N|j|}||||f}|j|��u|St
dtd�|z��)NrrcrrFrozunexpected option string: %s)r�rRr�r�rXr&rrs)r+r�r�r�
option_prefixr�r�r�r��short_option_prefix�short_explicit_args r2r�z!ArgumentParser._get_option_tuples s������!�!�����u�$��q�)9�U�)B�� � �3@�3J�3J�3�3O�0�
�s�L��)-�-�C�,�%)�%@�%@�M�$�/�/�
�>�!%�!<�!<�]�!K��$�m�S�,�F���
�
�c�*� &A�>�
�-�1�
��
&�=��+;�5�+H�/<�/F�/F�s�/K�,�M�3���%)�)��l�"/���"3��!.�q�r�!2��!%�!<�!<�
� �$7�7�!�8�8��G�F� �-��5G�G�C��M�M�#�&��&�&�=�+C�+C�M�+R�!�8�8��G�F� �-��l�B�C��M�M�#�&�"=��
� ��a�(F�&G�-�&W�X�Xr4c�J�|j}|j}|�
|rd}|Sd}|S|tk(r
|rd}|Sd}|S|tk(r
|rd}|Sd}|S|tk(r
|rd}|Sd}|S|t
k(r
|rd }|Sd
}|S|tk(r
|rd}|Sd}|S|tk(r
|rd
}|Sd}|S|rd|znd|z}|S)Nz([A])z(-*A-*)z(A?)z(-*A?-*)z(A*)z (-*[A-]*)z(A+)z
(-*A[A-]*)z([AO]*)z(.*)z(A[AO]*)z(-*A[-AO]*)z()z(-*)z
([AO]{%d})z((?:-*A){%d}-*))r�r�rrrrrr)r+r�r�rr�s r2r�z!ArgumentParser._get_nargs_patternH sL�������&�&���=�'-�G�M�>��?4=�M�>��9�h�
�&,�F�M�6��73=�M�6��1�l�
"�&,�F�M�.��/3>�M�.��)�k�
!�&,�F�M�&��'3?�M�&��!�i�
�)/�I�M���6<�M����f�_�*0�J�M���7D�M����h�
�$*�D�M���17�M���5;�L�5�0�@Q�TY�@Y�M��r4c���|j||�\}}|rHtd�dj|�z}|jr|j |�|Std|��|Sri)�parse_known_intermixed_argsrsr*rSr�rrjs r2�parse_intermixed_argsz$ArgumentParser.parse_intermixed_argsv sb���5�5�d�I�F�
��d���0�1�C�H�H�T�N�B�C��!�!��
�
�3����$�D�#�.�.��r4c���|j�}|D�cgc]}|jttfvr|��}}|rt d|djz��|j
D��cgc]#}|jD]}||vr|j���%c}}rt d�� |j} |j�|j�dd|_|D]:}|j|_
t|_|j|_
t|_�<|j||�\}}|D]g}t||j�s�t!||j�gk(s�4ddlm} | d|j�d|���t'||j��i |D]$}|j|_|j|_�& |j)�}
|
D]}|j*|_d|_�|j
D]}|j*|_d|_�|j||�\}}|
D]}|j,|_�|j
D]}|j,|_� ||_||fScc}wcc}}w#|D]$}|j|_|j|_�&wxYw#|
D]}|j,|_�|j
D]}|j,|_�wxYw#|_wxYw) Nz3parse_intermixed_args: positional arg with nargs=%srz;parse_intermixed_args: positional in mutuallyExclusiveGroup�)r:zDo not expect z in F)r_r�rrrr�r�rr�r��
save_nargsrr��save_defaultr�rrDr[r:rnrer��
save_required)r+rvrMr�r��ar��
save_usage�remaining_argsr:r�r�s r2r�z*ArgumentParser.parse_known_intermixed_args� s����2�2�4��"-�
5�+������� 3�3��+��
5���-�-.�q�T�Z�Z�8�9�
9�&*�%D�%D�I�%D�E��.�.��&�K�2G�
�K�K�.�
�%D�I��6�7�
7�. $����J�
9��:�:�%�!%�!2�!2�!4�Q�R�!8�D�J�)�F�(.���F�%�#+�F�L�*0�.�.�F�'�%-�F�N�
*�-1�,A�,A�$�BK�-M�)� �>�)�F�� �6�;�;�7� '� �6�;�;� ?�� C�1�����i�P�Q�� �6�;�;�7�
*�*�F�#)�#4�#4�F�L�%+�%8�%8�F�N�*��2�2�4�I�
9�(�F�+1�?�?�F�(�&+�F�O�(�"�<�<�E�*/�.�.�E�'�%*�E�N�=�%)�$9�$9�.�:C�%E�!� �6�(�F�&,�&:�&:�F�O�(�!�<�<�E�%*�%8�%8�E�N�=�$�D�J��&� � ��u
5��I��:*�F�#)�#4�#4�F�L�%+�%8�%8�F�N�*��"(�F�&,�&:�&:�F�O�(�!�<�<�E�%*�%8�%8�E�N�=��$�D�J�sU�!I,�$(I1�K$�)BI7�=I7�6I7�:K$� AJ%�&:K$�7+J"�"K$�%<K!�!K$�$ K-c���|sv|jtk(rc|jr
|j}n|j}t|t�r,|tur$|j||�}|j||�|S|sO|jtk(r<|js0|j� |j}|j||�|S|}|St|�dk(r>|jdtfvr*|\}|j||�}|j||�|S|jtk(r!|D�cgc]}|j||���}}|S|jtk(r6|D�cgc]}|j||���}}|j||d�|S|jtk(rt}|S|D�cgc]}|j||���}}|D]}|j||��|Scc}wcc}wcc}w)Nrcr)r�rr�rAr�r�r�rr��_check_valuerr�rr)r+r�r-r1r��vs r2rtzArgumentParser._get_values� s����v�|�|�x�7��$�$����������%��%�%�x�*?������6���!�!�&�%�0�P��I�&�,�,�,�">��'�'��~�~�)������!�!�&�%�0�@��9$��8��3��
��
"�v�|�|��h�7G�'G�%�K�J��O�O�F�J�7�E����f�e�,�,��'�\�\�Y�
&�9D�E��A�T�_�_�V�Q�/��E�E�$���\�\�V�
#�9D�E��A�T�_�_�V�Q�/��E�E����f�e�A�h�/����\�\�X�
%��E���:E�E��A�T�_�_�V�Q�/��E�E����!�!�&�!�,�����%F��F��Fs�-G(�!G-�2G2c��|jd|j|j�}t|�std�}t |||z�� ||�}|S#t
$r}t
|�}t ||��d}~wttf$rJt|jdt|j��}||d�}td�}t |||z��wxYw)Nr#z%r is not callabler$)r#r1z!invalid %(type)s value: %(value)r)r�r#rrsrrr�rr�rDr') r+r�r�r r�r�ror0rvs r2r�zArgumentParser._get_value
s����&�&�v�v�{�{�F�K�K�H� �� �"��(�)�C����i��8�8�
4��z�*�F��
��!� -��c�(�C����,�,���:�&� 4��6�;�;�
�D����4E�F�D� �:�6�D��7�8�C����d�
�3�3� 4�s�A� C�!A8�8ACc���|j}|�ft|t�rt|�}||vrF|dj tt|j��d�}td�}t|||z��yy)Nr!)r1r�z3invalid choice: %(value)r (choose from %(choices)s)) r�r�r�r�r*�mapr'rsr)r+r�r1r�rvr�s r2r�zArgumentParser._check_value
st���.�.�����'�3�'��w�-���G�#�!&�#'�9�9�S��v�~�~�-F�#G�I���M�N��#�F�C�$�J�7�7� $�r4c��|j�}|j|j|j|j�|j�Sr6)r�r�r�r�r�rz)r+rks r2r�zArgumentParser.format_usage(
sB���'�'�)� ����D�J�J��
�
� �;�;� =��$�$�&�&r4c���|j�}|j|j|j|j�|j|j�|jD]c}|j|j�|j|j�|j|j�|j��e|j|j�|j�Sr6)r�r�r�r�r�r�r�r�rrr�r�r�rNrz)r+rk�action_groups r2rzzArgumentParser.format_help.
s����'�'�)� � ���D�J�J��
�
� �;�;� =� ���4�+�+�,�!�/�/�L��#�#�L�$6�$6�7����|�7�7�8��#�#�L�$?�$?�@��!�!�#� 0� ���4�;�;�'��$�$�&�&r4c�:�|j|j��S)Nr�)rOr\r:s r2r�zArgumentParser._get_formatterE
s���#�#����#�3�3r4c�h�|�tj}|j|j�|�yr6)r�r�r�r��r+�files r2�print_usagezArgumentParser.print_usageK
s)���<��;�;�D����D�-�-�/��6r4c�h�|�tj}|j|j�|�yr6)r�r�r�rzr�s r2r�zArgumentParser.print_helpP
s)���<��;�;�D����D�,�,�.��5r4c��|r'|xstj} |j|�yy#ttf$rYywxYwr6)r��stderr�writerr�)r+r:r�s r2r�zArgumentParser._print_messageU
sB����&�4�;�;�D�
��
�
�7�#���#�G�,�
��
�s�+�=�=c�r�|r |j|tj�tj|�yr6)r�r�r�r�)r+�statusr:s r2r�zArgumentParser.exit`
s%����������5�� � �&�r4c��|jtj�|j|d�}|j dtd�|z�y)z�error(message: string)
Prints a usage message incorporating the message to stderr and
exits.
If you override this in a subclass, it should not return -- it
should either exit or raise an exception.
)r\r:rFz%(prog)s: error: %(message)s
N)r�r�r�r\r�rs)r+r:rvs r2r�zArgumentParser.errore
s=��
������%�� � �g�6��� � �!�Q�7�8�4�?�@r4r=r6)rN)#r$r=r>r?rr`r(rarrer_rkr�rmr�r�rr�r�r�r�r�r�rtr�r�r�rzr�r�r�r�r�r�rdres@r2rr�s�����,��!���!.�!�'+�"&�")��"�#�=0�D ?��>�*�
.��$�LQ!�f�6�#�,�",0�\*�X(�\�H!�Z1�f�2
8�'�'�.4�7�
6�
��
Ar4r)4r?�__version__�__all__�osrJ�rerW�sysr�r[rrsrrrrrrrr�rrrCrr r
rrr6� Exceptionrrr
rZrrgrnrtrzr}r�r�r�r�r�r�rrr�rrrr<r4r2�<module>r�s���;�z����,����*��������� ��� �.���v��> �"G�F�G�TQ�-�Q�!�6�!��M��:$�}�$�&�?�I�?�( � � �\@�
�\@�@�h��6/�F�6/�r .�6� .�F2��2�.�(��"�)��"#-�F�#-�L-��-�61�6�1�.�&��&�V��8cL��cL�J-�M�-�1:�v�1:�n$� �$�(r8��r8�j ';�&�';�TE�n�E�8cA�%�'8�cAr4
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists