+
    hvh&5  c                   s>   R t ^ RIt^ RIt^ RIt^ RIHtHtHtHtHt ^RI	H
t
 ^ RIHtHt ^ RIHt ]
! R4      t]P#                  ]P%                  4       4      t. ROt ! R
 R]P*                  4      t ! R R]P,                  4      t ! R R	]P.                  4      t]tR# )a-  GOption command line parser.

Extends optparse to use the GOptionGroup, GOptionEntry and GOptionContext
objects. So it is possible to use the gtk, gnome_program and gstreamer command
line groups and contexts.

Use this interface instead of the raw wrappers of GOptionContext and
GOptionGroup in glib.
N)OptParseErrorOptionErrorOptionValueErrorBadOptionErrorOptionConflictError)get_introspection_module)_giPyGIDeprecationWarning)GErrorGLibOptionOptionGroupOptionParserc                   s   a  ] tR t^=t o Rt. ]P                  P                  ORN5t. ]P                  P                  ORNRNRNtR]	P                  ,           tR tR tR	 tR
tV tR# )r
   an  Represents a command line option.

To use the extended possibilities of the GOption API Option
(and make_option) are extended with new types and attributes.

Types:
    filename   The supplied arguments are read as filename, GOption
               parses this type in with the GLib filename encoding.

:ivar optional_arg:
    This does not need a arguement, but it can be supplied.
:ivar hidden:
    The help list does not show this option
:ivar in_main:
    This option apears in the main group, this should only
    be used for backwards compatibility.

Use Option.REMAINING as option name to get all positional arguments.

.. NOTE::
    Every argument to an option is passed as utf-8 coded string, the only
    exception are options which use the 'filename' type, its arguments
    are passed as strings in the GLib filename encoding.

For further help, see optparse.Option.
filenamehiddenin_mainoptional_arg--c                s   \         P                  ! R \        ^R7       \        P                  P
                  ! V .VO5/ VB  V P                  '       g   \        R4      h\        V P                  4      \        V P                  4      8  d   \        R4      hV P                  '       g   \        RV P                  ^ ,          4      hR# )zZgi.repository.GLib.option.Option is deprecated, use gi.repository.GLib.OptionEntry insteadZ
stacklevelz!%s at least one long option name.z;%s at least more long option names than short option names.z%s needs a help message.N)warningswarnr   optparser
   __init__
_long_opts
ValueErrorlen_short_optshelpselfargsZkwargs   &*,1/usr/lib64/python3.14/site-packages/gi/_option.pyr   ZOption.__init___   s    h"	

 	  777@AAt#d&6&6"77M  yyy79KLL     c                s    V P                   V9   d&   V P                  P                  V P                   4       \        P                  P                  W4       \        V P                  4      \        V P                  4      8  d   \        R 4      hR# )zCgoption.Option needs more long option names than short option namesN)		REMAININGr   appendr   r
   _set_opt_stringr   r   r   )r   Zopts   &&r    r$   ZOption._set_opt_stringq   sg    >>T!OO""4>>2''3t 3t#77U  8r!   c              #  s  "   ^ pV P                   '       d"   V\        P                  P                  ,          pV P                  '       d"   V\        P                  P
                  ,          pV P                  4       '       d5   V P                  '       d"   V\        P                  P                  ,          pM!V\        P                  P                  ,          pV P                  R8X  d"   V\        P                  P                  ,          p\        V P                  V P                  4       FX  w  r#V^,          p\        V\         4      '       g   VP#                  R4      pVR,          WAV P$                  V P&                  3x  KZ  	  V P                  \)        V P                  4      R  F&  pVR,          RWP$                  V P&                  3x  K(  	  R# 5i)    r   zutf-8:i   NNNs    )r   r	   ZOptionFlagsZHIDDENr   ZIN_MAINZtakes_valuer   ZOPTIONAL_ARGZNO_ARGZtypeZFILENAMEZzipr   r   
isinstanceZbytesZencoder   Zmetavarr   )r   ZflagsZ	long_nameZ
short_nameZshort_bytess   &    r    _to_goptionentriesZOption._to_goptionentriesz   sQ    ;;;T%%,,,E<<<T%%---E   ))666T%%,,,E99
"T%%...E%($:J:J%K!I$Q-Kk511)009R=+diiNN	 &L T-=-=)>)@AIR=%		4<<HH Bs   AG
6GGD?G N)__name__
__module____qualname____firstlineno____doc__r   r
   ZTYPESZATTRSr	   ZOPTION_REMAININGr"   r   r$   r(   __static_attributes____classdictcell__Z__classdict__   @r    r
   r
   =   so     6 1hoo##0Z0EIhoo##IXIyI.IEt,,,IM$I Ir!   c                   sJ   a  ] tR t^t o RtR	R ltR tR tR
R ltR t	Rt
V tR# )r   a  A group of command line options.

:param str name:
    The groups name, used to create the --help-{name} option
:param str description:
    Shown as title of the groups help view
:param str help_description:
    Shown as help to the --help-{name} option
:param list option_list:
    The options used in this group, must be option.Option()
:param dict defaults:
    A dicitionary of default values
:param translation_domain:
       Sets the translation domain for gettext().

.. NOTE::
    This OptionGroup does not exactly map the optparse.OptionGroup
    interface. There is no parser object to supply, but it is possible
    to set default values and option_lists. Also the default values and
    values are not shared with the OptionParser.

To pass a OptionGroup into a function which expects a GOptionGroup (e.g.
gnome_program_init() ). OptionGroup.get_option_group() can be used.

For further help, see optparse.OptionGroup.
Nc                s0   \         P                  ! R \        ^R7       \        P                  P                  V \        RV4       Wn        RV n        W0n	        V'       d   WPn
        RV n        W`n        V'       d   V F  pV P                  V4       K  	  R# R# )zagi.repository.GLib.option.OptionGroup is deprecated, use gi.repository.GLib.OptionContext insteadr   errorN)r   r   r   r   ZOptionContainerr   r
   nameparserhelp_descriptiondefaultsvaluestranslation_domainZ
add_option)r   r4   descriptionr6   option_listr7   r9   options   &&&&&&& r    r   ZOptionGroup.__init__   sz     	o"	

 	  ))$M	 0$M"4%' & r!   c                s4    . V n         V P                  4        R # N)r;   Z_create_option_mappings)r   s   &r    _create_option_listZOptionGroup._create_option_list   s    $$&r!   c                sj  a a VV 3R  lp\         P                  ! S P                  S P                  S P                  V4      pS P
                  '       d   VP                  S P
                  4       . pS P                   F"  pVP                  VP                  4       4       K$  	  VP                  V4       V# )c                 s  < V P                  R 4      '       d   SP                  V ,          pMSP                  V ,          p VP                  WSP                  S4       R#   \
         dn    \        P                  ! 4       ^,          p\        \        T4      4      p\        Tn        \        P                  P                  Tn        \        T4      Tn        Thi ; ir   N)
startswith	_long_opt
_short_optprocessr8   r   sysexc_infor   strOPTION_CONTEXT_ERROR_QUARKdomainr	   r   	BAD_VALUEcodemessage)option_nameoption_valuegroupoptr3   Zgerrorr5   r   s   &&&   r    callbackZ.OptionGroup._to_goptiongroup.<locals>.callback   s    %%d++nn[1ook2Kt{{FK# q)E
+ :"..88!$Us   A   A8C)r   r   r4   r:   r6   r9   Zset_translation_domainr;   extendr(   add_entries)r   r5   rP   rN   Zentriesr<   s   ff    r    _to_goptiongroupZOptionGroup._to_goptiongroup   s    	  IIt'')>)>
 """(()@)@A&&FNN64467 ' 	'"r!   c                sD    V P                  4        V P                  V4      # )zoReturns the corresponding GOptionGroup object.

Can be used as parameter for gnome_program_init(), gtk_init().
)set_values_to_defaultsrS   )r   r5   r%   r    get_option_groupZOptionGroup.get_option_group   s!    
 	##%$$V,,r!   c                s`   V P                    Fx  pV P                  P                  VP                  4      p\	        V\
        4      '       g   K@  VP                  4       pVP                  W24      V P                  VP                  &   Kz  	  \        P                  ! V P                  4      V n
        R # r=   )r;   r7   ZgetZdestr'   rF   Zget_opt_stringZcheck_valuer   ZValuesr8   )r   r<   ZdefaultZopt_strs   &   r    rT   Z"OptionGroup.set_values_to_defaults   sx    &&Fmm''4G'3'' //1-3-?-?-Qfkk*	 '
 oodmm4r!   )r7   r6   r4   r;   r5   r9   r8   ) NNNr=   )r*   r+   r,   r-   r.   r   r>   rS   rU   rT   r/   r0   r1   r2   r    r   r      s(     6(:'>-5 5r!   c                   sR   a  ] tR tRt o RtR tR tR tR tR t	R t
RR
 ltRtV tR	# )r   i  a  Command line parser with GOption support.

:param bool help_enabled:
    The --help, --help-all and --help-{group} options are enabled (default).
:param bool ignore_unknown_options:
    Do not throw a exception when a option is not knwon, the option
    will be in the result list.

.. NOTE::
    The OptionParser interface is not the exactly the same as the
    optparse.OptionParser interface. Especially the usage parameter
    is only used to show the metavar of the arguements.

OptionParser.add_option_group() does not only accept OptionGroup instances
but also glib.OptionGroup, which is returned by gtk_get_option_group().

Only glib.option.OptionGroup and glib.option.Option instances should
be passed as groups and options.

For further help, see optparse.OptionParser.
c                s   \         P                  ! R \        ^R7       RV9  d
   \        VR&   VP	                  RR4      V n        VP	                  RR4      V n        \        P                  P                  ! V .VO5RR/VB  R# )	zbgi.repository.GLib.option.OptionParser is deprecated, use gi.repository.GLib.OptionContext insteadr   Zoption_classhelp_enabledTignore_unknown_optionsFZadd_help_optionN)
r   r   r   r
   ZpoprW   rX   r   r   r   r   r   r    r   ZOptionParser.__init__  su    p"	

 '%+F>""JJ~t<&,jj1I5&Q#&&tTTTUTVTr!   c                s    Vf
   RV n         R # VP                  R4      '       d   V\        R4      R  V n         R # Wn         R # )NrV   z%prog)usager@   r   )r   rY   r%   r    	set_usageZOptionParser.set_usage&  s6    =DJg&&s7|~.DJJr!   c                s  a a S P                   '       d&   S P                  R ,           S P                   ,           pMS P                  p\        P                  ! V4      pVP	                  S P
                  4       VP                  S P                  4       S P                   FH  p\        V\        P                  4      '       d   TpMVP                  S 4      pVP                  V4       KJ  	  V V3R lp\        P                  ! RRRV4      p. pS P                   F"  p	VP                  V	P                  4       4       K$  	  VP!                  V4       VP#                  V4       V# )z - c                 s   < V P                  R 4      '       d   SP                  V ,          pMSP                  V ,          pVP                  WSS4       R# r?   )r@   rA   rB   rC   )rL   rM   rN   rO   r   r8   s   &&& r    rP   Z1OptionParser._to_goptioncontext.<locals>.callback>  s@    %%d++nn[1ook2KK64@r!   N)r:   rY   r   ZOptionContextZset_help_enabledrW   Zset_ignore_unknown_optionsrX   option_groupsr'   r   rU   Z	add_groupr;   rQ   r(   rR   Zset_main_group)
r   r8   Zparameter_stringcontextZoption_groupZg_grouprP   Z
main_groupZmain_entriesr<   s
   ff        r    _to_goptioncontextZOptionParser._to_goptioncontext.  s   #zzE1D4D4DD#zz##$45  !2!23**4+F+FG ..L,88&&77=g& /	A __T4x@
&&F 9 9 ;< '|,z*r!   c                sv   \        V^ ,          \        4      '       d0   \        P                  P	                  V \        V .VO5/ VB 4       R# \        V4      ^8X  d   V'       g   \        V^ ,          \
        4      '       dI   V^ ,          P                  '       g   W^ ,          n        V^ ,          P                  V Jd   \        R4      h\        V^ ,          \        P
                  4      '       d%   V P                  P                  V^ ,          4       R# \        P                  P                  ! V .VO5/ VB  R# )r&   Nz"invalid OptionGroup (wrong parser))r'   rF   r   r   add_option_groupr   r   r5   r   r   r[   r#   r   r   r    r^   ZOptionParser.add_option_groupN  s    d1gs##!!22k$888 t9>&$q';//Aw~~~%)GN7>>-$%IJJ$q'3??33""))$q'2..tEdEfEr!   c                s    V P                   R ,          pV P                   F@  p\        V\        P                  4      '       g   K%  VP                  VP                   4       KB  	  V# )NNN)r;   r[   r'   r   r   rQ   )r   optionsrN   s   &  r    _get_all_optionsZOptionParser._get_all_options_  sN    ""1%''E%!5!566u001 ( r!   c                s    V P                  V4      pVP                  \        P                  ^ ,          .VO4      R,          VR&   R# )r&   :   NNr_   N)r]   ZparserD   Zargv)r   ZlargsZrargsr8   r\   s   &&&& r    _process_argsZOptionParser._process_argsf  s;    ))&1
 ==#((1+!6!67;ar!   Nc                s    \         P                  P                  WV4      w  r1T P$                   FA  pTP&                  P(                  P+                  4        F  w  rgTP-                  Yg4       K  	  KC  	  Y13#   \         d    \        P
                  ! 4       ^,          pTP                  \        8w  d   h TP                  \        P                  P                  8X  d   \        TP                  4      hTP                  \        P                  P                  8X  d   \        TP                  4      hTP                  \        P                  P                   8X  d   \#        TP                  4      hh i ; i)rb   )r   r   
parse_argsr   rD   rE   rH   rG   rJ   r	   r   rI   r   rK   ZUNKNOWN_OPTIONr   ZFAILEDr    r[   r8   Z__dict__ZitemsZensure_value)r   r   r8   r`   r3   rN   ZkeyZvalues   &&&     r    rd   ZOptionParser.parse_argsn  s   	$11<<TPMG ''E#ll3399;
$$S0 < ( }!  
	LLN1%E||99zzT--777&u}}55zzT--<<<$U]]33zzT--444#EMM22
	s   "A8 8C9E1)rW   rX   rY   )NN)r*   r+   r,   r-   r.   r   rZ   r]   r^   ra   rc   rd   r/   r0   r1   r2   r    r   r     s5     ,
U@F"< r!   )	r   r    r
   r   r   r   r   r   make_option)r.   rD   r   r   r    r   r   r   r   Zmoduler   Zgir   r   Z	gi._errorr   r	   Zquark_to_stringZoption_error_quarkrG   Z__all__r
   r   r   re   r)   r!   r    <module>rf      s   &     - * '!11$2I2I2KL 
VIX__ VIrj5(&& j5Z~8(( ~B r!   