/opt/alt/python34/lib64/python3.4/__pycache__
NameSizeModeActions
abc.cpython-34.pyc78770644editdlrm
abc.cpython-34.pyo78270644editdlrm
aifc.cpython-34.pyc279120644editdlrm
aifc.cpython-34.pyo279120644editdlrm
antigravity.cpython-34.pyc8470644editdlrm
antigravity.cpython-34.pyo8470644editdlrm
argparse.cpython-34.pyc658740644editdlrm
argparse.cpython-34.pyo657150644editdlrm
ast.cpython-34.pyc123600644editdlrm
ast.cpython-34.pyo123600644editdlrm
asynchat.cpython-34.pyc83590644editdlrm
asynchat.cpython-34.pyo83590644editdlrm
asyncore.cpython-34.pyc179630644editdlrm
asyncore.cpython-34.pyo179630644editdlrm
base64.cpython-34.pyc182970644editdlrm
base64.cpython-34.pyo180990644editdlrm
bdb.cpython-34.pyc186940644editdlrm
bdb.cpython-34.pyo186940644editdlrm
binhex.cpython-34.pyc135410644editdlrm
binhex.cpython-34.pyo135410644editdlrm
bisect.cpython-34.pyc28580644editdlrm
bisect.cpython-34.pyo28580644editdlrm
bz2.cpython-34.pyc151560644editdlrm
bz2.cpython-34.pyo151560644editdlrm
calendar.cpython-34.pyc275670644editdlrm
calendar.cpython-34.pyo275670644editdlrm
cgi.cpython-34.pyc298270644editdlrm
cgi.cpython-34.pyo298270644editdlrm
cgitb.cpython-34.pyc110640644editdlrm
cgitb.cpython-34.pyo110640644editdlrm
chunk.cpython-34.pyc52700644editdlrm
chunk.cpython-34.pyo52700644editdlrm
cmd.cpython-34.pyc134560644editdlrm
cmd.cpython-34.pyo134560644editdlrm
code.cpython-34.pyc97020644editdlrm
code.cpython-34.pyo97020644editdlrm
codecs.cpython-34.pyc351320644editdlrm
codecs.cpython-34.pyo351320644editdlrm
codeop.cpython-34.pyc64660644editdlrm
codeop.cpython-34.pyo64660644editdlrm
colorsys.cpython-34.pyc36590644editdlrm
colorsys.cpython-34.pyo36590644editdlrm
compileall.cpython-34.pyc73780644editdlrm
compileall.cpython-34.pyo73780644editdlrm
configparser.cpython-34.pyc448820644editdlrm
configparser.cpython-34.pyo448820644editdlrm
contextlib.cpython-34.pyc103700644editdlrm
contextlib.cpython-34.pyo103700644editdlrm
copy.cpython-34.pyc80610644editdlrm
copy.cpython-34.pyo79750644editdlrm
copyreg.cpython-34.pyc46070644editdlrm
copyreg.cpython-34.pyo45660644editdlrm
cProfile.cpython-34.pyc46220644editdlrm
cProfile.cpython-34.pyo46220644editdlrm
crypt.cpython-34.pyc24370644editdlrm
crypt.cpython-34.pyo24370644editdlrm
csv.cpython-34.pyc129970644editdlrm
csv.cpython-34.pyo129970644editdlrm
datetime.cpython-34.pyc562640644editdlrm
datetime.cpython-34.pyo542960644editdlrm
decimal.cpython-34.pyc1725260644editdlrm
decimal.cpython-34.pyo1725260644editdlrm
difflib.cpython-34.pyc605150644editdlrm
difflib.cpython-34.pyo604670644editdlrm
dis.cpython-34.pyc145870644editdlrm
dis.cpython-34.pyo145870644editdlrm
doctest.cpython-34.pyc801100644editdlrm
doctest.cpython-34.pyo798370644editdlrm
dummy_threading.cpython-34.pyc12140644editdlrm
dummy_threading.cpython-34.pyo12140644editdlrm
enum.cpython-34.pyc163390644editdlrm
enum.cpython-34.pyo163390644editdlrm
filecmp.cpython-34.pyc91200644editdlrm
filecmp.cpython-34.pyo91200644editdlrm
fileinput.cpython-34.pyc142970644editdlrm
fileinput.cpython-34.pyo142970644editdlrm
fnmatch.cpython-34.pyc31460644editdlrm
fnmatch.cpython-34.pyo31460644editdlrm
formatter.cpython-34.pyc189160644editdlrm
formatter.cpython-34.pyo189160644editdlrm
fractions.cpython-34.pyc192700644editdlrm
fractions.cpython-34.pyo192700644editdlrm
ftplib.cpython-34.pyc333220644editdlrm
ftplib.cpython-34.pyo333220644editdlrm
functools.cpython-34.pyc236140644editdlrm
functools.cpython-34.pyo236140644editdlrm
genericpath.cpython-34.pyc34930644editdlrm
genericpath.cpython-34.pyo34930644editdlrm
getopt.cpython-34.pyc67330644editdlrm
getopt.cpython-34.pyo66910644editdlrm
getpass.cpython-34.pyc46240644editdlrm
getpass.cpython-34.pyo46240644editdlrm
gettext.cpython-34.pyc151740644editdlrm
gettext.cpython-34.pyo151740644editdlrm
glob.cpython-34.pyc28800644editdlrm
glob.cpython-34.pyo28800644editdlrm
gzip.cpython-34.pyc194460644editdlrm
gzip.cpython-34.pyo193920644editdlrm
hashlib.cpython-34.pyc79440644editdlrm
hashlib.cpython-34.pyo79440644editdlrm
heapq.cpython-34.pyc139100644editdlrm
heapq.cpython-34.pyo139100644editdlrm
hmac.cpython-34.pyc51460644editdlrm
hmac.cpython-34.pyo51460644editdlrm
imaplib.cpython-34.pyc434790644editdlrm
imaplib.cpython-34.pyo409550644editdlrm
imghdr.cpython-34.pyc41430644editdlrm
imghdr.cpython-34.pyo41430644editdlrm
imp.cpython-34.pyc98670644editdlrm
imp.cpython-34.pyo98670644editdlrm
inspect.cpython-34.pyc763270644editdlrm
inspect.cpython-34.pyo760060644editdlrm
io.cpython-34.pyc34580644editdlrm
io.cpython-34.pyo34580644editdlrm
ipaddress.cpython-34.pyc629840644editdlrm
ipaddress.cpython-34.pyo629840644editdlrm
keyword.cpython-34.pyc19460644editdlrm
keyword.cpython-34.pyo19460644editdlrm
linecache.cpython-34.pyc31120644editdlrm
linecache.cpython-34.pyo31120644editdlrm
locale.cpython-34.pyc372760644editdlrm
locale.cpython-34.pyo372760644editdlrm
lzma.cpython-34.pyc159170644editdlrm
lzma.cpython-34.pyo159170644editdlrm
macpath.cpython-34.pyc60060644editdlrm
macpath.cpython-34.pyo60060644editdlrm
macurl2path.cpython-34.pyc21020644editdlrm
macurl2path.cpython-34.pyo21020644editdlrm
mailbox.cpython-34.pyc702880644editdlrm
mailbox.cpython-34.pyo701890644editdlrm
mailcap.cpython-34.pyc65440644editdlrm
mailcap.cpython-34.pyo65440644editdlrm
mimetypes.cpython-34.pyc168070644editdlrm
mimetypes.cpython-34.pyo168070644editdlrm
modulefinder.cpython-34.pyc173760644editdlrm
modulefinder.cpython-34.pyo172970644editdlrm
netrc.cpython-34.pyc42770644editdlrm
netrc.cpython-34.pyo42770644editdlrm
nntplib.cpython-34.pyc363100644editdlrm
nntplib.cpython-34.pyo363100644editdlrm
ntpath.cpython-34.pyc133050644editdlrm
ntpath.cpython-34.pyo133050644editdlrm
nturl2path.cpython-34.pyc17160644editdlrm
nturl2path.cpython-34.pyo17160644editdlrm
numbers.cpython-34.pyc126670644editdlrm
numbers.cpython-34.pyo126670644editdlrm
opcode.cpython-34.pyc51740644editdlrm
opcode.cpython-34.pyo51740644editdlrm
operator.cpython-34.pyc127780644editdlrm
operator.cpython-34.pyo127780644editdlrm
optparse.cpython-34.pyc515370644editdlrm
optparse.cpython-34.pyo514600644editdlrm
os.cpython-34.pyc295990644editdlrm
os.cpython-34.pyo295990644editdlrm
pathlib.cpython-34.pyc404830644editdlrm
pathlib.cpython-34.pyo404830644editdlrm
pdb.cpython-34.pyc494720644editdlrm
pdb.cpython-34.pyo494060644editdlrm
pickle.cpython-34.pyc469840644editdlrm
pickle.cpython-34.pyo468380644editdlrm
pickletools.cpython-34.pyc702540644editdlrm
pickletools.cpython-34.pyo691670644editdlrm
pipes.cpython-34.pyc84310644editdlrm
pipes.cpython-34.pyo84310644editdlrm
pkgutil.cpython-34.pyc176000644editdlrm
pkgutil.cpython-34.pyo176000644editdlrm
platform.cpython-34.pyc311720644editdlrm
platform.cpython-34.pyo311720644editdlrm
plistlib.cpython-34.pyc301510644editdlrm
plistlib.cpython-34.pyo300680644editdlrm
poplib.cpython-34.pyc137540644editdlrm
poplib.cpython-34.pyo137540644editdlrm
posixpath.cpython-34.pyc98090644editdlrm
posixpath.cpython-34.pyo98090644editdlrm
pprint.cpython-34.pyc114600644editdlrm
pprint.cpython-34.pyo112950644editdlrm
profile.cpython-34.pyc151510644editdlrm
profile.cpython-34.pyo148980644editdlrm
pstats.cpython-34.pyc236750644editdlrm
pstats.cpython-34.pyo236750644editdlrm
pty.cpython-34.pyc42250644editdlrm
pty.cpython-34.pyo42250644editdlrm
pyclbr.cpython-34.pyc91920644editdlrm
pyclbr.cpython-34.pyo91920644editdlrm
pydoc.cpython-34.pyc909150644editdlrm
pydoc.cpython-34.pyo908540644editdlrm
py_compile.cpython-34.pyc68570644editdlrm
py_compile.cpython-34.pyo68570644editdlrm
queue.cpython-34.pyc92620644editdlrm
queue.cpython-34.pyo92620644editdlrm
quopri.cpython-34.pyc64460644editdlrm
quopri.cpython-34.pyo62360644editdlrm
random.cpython-34.pyc190590644editdlrm
random.cpython-34.pyo190590644editdlrm
re.cpython-34.pyc145500644editdlrm
re.cpython-34.pyo145500644editdlrm
reprlib.cpython-34.pyc58720644editdlrm
reprlib.cpython-34.pyo58720644editdlrm
rlcompleter.cpython-34.pyc56950644editdlrm
rlcompleter.cpython-34.pyo56950644editdlrm
runpy.cpython-34.pyc77530644editdlrm
runpy.cpython-34.pyo77530644editdlrm
sched.cpython-34.pyc65730644editdlrm
sched.cpython-34.pyo65730644editdlrm
selectors.cpython-34.pyc167440644editdlrm
selectors.cpython-34.pyo167440644editdlrm
shelve.cpython-34.pyc99550644editdlrm
shelve.cpython-34.pyo99550644editdlrm
shlex.cpython-34.pyc75180644editdlrm
shlex.cpython-34.pyo75180644editdlrm
shutil.cpython-34.pyc330150644editdlrm
shutil.cpython-34.pyo330150644editdlrm
site.cpython-34.pyc179710644editdlrm
site.cpython-34.pyo179710644editdlrm
smtpd.cpython-34.pyc256690644editdlrm
smtpd.cpython-34.pyo256690644editdlrm
smtplib.cpython-34.pyc331290644editdlrm
smtplib.cpython-34.pyo330550644editdlrm
sndhdr.cpython-34.pyc67690644editdlrm
sndhdr.cpython-34.pyo67690644editdlrm
socket.cpython-34.pyc181110644editdlrm
socket.cpython-34.pyo180610644editdlrm
socketserver.cpython-34.pyc232550644editdlrm
socketserver.cpython-34.pyo232550644editdlrm
sre_compile.cpython-34.pyc119350644editdlrm
sre_compile.cpython-34.pyo117780644editdlrm
sre_constants.cpython-34.pyc55810644editdlrm
sre_constants.cpython-34.pyo55810644editdlrm
sre_parse.cpython-34.pyc202380644editdlrm
sre_parse.cpython-34.pyo202380644editdlrm
ssl.cpython-34.pyc276080644editdlrm
ssl.cpython-34.pyo276080644editdlrm
stat.cpython-34.pyc35780644editdlrm
stat.cpython-34.pyo35780644editdlrm
statistics.cpython-34.pyc171580644editdlrm
statistics.cpython-34.pyo168560644editdlrm
string.cpython-34.pyc83760644editdlrm
string.cpython-34.pyo83760644editdlrm
stringprep.cpython-34.pyc136360644editdlrm
stringprep.cpython-34.pyo135730644editdlrm
struct.cpython-34.pyc3470644editdlrm
struct.cpython-34.pyo3470644editdlrm
subprocess.cpython-34.pyc433590644editdlrm
subprocess.cpython-34.pyo432460644editdlrm
sunau.cpython-34.pyc183090644editdlrm
sunau.cpython-34.pyo183090644editdlrm
symbol.cpython-34.pyc26620644editdlrm
symbol.cpython-34.pyo26620644editdlrm
symtable.cpython-34.pyc113050644editdlrm
symtable.cpython-34.pyo111830644editdlrm
sysconfig.cpython-34.pyc172870644editdlrm
sysconfig.cpython-34.pyo172870644editdlrm
tabnanny.cpython-34.pyc77490644editdlrm
tabnanny.cpython-34.pyo77490644editdlrm
tarfile.cpython-34.pyc680400644editdlrm
tarfile.cpython-34.pyo680400644editdlrm
telnetlib.cpython-34.pyc193940644editdlrm
telnetlib.cpython-34.pyo193940644editdlrm
tempfile.cpython-34.pyc215760644editdlrm
tempfile.cpython-34.pyo215760644editdlrm
textwrap.cpython-34.pyc138000644editdlrm
textwrap.cpython-34.pyo137140644editdlrm
this.cpython-34.pyc13160644editdlrm
this.cpython-34.pyo13160644editdlrm
threading.cpython-34.pyc389650644editdlrm
threading.cpython-34.pyo382520644editdlrm
timeit.cpython-34.pyc110620644editdlrm
timeit.cpython-34.pyo110620644editdlrm
token.cpython-34.pyc36150644editdlrm
token.cpython-34.pyo36150644editdlrm
tokenize.cpython-34.pyc199510644editdlrm
tokenize.cpython-34.pyo199010644editdlrm
trace.cpython-34.pyc241840644editdlrm
trace.cpython-34.pyo241270644editdlrm
traceback.cpython-34.pyc110910644editdlrm
traceback.cpython-34.pyo110910644editdlrm
tracemalloc.cpython-34.pyc171300644editdlrm
tracemalloc.cpython-34.pyo171300644editdlrm
tty.cpython-34.pyc11460644editdlrm
tty.cpython-34.pyo11460644editdlrm
types.cpython-34.pyc55600644editdlrm
types.cpython-34.pyo55600644editdlrm
uu.cpython-34.pyc40210644editdlrm
uu.cpython-34.pyo40210644editdlrm
uuid.cpython-34.pyc218640644editdlrm
uuid.cpython-34.pyo218020644editdlrm
warnings.cpython-34.pyc122680644editdlrm
warnings.cpython-34.pyo115360644editdlrm
wave.cpython-34.pyc191350644editdlrm
wave.cpython-34.pyo190740644editdlrm
weakref.cpython-34.pyc203450644editdlrm
weakref.cpython-34.pyo203080644editdlrm
webbrowser.cpython-34.pyc171320644editdlrm
webbrowser.cpython-34.pyo170930644editdlrm
xdrlib.cpython-34.pyc90020644editdlrm
xdrlib.cpython-34.pyo90020644editdlrm
zipfile.cpython-34.pyc458200644editdlrm
zipfile.cpython-34.pyo457710644editdlrm
_bootlocale.cpython-34.pyc10470644editdlrm
_bootlocale.cpython-34.pyo10160644editdlrm
_collections_abc.cpython-34.pyc239490644editdlrm
_collections_abc.cpython-34.pyo239490644editdlrm
_compat_pickle.cpython-34.pyc75010644editdlrm
_compat_pickle.cpython-34.pyo74270644editdlrm
_dummy_thread.cpython-34.pyc48250644editdlrm
_dummy_thread.cpython-34.pyo48250644editdlrm
_markupbase.cpython-34.pyc89320644editdlrm
_markupbase.cpython-34.pyo87450644editdlrm
_osx_support.cpython-34.pyc106300644editdlrm
_osx_support.cpython-34.pyo106300644editdlrm
_pyio.cpython-34.pyc649330644editdlrm
_pyio.cpython-34.pyo649070644editdlrm
_sitebuiltins.cpython-34.pyc36770644editdlrm
_sitebuiltins.cpython-34.pyo36770644editdlrm
_strptime.cpython-34.pyc157790644editdlrm
_strptime.cpython-34.pyo157790644editdlrm
_sysconfigdata.cpython-34.pyc227000644editdlrm
_sysconfigdata.cpython-34.pyo227000644editdlrm
_threading_local.cpython-34.pyc69460644editdlrm
_threading_local.cpython-34.pyo69460644editdlrm
_weakrefset.cpython-34.pyc84650644editdlrm
_weakrefset.cpython-34.pyo84650644editdlrm
__future__.cpython-34.pyc41680644editdlrm
__future__.cpython-34.pyo41680644editdlrm
__phello__.foo.cpython-34.pyc1340644editdlrm
__phello__.foo.cpython-34.pyo1340644editdlrm
Edit: /opt/alt/python34/lib64/python3.4/__pycache__/argparse.cpython-34.pyo (65715B)
f_@sdZdZdddddddd d d d d dddddgZddlZddlZddlZddl Z ddl Z ddl ZddlmZmZdZdZdZdZdZdZdZGdddeZdd ZGd!ddeZGd"ddeZGd#d d eZGd$ddeZGd%d d eZ d&d'Z!Gd(dde"Z#Gd)dde"Z$Gd*d d eZ%Gd+d,d,e%Z&Gd-d.d.e%Z'Gd/d0d0e'Z(Gd1d2d2e'Z)Gd3d4d4e%Z*Gd5d6d6e%Z+Gd7d8d8e%Z,Gd9d:d:e%Z-Gd;d<d<e%Z.Gd=d>d>e%Z/Gd?ddeZ0Gd@d d eZ1GdAdBdBeZ2GdCdDdDe2Z3GdEdFdFe3Z4GdGddee2Z5dS)Ha Command-line parsing library This module is an optparse-inspired command-line parsing library that: - handles both optional and positional arguments - produces highly informative usage messages - supports parsers that dispatch to sub-parsers The following is a simple usage example that sums integers from the command-line and writes the result to a file:: parser = argparse.ArgumentParser( description='sum the integers at the command line') parser.add_argument( 'integers', metavar='int', nargs='+', type=int, help='an integer to be summed') parser.add_argument( '--log', default=sys.stdout, type=argparse.FileType('w'), help='the file where the sum should be written') args = parser.parse_args() args.log.write('%s' % sum(args.integers)) args.log.close() The module contains the following public classes: - ArgumentParser -- The main entry point for command-line parsing. As the example above shows, the add_argument() method is used to populate the parser with actions for optional and positional arguments. Then the parse_args() method is invoked to convert the args at the command-line into an object with attributes. - ArgumentError -- The exception raised by ArgumentParser objects when there are errors with the parser's actions. Errors raised while parsing the command-line are caught by ArgumentParser and emitted as command-line messages. - FileType -- A factory for defining types of files to be created. As the example above shows, instances of FileType are typically passed as the type= argument of add_argument() calls. - Action -- The base class for parser actions. Typically actions are selected by passing strings like 'store_true' or 'append_const' to the action= argument of add_argument(). However, for greater customization of ArgumentParser actions, subclasses of Action may be defined and passed as the action= argument. - HelpFormatter, RawDescriptionHelpFormatter, RawTextHelpFormatter, ArgumentDefaultsHelpFormatter -- Formatter classes which may be passed as the formatter_class= argument to the ArgumentParser constructor. HelpFormatter is the default, RawDescriptionHelpFormatter and RawTextHelpFormatter tell the parser not to change the formatting for help text, and ArgumentDefaultsHelpFormatter adds information about argument defaults to the help. All other classes in this module are considered implementation details. (Also note that HelpFormatter and RawDescriptionHelpFormatter are only considered public as object names -- the API of the formatter objects is still considered an implementation detail.) z1.1ArgumentParser ArgumentErrorArgumentTypeErrorFileType HelpFormatterArgumentDefaultsHelpFormatterRawDescriptionHelpFormatterRawTextHelpFormatterMetavarTypeHelpFormatter NamespaceAction ONE_OR_MOREOPTIONALPARSER REMAINDERSUPPRESS ZERO_OR_MOREN)gettextngettextz ==SUPPRESS==?*+zA...z...Z_unrecognized_argsc@s:eZdZdZddZddZddZdS) _AttributeHolderaAbstract base class that provides __repr__. The __repr__ method returns a string in the format:: ClassName(attr=name, attr=name, ...) The attributes are determined either by a class-level attribute, '_kwarg_names', or by inspecting the instance __dict__. cCst|j}g}x'|jD]}|jt|q"Wx1|jD]#\}}|jd||fqLWd|dj|fS)Nz%s=%rz%s(%s)z, )type__name__ _get_argsappendrepr _get_kwargsjoin)selfZ type_name arg_stringsargnamevaluer%-/opt/alt/python34/lib64/python3.4/argparse.py__repr__vsz_AttributeHolder.__repr__cCst|jjS)N)sorted__dict__items)r r%r%r&rsz_AttributeHolder._get_kwargscCsgS)Nr%)r r%r%r&rsz_AttributeHolder._get_argsN)r __module__ __qualname____doc__r'rrr%r%r%r&rms  rcCs8t||ddkr+t|||nt||S)N)getattrsetattr) namespacer#r$r%r%r& _ensure_valuesr1c@speZdZdZdddddZddZd d ZGd d d eZd dZ ddZ ddZ ddZ dddZ ddZddZddZddZdd Zd!d"Zd#d$Zd%d&Zd'd(Zd)d*Zd+d,Zd-d.Zd/d0Zd1d2Zd3d4Zd5d6Zd7d8Zd9d:ZdS);rzFormatter for generating usage messages and argument help strings. Only the name of this class is considered a public API. All the methods provided by the class are considered an implementation detail. NcCs|dkrQyttjd}Wnttfk rCd}YnX|d8}n||_||_||_t|t |d|d|_||_ d|_ d|_ d|_ |j|d|_|j|_tjd|_tjd|_dS)NZCOLUMNSPr2rz\s+z\n\n\n+)int_osenvironKeyError ValueError_prog_indent_increment_max_help_positionminmax_width_current_indent_level_action_max_length_Section _root_section_current_section_recompile_whitespace_matcher_long_break_matcher)r progZindent_incrementZmax_help_positionwidthr%r%r&__init__s&           zHelpFormatter.__init__cCs%|j|j7_|jd7_dS)N)rAr<rB)r r%r%r&_indentszHelpFormatter._indentcCs%|j|j8_|jd8_dS)NrN)rAr<rB)r r%r%r&_dedentszHelpFormatter._dedentc@s+eZdZdddZddZdS)zHelpFormatter._SectionNcCs(||_||_||_g|_dS)N) formatterparentheadingr*)r rQrRrSr%r%r&rMs   zHelpFormatter._Section.__init__cCs|jdk r|jjn|jj}x!|jD]\}}||q5W|dd|jD}|jdk r|jjn|sdS|jtk r|jdk r|jj}d|d|jf}nd}|d||dgS)NcSs"g|]\}}||qSr%r%).0funcargsr%r%r& s z6HelpFormatter._Section.format_help..z%*s%s:  ) rRrQrO _join_partsr*rPrSrrA)r rrUrVZ item_helpZcurrent_indentrSr%r%r& format_helps  z"HelpFormatter._Section.format_help)rr+r,rMr[r%r%r%r&rDs rDcCs|jjj||fdS)N)rFr*r)r rUrVr%r%r& _add_itemszHelpFormatter._add_itemcCsB|j|j||j|}|j|jg||_dS)N)rOrDrFr\r[)r rSZsectionr%r%r& start_sections zHelpFormatter.start_sectioncCs|jj|_|jdS)N)rFrRrP)r r%r%r& end_sectionszHelpFormatter.end_sectioncCs5|tk r1|dk r1|j|j|gndS)N)rr\ _format_text)r textr%r%r&add_textszHelpFormatter.add_textcCs8|tk r4||||f}|j|j|ndS)N)rr\ _format_usage)r usageactionsgroupsprefixrVr%r%r& add_usages zHelpFormatter.add_usagecCs|jtk r|j}||g}x*|j|D]}|j||q7Wtdd|D}||j}t|j||_|j|j |gndS)NcSsg|]}t|qSr%)len)rTsr%r%r&rWs z.HelpFormatter.add_argument..) helpr_format_action_invocation_iter_indented_subactionsrr?rArCr\_format_action)r actionZget_invocationZ invocations subactionZinvocation_lengthZ action_lengthr%r%r& add_arguments    zHelpFormatter.add_argumentcCs"x|D]}|j|qWdS)N)rp)r rdrnr%r%r& add_argumentss zHelpFormatter.add_argumentscCsD|jj}|r@|jjd|}|jdd}n|S)Nz rY)rEr[rJsubstrip)r rjr%r%r&r[s zHelpFormatter.format_helpcCsdjdd|DS)NrXcSs(g|]}|r|tk r|qSr%)r)rTpartr%r%r&rWs z-HelpFormatter._join_parts..)r)r Z part_stringsr%r%r&rZszHelpFormatter._join_partscs|dkrtd}n|dk r@|td|j}n|dkrl| rldtd|j}nb|dkrdtd|j}g}g}x4|D],}|jr|j|q|j|qW|j} | |||} djdd|| gD}|j|jt |t |krd} | ||} | ||} t j | | }t j | | }dfdd }t |t |d kr<dt |t |d }|r||g|||}|j |||q|r0||g|||}q|g}n}dt |}||}|||}t |d krg}|j ||||j |||n|g|}d j|}qnd ||fS)Nzusage: rKz%(prog)s cSsg|]}|r|qSr%r%)rTrir%r%r&rW=s z/HelpFormatter._format_usage..z\(.*?\)+|\[.*?\]+|\S+csg}g}|dk r+t|d}nt|d}x|D]z}|dt|kr|r|j|dj|g}t|d}n|j||t|d7}qBW|r|j|dj|n|dk r|dt|d|d.get_linesg?rNrYz%s%s ) _dictr;option_stringsr_format_actions_usagerr@rArhrGfindallextend)r rcrdrerfrKZ optionals positionalsrnformatZ action_usageZ part_regexpZ opt_usageZ pos_usageZ opt_partsZ pos_partsr{rwrxrvr%)rzr&rb!sV      "    zHelpFormatter._format_usagec Cst}i}x&|D]}y|j|jd}Wntk rMwYqX|t|j}||||jkrx|jD]}|j|qW|js||kr||d7.z[\[(]z[\])]z(%s) z\1z (%s)z%s *%srXz \(([^|]*)\)r)setindex_group_actionsr:rhaddrequiredrange enumeraterjrrgetpopr~#_get_default_metavar_for_positional _format_argsnargs!_get_default_metavar_for_optionalr(rrGrrrs)r rdre group_actionsZinsertsgroupstartendrnirvdefaultrt option_string args_stringr`opencloser%r%r&r}sr                  z#HelpFormatter._format_actions_usagecCsbd|kr%|td|j}nt|j|jd}d|j}|j|||dS)Nz%(prog)rK ruz )r}r;r?r@rA _fill_text)r r`rzrwr%r%r&r_s   zHelpFormatter._format_textc Cst|jd|j}t|j|d}||jd}|j|}|jsw|jd|f}d|}n\t||kr|jd||f}d|}d}n"|jd|f}d|}|}|g}|jr\|j |} |j | |} |j d|d| dfxT| ddD] } |j d|d| fq5Wn|j ds{|j dnx-|j |D]} |j |j| qW|j|S) Nr2rrXz%*s%s z %*s%-*s rrNrY)r>rCr=r?r@rArkrjrh _expand_help _split_linesrendswithrlrmrZ) r rnZ help_positionZ help_widthZ action_widthZ action_headertupZ indent_firstrvZ help_textZ help_linesryror%r%r&rms6         !zHelpFormatter._format_actioncCs|js7|j|}|j||d\}|Sg}|jdkr_|j|jnL|j|}|j||}x(|jD]}|jd||fqWdj|SdS)NrNrz%s %sz, ) r~r_metavar_formatterrrrrrr)r rnrmetavarrvrrr%r%r&rks z'HelpFormatter._format_action_invocationcsr|jdk r|jnA|jdk rVdd|jD}ddj|n|fdd}|S)NcSsg|]}t|qSr%)str)rTZchoicer%r%r&rW0s z4HelpFormatter._metavar_formatter..z{%s},cs"ttrSf|SdS)N) isinstancetuple)Z tuple_size)resultr%r&r5sz0HelpFormatter._metavar_formatter..format)rchoicesr)r rndefault_metavarZ choice_strsrr%)rr&r,s z HelpFormatter._metavar_formattercCs|j||}|jdkr4d|d}n|jtkrVd|d}n|jtkrxd|d}n|jtkrd|d}nr|jtkrd}nZ|jtkrd|d}n8d d t|jD}d j|||j}|S) Nz%srNz[%s]z [%s [%s ...]]r2z %s [%s ...]z...z%s ...cSsg|] }dqS)z%sr%)rTr|r%r%r&rWKs z.HelpFormatter._format_args..ru) rrr rr rrrr)r rnrZ get_metavarrZformatsr%r%r&r<s  zHelpFormatter._format_argscCstt|d|j}x.t|D] }||tkr(||=q(q(Wx;t|D]-}t||drY||j||.) r}varsr;listrhasattrrrr_get_help_string)r rnZparamsr#Z choices_strr%r%r&rOs  zHelpFormatter._expand_helpc csFy |j}Wntk r!Yn!X|j|DdH|jdS)N)_get_subactionsAttributeErrorrOrP)r rnZget_subactionsr%r%r&rl\s    z'HelpFormatter._iter_indented_subactionscCs+|jjd|j}tj||S)Nru)rIrrrs _textwrapZwrap)r r`rLr%r%r&rfszHelpFormatter._split_linescCs7|jjd|j}tj||d|d|S)NruZinitial_indentZsubsequent_indent)rIrrrsrZfill)r r`rLrwr%r%r&rjszHelpFormatter._fill_textcCs|jS)N)rj)r rnr%r%r&roszHelpFormatter._get_help_stringcCs |jjS)N)destupper)r rnr%r%r&rrsz/HelpFormatter._get_default_metavar_for_optionalcCs|jS)N)r)r rnr%r%r&rusz1HelpFormatter._get_default_metavar_for_positional) rr+r,r-rMrOrPobjectrDr\r]r^rargrprqr[rZrbrr_rmrkrrrrlrrrrrr%r%r%r&rs<   !         \ a  /       c@s"eZdZdZddZdS)rzHelp message formatter which retains any formatting in descriptions. Only the name of this class is considered a public API. All the methods provided by the class are considered an implementation detail. cs,djfdd|jddDS)NrXc3s|]}|VqdS)Nr%)rTry)rwr%r& sz9RawDescriptionHelpFormatter._fill_text..keependsT)r splitlines)r r`rLrwr%)rwr&rsz&RawDescriptionHelpFormatter._fill_textN)rr+r,r-rr%r%r%r&rys c@s"eZdZdZddZdS)rzHelp message formatter which retains formatting of all help text. Only the name of this class is considered a public API. All the methods provided by the class are considered an implementation detail. cCs |jS)N)r)r r`rLr%r%r&rsz!RawTextHelpFormatter._split_linesN)rr+r,r-rr%r%r%r&rs c@s"eZdZdZddZdS)rzHelp message formatter which adds default values to argument help. Only the name of this class is considered a public API. All the methods provided by the class are considered an implementation detail. cCsb|j}d|jkr^|jtk r^ttg}|jsK|j|kr[|d7}q[q^n|S)Nz %(default)z (default: %(default)s))rjrrr rr~r)r rnrjZdefaulting_nargsr%r%r&rs  z.ArgumentDefaultsHelpFormatter._get_help_stringN)rr+r,r-rr%r%r%r&rs c@s.eZdZdZddZddZdS)r a Help message formatter which uses the argument 'type' as the default metavar value (instead of the argument 'dest') Only the name of this class is considered a public API. All the methods provided by the class are considered an implementation detail. cCs |jjS)N)rr)r rnr%r%r&rsz:MetavarTypeHelpFormatter._get_default_metavar_for_optionalcCs |jjS)N)rr)r rnr%r%r&rsz.r%)r namesr%)r r&r's zAction._get_kwargscCsttddS)Nz.__call__() not defined)NotImplementedErrorr|)r parserr0valuesrr%r%r&__call__5szAction.__call__)rr+r,r-rMrrr%r%r%r&r s 1 c sIeZdZddddddddfddZdddZS) _StoreActionNFc s|dkrtdn|dk rF|tkrFtdtntt|jd|d|d|d|d|d |d |d |d | d | dS)Nrznargs for store actions must be > 0; if you have nothing to store, actions such as store true or store const may be more appropriatez nargs must be %r to supply constr~rrrrrrrrjr)r:r superrrM) r r~rrrrrrrrjr) __class__r%r&rM;s z_StoreAction.__init__cCst||j|dS)N)r/r)r rr0rrr%r%r&rXsz_StoreAction.__call__)rr+r,rMrr%r%)rr&r9s rcs=eZdZddddfddZdddZS)_StoreConstActionNFcsAtt|jd|d|ddd|d|d|d|dS) Nr~rrrrrrrj)rrrM)r r~rrrrrjr)rr%r&rM^sz_StoreConstAction.__init__cCst||j|jdS)N)r/rr)r rr0rrr%r%r&rosz_StoreConstAction.__call__)rr+r,rMrr%r%)rr&r\s  rcs+eZdZdddfddZS)_StoreTrueActionFNc s;tt|jd|d|ddd|d|d|dS)Nr~rrTrrrj)rrrM)r r~rrrrj)rr%r&rMusz_StoreTrueAction.__init__)rr+r,rMr%r%)rr&rss rcs+eZdZdddfddZS)_StoreFalseActionTFNc s;tt|jd|d|ddd|d|d|dS)Nr~rrFrrrj)rrrM)r r~rrrrj)rr%r&rMsz_StoreFalseAction.__init__)rr+r,rMr%r%)rr&rs rc sIeZdZddddddddfddZdddZS) _AppendActionNFc s|dkrtdn|dk rF|tkrFtdtntt|jd|d|d|d|d|d |d |d |d | d | dS)Nrznargs for append actions must be > 0; if arg strings are not supplying the value to append, the append const action may be more appropriatez nargs must be %r to supply constr~rrrrrrrrjr)r:r rrrM) r r~rrrrrrrrjr)rr%r&rMs z_AppendAction.__init__cCsBtjt||jg}|j|t||j|dS)N)_copycopyr1rrr/)r rr0rrr*r%r%r&rs z_AppendAction.__call__)rr+r,rMrr%r%)rr&rs rcs=eZdZddddfddZdddZS)_AppendConstActionNFcsGtt|jd|d|ddd|d|d|d|d |dS) Nr~rrrrrrrjr)rrrM)r r~rrrrrjr)rr%r&rMsz_AppendConstAction.__init__cCsEtjt||jg}|j|jt||j|dS)N)rrr1rrrr/)r rr0rrr*r%r%r&rsz_AppendConstAction.__call__)rr+r,rMrr%r%)rr&rs  rcs:eZdZdddfddZdddZS) _CountActionNFc s;tt|jd|d|ddd|d|d|dS)Nr~rrrrrrj)rrrM)r r~rrrrj)rr%r&rMsz_CountAction.__init__cCs0t||jdd}t||j|dS)NrrN)r1rr/)r rr0rrZ new_countr%r%r&rsz_CountAction.__call__)rr+r,rMrr%r%)rr&rs  rcs:eZdZeedfddZdddZS) _HelpActionNc s5tt|jd|d|d|ddd|dS)Nr~rrrrrj)rrrM)r r~rrrj)rr%r&rMs z_HelpAction.__init__cCs|j|jdS)N) print_helpexit)r rr0rrr%r%r&rs z_HelpAction.__call__)rr+r,rrMrr%r%)rr&rs rcs=eZdZdeedfddZdddZS)_VersionActionNz&show program's version number and exitc s>tt|jd|d|d|ddd|||_dS)Nr~rrrrrj)rrrMversion)r r~rrrrj)rr%r&rMsz_VersionAction.__init__cCsa|j}|dkr!|j}n|j}|j||j|jtj|jdS)N)r_get_formatterra_print_messager[_sysstdoutr)r rr0rrrrQr%r%r&r s     z_VersionAction.__call__)rr+r,rrMrr%r%)rr&rs  rcsheZdZGdddeZeddfddZddZdd Zdd d Z S) _SubParsersActioncs"eZdZfddZS)z&_SubParsersAction._ChoicesPseudoActionc sb|}}|r*|ddj|7}nttj|}|jdgd|d|d|dS)Nz (%s)z, r~rrjr)rrr_ChoicesPseudoActionrM)r r#aliasesrjrrZsup)rr%r&rMs  z/_SubParsersAction._ChoicesPseudoAction.__init__)rr+r,rMr%r%)rr&rs rNc sh||_||_tj|_g|_tt|jd|d|dt d|jd|d|dS)Nr~rrrrjr) _prog_prefix _parser_class _collections OrderedDict_name_parser_map_choices_actionsrrrMr)r r~rK parser_classrrjr)rr%r&rM"s    z_SubParsersAction.__init__cKs|jddkr/d|j|f|d.cSs2g|](\}}|dk rd||fqS)Nz%s=%rr%)rTkwr"r%r%r&rWs z%s(%s))rrrrrrr)r rVrZargs_strr%r%r&r's zFileType.__repr__r)rr+r,r-rMrr'r%r%r%r&rvs  c@sFeZdZdZddZddZddZdd Zd S) r zSimple object for storing attributes. Implements equality by attribute names and values, and provides a simple string representation. cKs)x"|D]}t||||qWdS)N)r/)r rr#r%r%r&rMs zNamespace.__init__cCs)t|tstSt|t|kS)N)rr NotImplementedr)r otherr%r%r&__eq__szNamespace.__eq__cCst|tstS||k S)N)rr r)r rr%r%r&__ne__szNamespace.__ne__cCs ||jkS)N)r))r rr%r%r& __contains__szNamespace.__contains__N)rr+r,r-rMrrrr%r%r%r&r s    cseZdZfddZddZdddZdd Zd d Zd d ZddZ ddZ ddZ ddZ ddZ ddZddZdddZddZd d!Zd"d#Zd$d%ZS)&_ActionsContainercsgtt|j||_||_||_||_i|_|jddt |jddt |jddt |jddt |jddt |jddt |jddt|jddt|jdd t|jdd t|jdd t|jg|_i|_g|_g|_i|_tjd |_g|_dS) NrnZstoreZ store_const store_trueZ store_falserZ append_constcountrjrparsersz^-\d+$|^-\d*\.\d+$)rrrM descriptionargument_default prefix_charsconflict_handler _registriesregisterrrrrrrrrrr _get_handler_actions_option_string_actions_action_groups_mutually_exclusive_groups _defaultsrGrH_negative_number_matcher_has_negative_number_optionals)r r rr r)rr%r&rMs2           z_ActionsContainer.__init__cCs#|jj|i}|||.)rrhrr)r rnconflicting_actionsrZconflict_stringr%r%r&_handle_conflict_errors  z(_ActionsContainer._handle_conflict_errorcCsZxS|D]K\}}|jj||jj|d|js|jj|qqWdS)N)r~r/rrr-r0)r rnr7rr%r%r&_handle_conflict_resolves  z*_ActionsContainer._handle_conflict_resolve)rr+r,rMrrrrrpr)r+r%r0r3r r!r"rr,r8r9r%r%)rr&rs$ 4  /     (  $  rcsLeZdZddfddZfddZfddZS)r(Nc s|j}|d|j|d|j|d|jtt|j}|d||||_g|_|j |_ |j |_ |j |_ |j |_ |j |_ |j|_dS)Nrrr r )rrrr rr(rMr1rrrrrrr)r r-r1r rrZ super_init)rr%r&rMs        z_ArgumentGroup.__init__cs,tt|j|}|jj||S)N)rr(r%rr)r rn)rr%r&r%sz_ArgumentGroup._add_actioncs*tt|j||jj|dS)N)rr(r0rr/)r rn)rr%r&r0sz_ArgumentGroup._remove_action)rr+r,rMr%r0r%r%)rr&r(s r(cs=eZdZdfddZddZddZS)r*Fcs,tt|j|||_||_dS)N)rr*rMr _container)r r-r)rr%r&rMs z _MutuallyExclusiveGroup.__init__cCsJ|jr$td}t|n|jj|}|jj||S)Nz-mutually exclusive arguments must be optional)rr|r:r:r%rr)r rnrr%r%r&r%!s   z#_MutuallyExclusiveGroup._add_actioncCs$|jj||jj|dS)N)r:r0rr/)r rnr%r%r&r0)sz&_MutuallyExclusiveGroup._remove_action)rr+r,rMr%r0r%r%)rr&r*s  r*cseZdZdZddddgedddddfdd Zdd Zd d Zd d ZddZ ddZ ddddZ ddddZ ddZ ddZddZddZddZd d!Zd"d#Zd$d%Zd&d'Zd(d)Zd*d+Zd,d-Zd.d/Zd0d1Zdd2d3Zdd4d5Zdd6d7Zd8dd9d:Zd;d<ZS)=raaObject for parsing command line strings into Python objects. Keyword Arguments: - prog -- The name of the program (default: sys.argv[0]) - usage -- A usage message (default: auto-generated from arguments) - description -- A description of what the program does - epilog -- Text following the argument descriptions - parents -- Parsers whose arguments should be copied into this one - formatter_class -- HelpFormatter class for printing help messages - prefix_chars -- Characters that prefix optional arguments - fromfile_prefix_chars -- Characters that prefix files containing additional arguments - argument_default -- The default value for all arguments - conflict_handler -- String indicating how to handle conflicts - add_help -- Add a -h/-help option NrerrorTc  stt|j} | d|d|d| d| |dkrYtjjtjd}n||_||_ ||_ ||_ ||_ | |_ |j} | td|_| td|_d|_dd }|jd d|d |krd n|d}|j rF|j|d |d ddddtdtdnxM|D]E}|j|y |j}Wntk rYqMX|jj|qMWdS)Nr rr rrzpositional argumentszoptional argumentscSs|S)Nr%)rr%r%r&identitydsz)ArgumentParser.__init__..identityrrhr2rjrnrzshow this help message and exit)rrrMr7pathbasenamerargvrKrcepilogformatter_classfromfile_prefix_charsadd_helpr)r| _positionals _optionals _subparsersrrprr3rrr)r rKrcr rAparentsrBrrCr rrDZ superinitZ add_groupr<Zdefault_prefixrRZdefaults)rr%r&rM@s@                  zArgumentParser.__init__cs/ddddddg}fdd|DS) NrKrcr rBrrDcs%g|]}|t|fqSr%)r.)rTr#)r r%r&rWs z.ArgumentParser._get_kwargs..r%)r rr%)r r&r~s zArgumentParser._get_kwargsc KsG|jdk r%|jtdn|jdt|d|ksSd|krt|jdd}t|jdd}|j|||_n |j|_|jddkr|j }|j }|j }|j |j ||d|jj|d.)r)r r%r%r&_get_optional_actionss z$ArgumentParser._get_optional_actionscCsdd|jDS)NcSsg|]}|js|qSr%)r~)rTrnr%r%r&rWs z:ArgumentParser._get_positional_actions..)r)r r%r%r&rIs z&ArgumentParser._get_positional_actionscCsK|j||\}}|rGtd}|j|dj|n|S)Nzunrecognized arguments: %sru)rr|r;r)r rVr0r@rr%r%r& parse_argss  zArgumentParser.parse_argsc Cs}|dkr"tjdd}n t|}|dkrFt}nx`|jD]U}|jtk rPt||js|jtk rt ||j|jqqqPqPWx:|j D]/}t||st |||j |qqWy[|j ||\}}t|t r6|j t|t t|t n||fSWn5tk rxtjd}|jt|YnXdS)NrN)rr@rr rrrrrr/r_parse_known_argsrrr.delattrrexc_infor;r)r rVr0rnrerrr%r%r&rs,    # zArgumentParser.parse_known_argscsF jdk r! jnix~ jD]s}|j}xat|jD]P\}}j|g}|j|d||j||ddqPWq1Wig}t} xt| D]\}} | dkr|jdx_| D]} |jdqWq j | } | dkr7d} n| |.take_actioncs|}|\}}}j}g}x|dkrPj||dS|dk ry||d}j}|dkr|d|kr|j|g|f|d} | |d}|ddpd} j} || kr| |}| }qvtd} t|| |q|dkrW|d} |g}|j|||fPqtd} t|| |q+|d}|d}|||}||} || }|j|||fPq+Wx'|D]\}}}|||qW| S)NrNrQrzignored explicit argument %r)_match_argumentrrrr|r) start_index option_tuplernr explicit_argZmatch_argumentZ action_tuples arg_countr&charZnew_explicit_argZ optionals_maprstoprVrZselected_patterns)r!arg_strings_patternextrasoption_string_indicesr rWr%r&consume_optional-sN                 z:ArgumentParser._parse_known_args..consume_optionalcsj}|d}||}xHt|D]7\}}|||}||7}||q8Wt|ddd<|S)N)_match_arguments_partialziprh)rYZ match_partialZselected_patternZ arg_countsrnr\rV)r!r_rr rWr%r&consume_positionalszs   z=ArgumentParser._parse_known_args..consume_positionalsrcs"g|]}|kr|qSr%r%)rTr)rYr%r&rWs z4ArgumentParser._parse_known_args..z(the following arguments are required: %sz, cSs+g|]!}|jtk rt|qSr%)rjrr)rTrnr%r%r&rWs z#one of the arguments %s is requiredrur)rC_read_args_from_filesrrrrriterr_parse_optionalrrrIr?r>rrrrrrrrr.r/ _get_valuer;r|)r r!r0r2rrZ mutex_actionZ conflictsZarg_string_pattern_partsZarg_strings_iter arg_stringrZpatternrbreZmax_option_string_indexZnext_option_string_indexZpositionals_end_indexZstringsZ stop_indexZrequired_actionsrnrrrr%) rTr!r_r`r0rarrUrVr rYrWr&rMs #         !!J                   !z ArgumentParser._parse_known_argscCsg}x|D]}| s-|d|jkr=|j|q yt|ddm}g}xA|jjD]-}x$|j|D]}|j|qWqrW|j|}|j|WdQXWq tk rt j d}|j t |Yq Xq W|S)NrrN) rCrrreadrconvert_arg_line_to_argsrfrrrrOr;r)r r!Znew_arg_stringsrjZ args_filearg_liner"rPr%r%r&rfs   z$ArgumentParser._read_args_from_filescCs|gS)Nr%)r rnr%r%r&rmsz'ArgumentParser.convert_arg_line_to_argscCs|j|}tj||}|dkritdd6tdt6tdt6}tdd|j|j}|j|j|}t ||nt |j dS)Nzexpected one argumentzexpected at most one argumentzexpected at least one argumentzexpected %s argumentzexpected %s argumentsrN) _get_nargs_patternrGr.r|r r rrrrrhr)r rnr_ nargs_patternr.Z nargs_errorsrrr%r%r&rXs   zArgumentParser._match_argumentcsg}xtt|ddD]z}|d|}djfdd|D}tj||}|dk r|jdd|jDPqqW|S)NrrNrXcsg|]}j|qSr%)ro)rTrn)r r%r&rWs z;ArgumentParser._match_arguments_partial..cSsg|]}t|qSr%)rh)rTrr%r%r&rWs r)rrhrrGr.rre)r rdr_rrZ actions_slicerkr.r%)r r&rcs   z'ArgumentParser._match_arguments_partialc Cs|s dS|d|jkr!dS||jkrJ|j|}||dfSt|dkr`dSd|kr|jdd\}}||jkr|j|}|||fSn|j|}t|dkr!djdd|D}i|d6|d6}td }|j||nt|dkr@|\} | S|jj |rb|j sbdSnd |krrdSd|dfS) NrrN=z, cSsg|]\}}}|qSr%r%)rTrnrr[r%r%r&rW@s z2ArgumentParser._parse_optional..r4Zmatchesz4ambiguous option: %(option)s could match %(matches)sru) rrrhsplit_get_option_tuplesrr|r;rr.r) r rjrnrr[Z option_tuplesZoptionsrVrrZr%r%r&rh!s<         zArgumentParser._parse_optionalc Csg}|j}|d|kr|d|krd|krV|jdd\}}n |}d}x<|jD]A}|j|rl|j|}|||f}|j|qlqlWn|d|kr|d|kr|}d}|dd}|dd} x|jD]y}||krH|j|}||| f}|j|q |j|r |j|}|||f}|j|q q Wn|jtd||S)NrrNrqr2zunexpected option string: %s)rrrr startswithrr;r|) r rrr&Z option_prefixr[rnrZshort_option_prefixZshort_explicit_argr%r%r&rs[s8        z!ArgumentParser._get_option_tuplescCs|j}|dkrd}n|tkr3d}nk|tkrHd}nV|tkr]d}nA|tkrrd}n,|tkrd}nddjd |}|jr|jdd }|jd d }n|S) Nz(-*A-*)z(-*A?-*)z (-*[A-]*)z (-*A[A-]*)z([-AO]*)z (-*A[-AO]*)z(-*%s-*)z-*rQrXr) rr rr rrrr~r6)r rnrrpr%r%r&ros$              z!ArgumentParser._get_nargs_patternc sjttgkr>y|jdWq>tk r:Yq>Xn| rjtkrjrij}n j}t |t rj |}j |qnV| rjt krj rjdk rj}n|}j |nt|dkrRjdtgkrR|\}j |}j |njtkrfdd|D}njtkrfdd|D}j |dn=fdd|D}x|D]}j |qW|S)Nz--rNcs"g|]}j|qSr%)ri)rTv)rnr r%r&rWs z.ArgumentParser._get_values..cs"g|]}j|qSr%)ri)rTru)rnr r%r&rWs rcs"g|]}j|qSr%)ri)rTru)rnr r%r&rWs )rrrr/r:r r~rrrrri _check_valuerrh)r rnr!r$rjrur%)rnr r&rSs>      '  zArgumentParser._get_valuesc Cs|jd|j|j}t|sItd}t|||ny||}Wntk rt|jdt|j}tt j d}t||Ynit t fk rt|jdt|j}i|d6|d6}td}t|||YnX|S)Nrz%r is not callablerrNr$z!invalid %(type)s value: %(value)r) rrr#r|rrr.rrrrOr$r:)r rnrjr'rrr#rVr%r%r&ris     zArgumentParser._get_valuecCsm|jdk ri||jkrii|d6djtt|jd6}td}t|||ndS)Nr$z, rz3invalid choice: %(value)r (choose from %(choices)s))rrmaprr|r)r rnr$rVrr%r%r&rv s   zArgumentParser._check_valuecCs2|j}|j|j|j|j|jS)N)rrgrcrrr[)r rQr%r%r& format_usage s  zArgumentParser.format_usagecCs|j}|j|j|j|j|j|jxK|jD]@}|j|j |j|j|j |j |j qBW|j|j |jS)N)rrgrcrrrar rr]r1rqrr^rAr[)r rQZ action_groupr%r%r&r[ s  zArgumentParser.format_helpcCs|jd|jS)NrK)rBrK)r r%r%r&r) szArgumentParser._get_formattercCs2|dkrtj}n|j|j|dS)N)rrrrx)r filer%r%r& print_usage/ s  zArgumentParser.print_usagecCs2|dkrtj}n|j|j|dS)N)rrrr[)r ryr%r%r&r4 s  zArgumentParser.print_helpcCs2|r.|dkrtj}n|j|ndS)N)rstderrwrite)r rryr%r%r&r9 s  zArgumentParser._print_messagercCs-|r|j|tjntj|dS)N)rrr{r)r Zstatusrr%r%r&rB szArgumentParser.exitcCsE|jtji|jd6|d6}|jdtd|dS)zerror(message: string) Prints a usage message incorporating the message to stderr and exits. If you override this in a subclass, it should not return -- it should either exit or raise an exception. rKrr2z%(prog)s: error: %(message)s N)rzrr{rKrr|)r rrVr%r%r&r;G s zArgumentParser.error) rr+r,r-rrMrrJr%rKrIrLrrMrfrmrXrcrhrsrorSrirvrxr[rrzrrrr;r%r%)rr&r.sL 3     #     : , , 4     )6r- __version____all__ collectionsrrrosr7rerGsysrtextwraprrr|rrr rr rrrrrr1rrrrr r Exceptionrrr rrrrrrrrrrrr rr(r*rr%r%r%r&>sz            [#%`64"