Files
952-11/env/python/dll/Python312/Lib/__pycache__/optparse.cpython-312.pyc
T

449 lines
66 KiB
Plaintext
Raw Normal View History

2024-08-19 17:05:14 +08:00
Ë
*åfbòãó—dZdZgd¢ZdZddlZddlZddlZd„Z ddlmZm Z eZ Gd
„d e «Z
Gd „d
e
«ZGd„de«ZGd„de
«ZGd„de
«ZGd„de«ZGd„d«ZGd„de«ZGd„de«Zd„Zd„Zee d«fee d«fee d«fee d «fd!œZd"„Zd#„Zd$ZGd%„d&«Zd'Zd(Z Gd)„d*«Z!Gd+„d,«Z"Gd-„d.e"«Z#Gd/„d0e"«Z$d1„Z%eZ&y#e
$r d„Zd „Z YŒäwxYw)2a§A powerful, extensible, and easy-to-use option parser.
By Greg Ward <gward@python.net>
Originally distributed as Optik.
For support, use the optik-users@lists.sourceforge.net mailing list
(http://lists.sourceforge.net/lists/listinfo/optik-users).
Simple usage example:
from optparse import OptionParser
parser = OptionParser()
parser.add_option("-f", "--file", dest="filename",
help="write report to FILE", metavar="FILE")
parser.add_option("-q", "--quiet",
action="store_false", dest="verbose", default=True,
help="don't print status messages to stdout")
(options, args) = parser.parse_args()
z1.5.3)ÚOptionÚ make_optionÚ
SUPPRESS_HELPÚSUPPRESS_USAGEÚValuesÚOptionContainerÚ OptionGroupÚ OptionParserÚ
HelpFormatterÚIndentedHelpFormatterÚTitledHelpFormatterÚ
OptParseErrorÚ OptionErrorÚOptionConflictErrorÚOptionValueErrorÚBadOptionErrorÚ check_choicea"
Copyright (c) 2001-2006 Gregory P. Ward. All rights reserved.
Copyright (c) 2002-2006 Python Software Foundation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the author nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
éNcóL—d|jjt|«|fzS)Nz<%s at 0x%x: %s>)Ú __class__Ú__name__Úid©Úselfs úDC:\Users\RCi\AppData\Local\Programs\Python\Python312\Lib\optparse.pyÚ_reprrOs"€Ø  §¡×!8Ñ!8¼"¸T»(ÀDÐ IÑ IÐIó)ÚgettextÚngettextcó—|S©N©)Úmessages rrr\s€Øˆrcó—|dk(r|S|S©Nér!)ÚsingularÚpluralÚns rrr_s€Ø �Š6؈O؈
rcó—eZdZd„Zd„Zy)r
có—||_yr ©Úmsg©rr,s rÚ__init__zOptParseError.__init__hs €Øˆ�rcó—|jSr r+rs rÚ__str__zOptParseError.__str__ks €Ø�x‰xˆrN)rÚ
__module__Ú __qualname__r.r0r!rrr
r
gs „òórr
có—eZdZdZd„Zd„Zy)rz]
Raised if an Option instance is created with invalid or
inconsistent arguments.
có2—||_t|«|_yr )r,ÚstrÚ option_id)rr,Úoptions rr.zOptionError.__init__us€ØˆŒÜ˜V›ˆ�rcój—|jrd|j›d|j›�S|jS)Nzoption z: )r6r,rs rr0zOptionError.__str__ys%€Ø �>‹>Ø&*§n£n°d·h²hÐ?Ð ?à—8‘8ˆOrN©rr1r2Ú__doc__r.r0r!rrrros„ñò
%órrcó—eZdZdZy)rzE
Raised if conflicting options are added to an OptionParser.
N©rr1r2r:r!rrrrs„òrrcó—eZdZdZy)rzS
Raised if an invalid option value is encountered on the command
line.
Nr<r!rrrr„s„òrrcó—eZdZdZd„Zd„Zy)rzB
Raised if an invalid option is seen on the command line.
có—||_yr )Úopt_str©rr@s rr.zBadOptionError.__init__Žs €Øˆ� rcó2—td«|jzS)Nzno such option: %s)Ú_r@rs rr0zBadOptionError.__str__‘s€ÜÐ%Ó&¨¯©Ñ5Ð5rNr9r!rrrrŠs„ñòó6rrcó—eZdZdZd„Zd„Zy)ÚAmbiguousOptionErrorzD
Raised if an ambiguous option is seen on the command line.
có>—tj||«||_yr )rr.Ú
possibilities)rr@rGs rr.zAmbiguousOptionError.__init__˜s€Ü×Ñ  gÔ.Ø*ˆÕrcóh—td«|jdj|j«fzS)Nzambiguous option: %s (%s?)ú, )rCr@ÚjoinrGrs rr0zAmbiguousOptionError.__str__œs2€ÜÐ.Ó/Ø—<‘< §¡¨4×+=Ñ+=Ó!>Ð?ñ@ð ArNr9r!rrrErE”s„ñò+óArrEcón—eZdZdZdZd„Zd„Zd„Zd„Zd„Z d„Z
d „Z d
„Z d „Z
d „Zd
„Zd„Zd„Zd„Zd„Zy)r
aÍ
Abstract base class for formatting option help. OptionParser
instances should use one of the HelpFormatter subclasses for
formatting help; by default IndentedHelpFormatter is used.
Instance attributes:
parser : OptionParser
the controlling OptionParser instance
indent_increment : int
the number of columns to indent per nesting level
max_help_position : int
the maximum starting column for option help text
help_position : int
the calculated starting column for option help text;
initially the same as the maximum
width : int
total number of columns for output (pass None to constructor for
this value to be taken from the $COLUMNS environment variable)
level : int
current indentation level
current_indent : int
current indentation level (in columns)
help_width : int
number of columns available for option help text (calculated)
default_tag : str
text to replace with each option's default value, "%default"
by default. Set to false value to disable default value expansion.
option_strings : { Option : str }
maps Option instances to the snippet of help text explaining
the syntax of that option, e.g. "-h, --help" or
"-fFILE, --file=FILE"
_short_opt_fmt : str
format string controlling how short options with values are
printed in help text. Must be either "%s%s" ("-fFILE") or
"%s %s" ("-f FILE"), because those are the two syntaxes that
Optik supports.
_long_opt_fmt : str
similar but for long options; must be either "%s %s" ("--file FILE")
or "%s=%s" ("--file=FILE").
Únonecód—d|_||_|€" ttjd«}|dz}||_t|t|dz
|dz««x|_
|_ d|_ d|_
d|_||_d|_i|_d|_d|_y#t
t f$rd}YŒ€wxYw) NÚCOLUMNSéPéérz%defaultz%s %sz%s=%s)ÚparserÚindent_incrementÚintÚosÚenvironÚKeyErrorÚ
ValueErrorÚwidthÚminÚmaxÚ
help_positionÚmax_help_positionÚcurrent_indentÚlevelÚ
help_widthÚ short_firstÚ default_tagÚoption_stringsÚ_short_opt_fmtÚ
_long_opt_fmt©rrSr]rYras rr.zHelpFormatter.__init__ÎsÇ€ð
ˆŒ Ø 0ˆÔØ ˆ=ð
ÜœBŸJ™J yÑ1Ó2�ð
�Q‰JˆE؈Œ
äÐ%¤s¨5°2©:Ð7GÈ!Ñ7KÓ'LÓMð NˆÔ˜TÔ3àˆÔ؈Œ
؈ŒØ&ˆÔØ%ˆÔØ ˆÔØ%ˆÔØ$ˆÕøôœjÐ)ò
Ø’ð
ús’BÂB/Â.B/có—||_yr )rR©rrRs rÚ
set_parserzHelpFormatter.set_parserçs €Øˆ� rcóB—|dvrtd|z«‚d|zdz|_y)N)Úú z/invalid metavar delimiter for short options: %rú%s)rXrd©rÚdelims rÚset_short_opt_delimiterz%HelpFormatter.set_short_opt_delimiterês2€Ø ˜ Ñ !ÜØAÀEÑIóKð
Kà" U™l¨TÑ1ˆÕrcóB—|dvrtd|z«‚d|zdz|_y)N)ú=rlz.invalid metavar delimiter for long options: %rrm)rXrerns rÚset_long_opt_delimiterz$HelpFormatter.set_long_opt_delimiterðs2€Ø ˜
Ñ "ÜØ@À5ÑHóJð
Jà! E™\¨DÑ0ˆÕrcól—|xj|jz
c_|xjdz
c_yr$©r^rSr_rs rÚindentzHelpFormatter.indentös&€Ø ×Ò˜t×4Ñ4Ñ4ÕØ �
Š
�a‰Ž
rcó˜—|xj|jzc_|jdk\sJd«‚|xjdzc_y)NrzIndent decreased below 0.r%rurs rÚdedentzHelpFormatter.dedentús@€Ø ×Ò˜t×4Ñ4Ñ4ÕØ×"Ñ" aÒ'ÐDÐ)DÓDÐ'Ø �
Š
�a‰Ž
rcó—td«‚©Nzsubclasses must implement©ÚNotImplementedError©rÚusages rÚ format_usagezHelpFormatter.format_usageÿó€Ü!Ð"=Ó>Ð>rcó—td«‚rzr{©rÚheadings rÚformat_headingzHelpFormatter.format_headingr€rcó˜—t|j|jz
d«}d|jz}tj||||¬«S)z�
Format a paragraph of free-form text for inclusion in the
help output at the current indentation level.
é rl)Úinitial_indentÚsubsequent_indent)r[rYr^ÚtextwrapÚfill)rÚtextÚ
text_widthrvs rÚ _format_textzHelpFormatter._format_textsK€ô
˜Ÿ™ d×&9Ñ&9Ñ9¸2Ó>ˆ
Ø�T×(Ñ(Ñ(ˆÜ�}‰}˜TØ'Ø,2Ø/5ô7ð 7rcó0—|r|j|«dzSy©Nú
rk©r�©rÚ descriptions rÚformat_descriptionz HelpFormatter.format_descriptions€Ù Ø×$Ñ$ [Ó1°DÑ8Ð 8àrcó6—|rd|j|«zdzSyr�r‘)rÚepilogs rÚ
format_epilogzHelpFormatter.format_epilogs#€Ù ؘ$×+Ñ+¨FÓ3Ñ3°dÑ:Ð :àrcó2—|j� |js |jS|jjj |j
«}|t us|€ |j}|jj|jt|««Sr )
rRrbÚhelpÚdefaultsÚgetÚdestÚ
NO_DEFAULTÚNO_DEFAULT_VALUEÚreplacer5)rr7Ú
default_values rÚexpand_defaultzHelpFormatter.expand_defaultsv€Ø �;‰;Ð  d×&6Ò&6Ø—;‘;Ð àŸ ™ ×,Ñ,×0Ñ0°·±Ó=ˆ
Ø œJÑ &¨-Ð*?Ø ×1Ñ1ˆMà�{‰{×"Ñ" 4×#3Ñ#3´S¸Ó5GÓHÐHrc ót—g}|j|}|j|jz
dz
}t|«|kDrd|jd|fz}|j}nd|jd||fz}d}|j |«|j
r~|j
|«}tj||j«}|j d|d|dfz«|j|ddD�cgc]}d|jd|fz‘Œc}«n|ddk7r|j d«dj|«Scc}w) NrPz%*s%s
rkz %*s%-*s rr%éÿÿÿÿr�) rcr\r^ÚlenÚappendr™r¡r‰Úwrapr`ÚextendrJ) rr7ÚresultÚoptsÚ opt_widthÚ indent_firstÚ help_textÚ
help_linesÚlines rÚ
format_optionzHelpFormatter.format_option(s8€ðˆØ×"Ñ" 6Ñ*ˆØ×&Ñ&¨×)<Ñ)<Ñ<¸qÑ@ˆ Ü ˆt‹9�yÒ Ø × 3Ñ 3°R¸Ð>Ñ>ˆDØ×-Ñ-‰Là $×"5Ñ"5°r¸9ÀdÐ!KÑKˆD؈LØ�
‰
�dÔØ �;Š;Ø×+Ñ+¨FÓ3ˆIÜ!Ÿ™ y°$·/±/ÓBˆJØ �M‰M˜) |°R¸ÀA¹Ð&GÑGÔ HØ �M‰MØ'1°!°" ~ö7Ø#ð%¨×(:Ñ(:¸BÀÐ'EÓEò7õ
8à
�"‰X˜Ò
Ø �M‰M˜$Ô Ø�w‰w�v‹Ðùò 7sÃ*D5có‚—|j«d}|jD]D}|j|«}||j|<t |t |«|j z«}ŒF|j«|jD]U}|jD]D}|j|«}||j|<t |t |«|j z«}ŒFŒW|j«|j«t|dz|j«|_ t |j|jz
d«|_
y)NrrPr†)rvÚ option_listÚformat_option_stringsrcr[r¤r^Ú
option_groupsrxrZr]r\rYr`)rrRÚmax_lenÚoptÚstringsÚgroups rÚstore_option_stringsz"HelpFormatter.store_option_stringsKs €Ø � ‰ Œ
؈Ø×%Ñ%ò GˆCØ×0Ñ0°Ó5ˆGØ'.ˆD× Ñ  Ñ $ܘ'¤3 w£<°$×2EÑ2EÑ#EÓF‰Gð Gð
� ‰ Œ
Ø×)Ñ)ò KˆEØ×(Ñ(ò
K�Ø×4Ñ4°SÓ9�Ø+2�×#Ñ# CÑ(ܘg¤s¨7£|°d×6IÑ6IÑ'IÓJ‘ñ
Kð Kð
� ‰ Œ
Ø � ‰ Œ
Ü  ¨1¡¨d×.DÑ.DÓEˆÔܘdŸj™j¨4×+=Ñ+=Ñ=¸rÓBˆ�rcó¨—|j«ry|jxs|jj«}|jD�cgc]}|j
||fz‘Œ}}|j D�cgc]}|j||fz‘Œ}}n|j}|j }|jr||z}n||z}dj|«Scc}wcc}w)z@Return a comma-separated list of option strings & metavariables.rI)
Ú takes_valueÚmetavarrœÚupperÚ _short_optsrdÚ
_long_optsrerarJ)rr7r»ÚsoptÚ
short_optsÚloptÚ long_optsr©s rr²z#HelpFormatter.format_option_strings]sÜ€à × Ñ Ô Ø—n‘nÒ;¨¯ © ×(9Ñ(9Ó(;ˆGà&,×&8Ñ&8ö:Ø"ð×-Ñ-°°w°Ó?ð:ˆJð:ð&,×%6Ñ%6ö8Ø!ð×+Ñ+¨t°W¨oÓ=ð8ˆIñ8ð ×+Ñ+ˆJØ×)Ñ)ˆIà × Ò Ø  Ñ)‰Dà˜zÑ)ˆDà�y‰y˜‹Ðùò:ùò8s ÁC
Á/CN)rr1r2r:ržr.rirprsrvrxrr„r�r”r—r¡r¯r¸r²r!rrr
r
¡s^„ñ'ðRÐò%ò2ò2ò 1ò òò
?ò?ò
7òò òIò!òFCó$rr
có,—eZdZdZ dd„Zd„Zd„Zy)r z.Format help with indented section bodies.
Ncó6—tj|||||«yr ©r
r.rfs rr.zIndentedHelpFormatter.__init__tó €ô
×ÑØ Ð"Ð$5°u¸kõ Krcó—td«|zS)Nz
Usage: %s
)rCr}s rrz"IndentedHelpFormatter.format_usage|s€Ü�Ó %Ñ'Ð'rcó&—d|jd|fzS)Nz%*s%s:
rk)r^r‚s rr„z$IndentedHelpFormatter.format_headings€Ø˜T×0Ñ0°"°gÐ>Ñ>Ð>r)rPéNr%©rr1r2r:r.rr„r!rrr r ps%„ñð#$Ø#%ØØó Kò(ó?rr có,—eZdZdZ dd„Zd„Zd„Zy)r z1Format help with underlined section headers.
Ncó6—tj|||||«yr rÅrfs rr.zTitledHelpFormatter.__init__‡rÆrcóB—|jtd««›d|›d�S)NÚUsagez r�)r„rCr}s rrz TitledHelpFormatter.format_usage�s€Ø!×0Ñ0´°7³Õ<ºeÐDÐDrcóD—|›dd|jt|«z›d�S)Nr�z=-)r_r¤r‚s rr„z"TitledHelpFormatter.format_heading’s€Ú$ d¨4¯:©:Ñ&6¼¸W»Ó&EÐFÐFr)rrÉNrrÊr!rrr r ƒs'„ñð#$Ø#%ØØó KòEóGrr có¤—|ddj«dk(rd}n/|ddj«dk(r d}|ddxsd}n
|dddk(rd}nd}|||«S) NrPÚ0xéÚ0bÚ0r%éé
)Úlower)ÚvalÚtypeÚradixs rÚ
_parse_numrÛ–sg€Ø
ˆ2ˆA€w‡}�}ƒ˜$ÒØ‰Ø ˆRˆaˆ�‰‹˜DÒ ØˆØ�!�"ˆgŠn˜‰Ø ˆRˆaˆ�CŠØ‰àˆá ��UÓ Ðrcó"—t|t«Sr )rÛrT)rØs rÚ
_parse_intrÝ£s€Ü �cœ3Ó ÐrÚintegerzfloating-pointÚcomplex)rTÚlongÚfloatrßcóŽ—t|j\}} ||«S#t$rtt d«|||fz«‚wxYw)Nzoption %s: invalid %s value: %r)Ú _builtin_cvtrÙrXrrC)r7rµÚvalueÚcvtÚwhats rÚ
check_builtinrç«sY€Ü˜vŸ{™{Ñ+�K€Sˆ$ðGÙ�5‹zÐøÜ òGÜÜ
Ð/Ó 0°C¸¸uÐ3EÑ EóGð GðGús ˜  $Acó¨—||jvr|Sdjtt|j««}t t d«|||fz«‚)NrIz.option %s: invalid choice: %r (choose from %s))ÚchoicesrJÚmapÚreprrrC)r7rµrärés rrr³sQ€Ø �—‘ÑØˆ à—)‘)œC¤ f§n¡nÓ5Ó6ˆÜÜ
Ð>Ó ?Ø�E˜7Ð#ñ
$ó%ð %r)ÚNOÚDEFAULTcóÆ—eZdZdZgd¢ZdZdZdZdZdZ dZ
e e e e e d œZ
d
Zd „Zd „Zd
„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„ZeeeeeeegZd„ZeZd„Zd„Zd„Zd„Z d„Z!d„Z"y
)rar
Instance attributes:
_short_opts : [string]
_long_opts : [string]
action : string
type : string
dest : string
default : any
nargs : int
const : any
choices : [string]
callback : function
callback_args : (any*)
callback_kwargs : { string : any }
help : string
metavar : string
) ÚactionrÙrœÚdefaultÚnargsÚconstréÚcallbackÚ
callback_argsÚcallback_kwargsr™r»)
ÚstoreÚ store_constÚ
store_trueÚ store_falser¥Ú append_constÚcountrór™Úversion)rör÷rørùr¥rúrû)rör¥ró)rör¥)r÷rú)ÚstringrTràrárßÚchoice)rTràrárßrþNcó¸—g|_g|_|j|«}|j|«|j |«|j
D]
}||«Œ yr )r½r¾Ú_check_opt_stringsÚ_set_opt_stringsÚ
_set_attrsÚ
CHECK_METHODS)rr©ÚattrsÚcheckers rr.zOption.__init__4s]€ðˆÔ؈ŒØ×&Ñ& tÓ,ˆØ ×јdÔ#ð
�‰˜Ôð×)Ñ)ò ˆGÙ �D�Mñ rcóN—|D�cgc]}|sŒ|‘Œ }}|s td«‚|Scc}w)Nz+at least one option string must be supplied)Ú TypeError©rr©rµs rrzOption._check_opt_stringsGs2€ð $Ö+˜¢s’Ð+ˆÐ+ÙÜÐIÓJÐ J؈ ùò,s…"�"cóR—|D]¢}t|«dkrtd|z|«‚t|«dk(r;|ddk(r|ddk7std|z|«‚|jj|«Œi|dddk(r|ddk7std|z|«‚|jj|«Œ¤y) NrPz>invalid option string %r: must be at least two characters longrú-r%zMinvalid short option string %r: must be of the form -x, (x any non-dash char)ú--zGinvalid long option string %r: must start with --, followed by non-dash)r¤rr½r¥r¾rs rrzOption._set_opt_stringsPsÞ€Øò ,ˆCÜ�3‹x˜!Š|Ü!ð;Ø=@ñAØBFóHðHô�S“˜Q’ؘA™ #š
¨#¨a©&°Cª-Ü%ðHØJMñNàóðð× Ñ ×'Ñ'¨Õ,à˜A˜a˜ DÒ(¨S°©V°sª]Ü%ðCØEHñIàóðð—‘×&Ñ& sÕ+ñ% ,rcó—|jD]>}||vrt||||«||=Œ|dk(rt||t«Œ2t||d«Œ@|r7t|j ««}t ddj
|«z|«‚y)Nrðzinvalid keyword arguments: %srI)ÚATTRSÚsetattrr�ÚsortedÚkeysrrJ)rrÚattrs rrzOption._set_attrsesŽ€Ø—J‘Jò .ˆDØ�u‰}ܘ˜d E¨$¡KÔ0ؘ$‘Kà˜9Ò$ܘD $¬
Õ3ä˜D $¨Õ-ð .ñ ܘ5Ÿ:™:›<Ó(ˆEÜØ/°$·)±)¸EÓ2BÑBØóð
ð rcóŽ—|j€d|_y|j|jvrtd|jz|«‚y)Nrözinvalid action: %r)rïÚACTIONSrrs rÚ
_check_actionzOption._check_actionxs?€Ø �;‰;Ð Ø!ˆD�KØ
�[‰[ § ¡ Ñ
,ÜÐ2°T·[±[Ñ@À$ÓGÐ Gð-rcóà—|j€5|j|jvr|j�d|_yd|_yyt |jt«r|jj
|_|jdk(rd|_|j|j vrtd|jz|«‚|j|jvrtd|jz|«‚y)Nrþrýr5zinvalid option type: %rz$must not supply a type for action %r) rÙrïÚALWAYS_TYPED_ACTIONSréÚ
isinstancerÚTYPESrÚ
TYPED_ACTIONSrs rÚ _check_typezOption._check_type~sÌ€Ø �9‰9Ð Ø�{‰{˜d×7Ñ7Ñ7Ø—<‘<Ð+à (�D•Ið!)�D•Ið
8ô˜$Ÿ)™)¤TÔ*Ø ŸI™I×.Ñ.�” à�y‰y˜EÒ!Ø$�” à�y‰y §
¡
Ñ*Ü!Ð";¸d¿i¹iÑ"GÈÓNÐNØ�{‰{ $×"4Ñ"4Ñ4Ü!Ø:¸T¿[¹[ÑHÈ$óPðPð5rcóX—|jdk(rv|j€ td|«‚t|jtt
f«s=tdt
t|j««jd«dz|«‚y|j�td|jz|«‚y)Nrþz/must supply a list of choices for type 'choice'z1choices must be a list of strings ('%s' supplied)ú'r%z#must not supply choices for type %r)rÙrérrÚtupleÚlistr5Úsplitrs rÚ
_check_choicezOption._check_choice–s¬€Ø �9‰9˜Ò Ø�|‰|Ð#Ü!ØEÀtóMðMä § ¡ ¬u´d¨mÔ<Ü!ØGÜœ$˜tŸ|™|Ó,Ó-×3Ñ3°CÓ8¸Ñ;ñ<Ø=AóCðCð=ð�\‰\Ð
%ÜØ5¸¿ ¹ ÑAÀ4óIð
Ið&rcó
—|j|jvxs|jdu}|j€O|rL|jr(|jdddj dd«|_y|j dd|_yyy)NrrPr
rCr%)rïÚ
STORE_ACTIONSrÙrœr¾rŸr½)rrºs rÚ _check_destzOption._check_dest£s„€ð—{‘{ d×&8Ñ&8Ð8ò-Ø—y‘y¨Ð,ð à �9‰9Ð ¡ð�Šà ŸO™O¨AÑ.¨q¨rÐ2×:Ñ:¸3ÀÓD�• à ×,Ñ,¨QÑ/°Ñ2�• ð"-Ð rcó€—|j|jvr&|j�td|jz|«‚yy)Nz*'const' must not be supplied for action %r)rïÚ
CONST_ACTIONSròrrs rÚ _check_constzOption._check_const²sB€Ø �;‰;˜d×0Ñ0Ñ 0°T·Z±ZÐ5KÜØ<¸t¿{¹{ÑJØóð
ð6LÐ 0rcó¨—|j|jvr|j€d|_yy|j�td|jz|«‚y)Nr%z*'nargs' must not be supplied for action %r)rïrrñrrs rÚ _check_nargszOption._check_nargs¸sU€Ø �;‰;˜$×,Ñ,Ñ ,Ø�z‰zÐ!Ø�•
ð"à
�Z‰ZÐ
#ÜØ<¸t¿{¹{ÑJØóð
ð$rcó(—|jdk(r®t|j«std|jz|«‚|j�3t |jt «std|jz|«‚|j�4t |jt«std|jz|«‚yy|j�td|jz|«‚|j� td|«‚|j� td|«‚y)Nrózcallback not callable: %rz3callback_args, if supplied, must be a tuple: not %rz4callback_kwargs, if supplied, must be a dict: not %rz.callback supplied (%r) for non-callback optionz.callback_args supplied for non-callback optionz0callback_kwargs supplied for non-callback option) rïÚcallablerórrôrrrõÚdictrs rÚ_check_callbackzOption._check_callbackÁs/€Ø �;‰;˜*Ò $ܘDŸM™MÔ*Ü!Ø/°$·-±-Ñ?ÀóGðGà×"Ñ"Ð.ܘt×1Ñ1´5Ô9Ü!ØIØ×(Ñ(ñ)Ø*.ó0ð0ð×$Ñ$Ð0ܘt×3Ñ3´TÔ:Ü!ØJØ×*Ñ*ñ+Ø,0ó2ð2ð;ð1ð �}‰}Ð(Ü!ØDØ—m‘mñ$Ø%)ó+ð+ð×!Ñ!Ð-Ü!ØDÀdóLðLà×#Ñ#Ð/Ü!ØFÈóNðNð0rcóR—dj|j|jz«S)Nú/)rJr½r¾rs rr0zOption.__str__ès €Ø�x‰x˜×(Ñ(¨4¯?©?Ñ:Ó;Ð;rcó—|jduSr )rÙrs rrºzOption.takes_valueís€Ø�y‰y Ð$Ð$rcóV—|jr|jdS|jdS©Nr)r¾r½rs rÚget_opt_stringzOption.get_opt_stringðs)€Ø �?Š?Ø—?‘? 1Ñ%Ð %à×#Ñ# AÑ&Ð &rcóh—|jj|j«}|€|S||||«Sr )Ú TYPE_CHECKERr›rÙ)rrµrärs rÚ check_valuezOption.check_valueùs5€Ø×#Ñ#×'Ñ'¨¯ © Ó2ˆØ ˆ?؈Lá˜4  eÓ,Ð ,rc ó¦—|�J|jdk(r|j||«St|D�cgc]}|j||«‘Œc}«Sycc}wr$)rñr5r)rrµräÚvs rÚ
convert_valuezOption.convert_valuesT€Ø Ð Ø�z‰z˜QŠØ×'Ñ'¨¨UÓ3Ð3äÀÖF¸1˜d×.Ñ.¨s°AÕ6ÒFÓGÐGð ùòGs­Acóz—|j||«}|j|j|j||||«Sr )r8Ú take_actionrïrœ)rrµräÚvaluesrRs rÚprocesszOption.processsB€ð×"Ñ" 3¨Ó.ˆð
×ÑØ �K‰K˜Ÿ™ C¨°¸ó@ð @rcóð—|dk(rt|||«y |dk(rt|||j«y |dk(rt||d«y |dk(rt||d«y |dk(r"|j|g«j|«y |dk(r,|j|g«j|j«y |d k(r!t|||j|d
«d z«y |d k(r:|jxsd
}|j
xsi}|j ||||g|¢­i|¤Žy |dk(r!|j«|j«y |dk(r!|j«|j«y td|jz«‚)Nrör÷røTrùFr¥rúrûrr%rór!r™rüzunknown action %r) rròÚ ensure_valuer¥rôrõróÚ
print_helpÚexitÚ
print_versionrXrï) rrïrœrµrär;rRÚargsÚkwargss rr:zOption.take_actions¡€Ø �WÒ Ü �F˜D %Ô (ð4ð3�}Ò
$Ü �F˜D $§*¡*Ô -ð0ð/�|Ò
#Ü �F˜D $Ô 'ð,ð+�}Ò
$Ü �F˜D %Ô (ð(ð'�xÒ
Ø × Ñ   bÓ )× 0Ñ 0°Ô 7ð$ð#�~Ò
%Ø × Ñ   bÓ )× 0Ñ 0°·±Ô <ð ð�wÒ
Ü �F˜D &×"5Ñ"5°d¸AÓ">ÀÑ"BÔ Cðð�zÒ
!Ø×%Ñ%Ò+¨ˆDØ×)Ñ)Ò/¨RˆFØ ˆD�M‰M˜$  U¨FÐ D°TÒ D¸VÒ Dðð�vÒ
Ø × Ñ Ô Ø �K‰KŒMðð
�yÒ
Ø × Ñ Ô "Ø �K‰KŒMðôÐ0°4·;±;Ñ>Ó?Ð ?r)#rr1r2r:r
rr"rrr%rrçrr4rr.rrrrrr r#r&r(r,r0rÚ__repr__rºr2r5r8r<r:r!rrrrÁsÞ„ñò*
€Eð €Gð€Mð!€Mð &Ðð%€Mð
D€Eð$!.Ø -Ø -Ø -Ø ,ñ €Lð €Mò
ò&ò,ò*ò&Hò Pò0 Iò
3òò òNð8#Ø Ø"Ø Ø!Ø!Ø$ð
&€Mò<ð€Hò%ò'ò-òHò
@órrÚ SUPPRESSHELPÚ
SUPPRESSUSAGEcóL—eZdZd d„Zd„ZeZd„Zd„Zd„Z d„Z
d d„Z d d „Z d
„Z
y)
rNcóT—|r&|j«D]\}}t|||«Œyyr )Úitemsr)rršrrØs rr.zValues.__init__9s0€Ù Ø'Ÿ~™~Ó/ò
)‘ ��sܘ˜d CÕ(ñ
)ð rcó,—t|j«Sr )r5Ú__dict__rs rr0zValues.__str__>s€Ü�4—=‘=Ó!Ð!rcóž—t|t«r|j|jk(St|t«r|j|k(StSr )rrrKr+ÚNotImplemented)rÚothers rÚ__eq__z
Values.__eq__Cs>€Ü �eœVÔ $Ø—=‘= E§N¡NÑ2Ð 2Ü
˜œtÔ
$Ø—=‘= EÑ)Ð )ä!Ð !rcóX—t|«D]}||vsŒ||}|€Œt|||«Œy)zû
Update the option values from an arbitrary dictionary, but only
use keys from dict that already have a corresponding attribute
in self. Any keys in dict without a corresponding attribute
are silently ignored.
N)Údirr)rr+rÚdvals rÚ_update_carefulzValues._update_carefulKs9€ô˜“Iò .ˆDØ�tŠ|ؘD‘z�ØÑ#ܘD $¨Õ-ñ  .rcó:—|jj|«y)zÅ
Update the option values from an arbitrary dictionary,
using all keys from the dictionary regardless of whether
they have a corresponding attribute in self or not.
N)rKÚupdate)rr+s rÚ
_update_loosezValues._update_looseXs€ð
�
‰
×јTÕ"rcóz—|dk(r|j|«y|dk(r|j|«ytd|z«‚)NÚcarefulÚloosezinvalid update mode: %r)rSrVrX)rr+Úmodes rÚ_updatezValues._update`s>€Ø �9Ò Ø × Ñ  Õ &Ø
�WŠ_Ø × Ñ ˜tÕ $äÐ6¸Ñ=Ó>Ð >rcóv—t|«tj|}|jt |«|«yr )Ú
__import__ÚsysÚmodulesr[Úvars)rÚmodnamerZÚmods rÚ read_modulezValues.read_modulehs*€Ü�7ÔÜ�k‰k˜'Ñ"ˆØ � ‰ ”T˜#“Y Õ%rcór—i}tt|«j«|«|j||«yr )ÚexecÚopenÚreadr[)rÚfilenamerZr`s rÚ read_filezValues.read_filems,€ØˆÜ ŒT�(‹^×
Ñ
Ó
" DÔ)Ø � ‰ �T˜4Õ rcód—t||«r t||«€
t|||«t||«Sr )ÚhasattrÚgetattrr)rrräs rr>zValues.ensure_valuers1€Ü�t˜TÔ"¤g¨d°DÓ&9Ð&AÜ �D˜$ Ô &Ü�t˜TÓ"Ð"rr )rX)rr1r2r.r0rrDrOrSrVr[rcrir>r!rrrr7s6„ó)ò
"ð€Hò"ò .ò#ò?ó&ó
!ó
#rrcóp—eZdZdZd„Zd„Zd„Zd„Zd„Zd„Z d„Z
d „Z d
„Z d „Z
d „Zd
„Zd„Zd„Zd„Zd„Zy)ra’
Abstract base class.
Class attributes:
standard_option_list : [Option]
list of standard options that will be accepted by all instances
of this parser class (intended to be overridden by subclasses).
Instance attributes:
option_list : [Option]
the list of Option objects contained by this OptionContainer
_short_opt : { string : Option }
dictionary mapping short option strings, eg. "-f" or "-X",
to the Option instances that implement them. If an Option
has multiple short option strings, it will appear in this
dictionary multiple times. [1]
_long_opt : { string : Option }
dictionary mapping long option strings, eg. "--file" or
"--exclude", to the Option instances that implement them.
Again, a given Option can occur multiple times in this
dictionary. [1]
defaults : { string : any }
dictionary mapping option destination names to default
values for each destination [1]
[1] These mappings are common to (shared by) all components of the
controlling OptionParser, where they are initially created.
cóv—|j«||_|j|«|j|«yr )Ú_create_option_listÚ option_classÚset_conflict_handlerÚset_description)rrpÚconflict_handlerr“s rr.zOptionContainer.__init__˜s5€ð
× Ñ Ô"à(ˆÔØ ×!Ñ!Ð"2Ô3Ø ×ј[Õ)rcó.—i|_i|_i|_yr ©Ú
_short_optÚ _long_optršrs rÚ_create_option_mappingsz'OptionContainer._create_option_mappings£s€ðˆŒØˆŒØˆ�
rcój—|j|_|j|_|j|_yr rurhs rÚ_share_option_mappingsz&OptionContainer._share_option_mappings¬s)€ð!×+Ñ+ˆŒØ×)Ñ)ˆŒØŸ™ˆ�
rcó6—|dvrtd|z«‚||_y)N)ÚerrorÚresolvez$invalid conflict_resolution value %r)rXrs)rÚhandlers rrqz$OptionContainer.set_conflict_handler³s$€Ø Ð.Ñ .ÜÐCÀgÑMÓNÐ NØ 'ˆÕrcó—||_yr ©r“r’s rrrzOptionContainer.set_description¸s
€Ø&ˆÕrcó—|jSr r€rs rÚget_descriptionzOptionContainer.get_description»s€Ø×ÑÐrcó—|`|`|`y©zsee OptionParser.destroy().Nrurs rÚdestroyzOptionContainer.destroy¿s€à ˆOØ ˆNØ ‰Mrc
óú—g}|jD]1}||jvsŒ|j||j|f«Œ3|jD]1}||jvsŒ|j||j|f«Œ3|rò|j
}|dk(r/t
ddj|D�cgc]}|d‘Œ c}«z|«‚|dk(r¬|D]¦\}}|jd«r)|jj|«|j|=n(|jj|«|j|=|jrŒu|jrŒ‚|jjj|«Œ¨yyycc}w)Nr|z conflicting option string(s): %srIrr}r ) r½rvr¥r¾rwrsrrJÚ
startswithÚremoveÚ containerr±)rr7Ú
conflict_optsrµr~ÚcoÚc_options rÚ_check_conflictzOptionContainer._check_conflictÈsy€Øˆ
Ø×%Ñ%ò BˆCØ�d—o‘oÒ%Ø×$Ñ$ c¨4¯?©?¸3Ñ+?Ð%@ÕAð Bð×$Ñ$ò AˆCØ�d—n‘nÒ$Ø×$Ñ$ c¨4¯>©>¸#Ñ+>Ð%?Õ@ð Añ Ø×+Ñ+ˆGؘ'Ò!Ü)Ø6Ø—i‘i°Ö ?¨2  A£Ò ?Ó@ñAàóðð˜IÒ%Ø'4òH‘O�S˜(Ø—~‘~ dÔ+Ø ×+Ñ+×2Ñ2°3Ô7Ø ŸN™N¨3Ñ/à ×,Ñ,×3Ñ3°CÔ8Ø ŸO™O¨CÐ0Ø$×0Ó0°H×4GÓ4GØ ×*Ñ*×6Ñ6×=Ñ=¸hÕGñHð&ð ùò
!@sÂ+ E8cóœ—t|dt«r|j|i|¤Ž}n>t|«dk(r%|s#|d}t|t«st d|z«‚t d«‚|j
|«|jj|«||_ |jD]}||j|<Œ|jD]}||j|<Œ|j�h|jt ur%|j|j"|j<|S|j|j"vrd|j"|j<|S)zOadd_option(Option)
add_option(opt_str, ..., kwarg=val, ...)
rr%znot an Option instance: %rúinvalid argumentsN)rr5rpr¤rrr�r±r¥r‰r½rvr¾rwrœrðr�rš)rrBrCr7rµs rÚ
add_optionzOptionContainer.add_optionãs4€ô �d˜1‘gœsÔ #Ø&�T×&Ñ&¨Ð7°Ñ7‰FÜ
�‹Y˜!Š^¡Fؘ!‘WˆFܘf¤fÔ-ÜÐ <¸vÑ EÓFÐFäÐ/Ó0Ð 0à ×јVÔ$à ×Ñ×Ñ Ô'ØˆÔØ×%Ñ%ò *ˆCØ#)ˆD�O‰O˜CÒ ð *à×$Ñ$ò )ˆCØ"(ˆD�N‰N˜3Ò ð )ð �;‰;Ð "Ø�~‰~¤ZÑ/Ø-3¯^©^�—
‘
˜fŸk™kÑ*ðˆ
ð—‘ D§M¡MÑ1Ø-1�—
‘
˜fŸk™kÑ*àˆ
rcó4—|D]}|j|«Œyr )r�)rr±r7s rÚ add_optionszOptionContainer.add_optionss€Ø!ò $ˆFØ �O‰O˜FÕ #ñ $rcór—|jj|«xs|jj|«Sr )rvr›rwrAs rÚ
get_optionzOptionContainer.get_options0€Ø—‘×#Ñ# GÓ,ò,Ø—‘×"Ñ" 7Ó+ð -rcó>—||jvxs||jvSr )rvrwrAs rÚ
has_optionzOptionContainer.has_option s$€Ø˜4Ÿ?™?Ð*ò*ؘ4Ÿ>™>Ð)ð +rcóV—|jj|«}|€|jj|«}|€td|z«‚|jD]}|j|=Œ|j
D]}|j|=Œ|j jj|«y)Nzno such option %r) rvr›rwrXr½r¾r‰r±rˆ)rr@r7rµs rÚ
remove_optionzOptionContainer.remove_options¡€Ø—‘×$Ñ$ WÓ-ˆØ ˆ>Ø—^‘^×'Ñ'¨Ó0ˆFØ ˆ>ÜÐ0°7Ñ:Ó;Ð ;à×%Ñ%ò %ˆCØ—‘ Ñ$ð %à×$Ñ$ò $ˆCØ—‘˜sÑ#ð $à×Ñ×$Ñ$×+Ñ+¨FÕ3rcóÊ—|jsyg}|jD]5}|jtusŒ|j|j |««Œ7dj |«S©Nrk)r±r™rr¥r¯rJ)rÚ formatterr¨r7s rÚformat_option_helpz"OptionContainer.format_option_helps[€Ø×ÒØØˆØ×&Ñ&ò ?ˆFØ—;‘;¤-Ò/Ø—
‘
˜i×5Ñ5°fÓ=Õ>ð ?ð�w‰w�v‹Ðrcó@—|j|j««Sr )r”r‚©rr›s rr”z"OptionContainer.format_description(s€Ø×+Ñ+¨D×,@Ñ,@Ó,BÓCÐCrcóØ—g}|jr |j|j|««|jr |j|j |««dj |«S)Nr�)r“r¥r”r±rœrJ©rr›r¨s rÚ format_helpzOptionContainer.format_help+sV€ØˆØ × Ò Ø �M‰M˜$×1Ñ1°)Ó<Ô =Ø × Ò Ø �M‰M˜$×1Ñ1°)Ó<Ô =Ø�y‰y˜Ó Ð rN)rr1r2r:r.rxrzrqrrr‚r…r�r�r’r”r–r˜rœr”r¡r!rrrrxsY„ñò< *òò(ò(ò
'ò òòHò6ò<$ò -ò+ò 4ò òDó!rrcó,—eZdZdd„Zd„Zd„Zd„Zd„Zy)rNcóx—||_tj||j|j|«||_yr )rRrr.rprsÚtitle)rrRr¤r“s rr.zOptionGroup.__init__6s4€ØˆŒ Ü× Ñ Ø �&×%Ñ% v×'>Ñ'>À ô Màˆ�
rcóH—g|_|j|j«yr )r±rzrRrs rrozOptionGroup._create_option_list<s€ØˆÔØ ×#Ñ# D§K¡KÕ0rcó—||_yr )r¤)rr¤s rÚ set_titlezOptionGroup.set_title@s €Øˆ�
rcó2—tj|«|`yr„)rr…r±rs rr…zOptionGroup.destroyCs€ä×Ñ Ô%Ø Ñ rcó®—|j|j«}|j«|tj ||«z
}|j «|Sr )r„r¤rvrr¡rxr s rr¡zOptionGroup.format_helpJsJ€Ø×)Ñ)¨$¯*©*Ó5ˆØ×ÑÔØ”/×-Ñ-¨d°IÓ>Ñ>ˆØ×ÑÔØˆ
rr )rr1r2r.ror§r…r¡r!rrrr4s„óò 1òòórrc
ó—eZdZdZgZddedddddddf
d„Zd„Zd„Zd„Z d „Z
d*d
„Z d „Z d „Z
d
„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd+d„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z d,d „Z!d!„Z"d"„Z#d-d#„Z$d$„Z%d-d%„Z&d-d&„Z'd'„Z(d-d(„Z)d-d)„Z*y).r a$
Class attributes:
standard_option_list : [Option]
list of standard options that will be accepted by all instances
of this parser class (intended to be overridden by subclasses).
Instance attributes:
usage : string
a usage string for your program. Before it is displayed
to the user, "%prog" will be expanded to the name of
your program (self.prog or os.path.basename(sys.argv[0])).
prog : string
the name of the current program (to override
os.path.basename(sys.argv[0])).
description : string
A paragraph of text giving a brief overview of your program.
optparse reformats this paragraph to fit the current terminal
width and prints it when the user requests help (after usage,
but before the list of options).
epilog : string
paragraph of help text to print after option help
option_groups : [OptionGroup]
list of option groups in this parser (option groups are
irrelevant for parsing the command-line, but very useful
for generating help)
allow_interspersed_args : bool = true
if true, positional arguments may be interspersed with options.
Assuming -a and -b each take a single argument, the command-line
-ablah foo bar -bboo baz
will be interpreted the same as
-ablah -bboo -- foo bar baz
If this flag were false, that command line would be interpreted as
-ablah -- foo bar -bboo baz
-- ie. we stop processing options as soon as we see the first
non-option argument. (This is the tradition followed by
Python's getopt module, Perl's Getopt::Std, and other argument-
parsing libraries, but it is generally annoying to users.)
process_default_values : bool = true
if true, option default values are processed similarly to option
values from the command line: that is, they are passed to the
type-checking function for the option's type (as long as the
default value is a string). (This really only matters if you