0 $Wˆl–Ým_J •5*�Æ™¸ÐţР„ŸÏÀÔ)æWa f¥_T3ã@s°dZddlZddlZddlmZmZmZmZmZddlm Z ddl m Z ddl m Z e dƒZe e ¡¡Zgd ¢ZGd d „d ejƒ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)ÚGErrorÚGLib) rrrrrÚOptionÚ OptionGroupÚ OptionParserÚ make_optionc@sNeZdZdZejjdZejjgd¢Zdej Z dd„Z dd„Z d d „Z d S) 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ú--cOs^tjj|g|¢Ri|¤Ž|js(tdƒ‚t|jƒt|jƒkrDtdƒ‚|jsZtd|jdƒ‚dS)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Ú 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)rZoptsr r r!r$js  zOption._set_opt_stringccsðd}|jr|tjjO}|jr(|tjjO}| ¡rD|jrP|tjjO}n |tjj O}|j dkrf|tjj O}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 Z OptionFlagsZHIDDENrZIN_MAINZ takes_valuerZ OPTIONAL_ARGZNO_ARGÚtypeZFILENAMEÚziprrÚ isinstanceÚbytesÚencoderÚmetavarr)rÚflagsZ long_nameZ short_nameZ short_bytesr r r!Ú_to_goptionentriesrs$       zOption._to_goptionentriesN)Ú__name__Ú __module__Ú __qualname__Ú__doc__rr ZTYPESZATTRSr ZOPTION_REMAININGr"rr$r.r r r r!r 7s   r c@s<eZdZdZddd„Zdd„Zdd „Zdd d „Zd d „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 translati