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KO}ӽmSşذqsOy?\[,d@'73'j%kOe`1.g2"e =YIzS2|zŐƄa\U,dP;jhhhaxǶ?КZ՚.q SE+XrbOu%\GتX(H,N^~]JyEZQKceTQ]VGYqnah;y$cQahT&QPZ*iZ8UQQM.qo/T\7X"u?Mttl2Xq(IoW{R^ ux*SYJ! 4S.Jy~ BROS[V|žKNɛP(L6V^|cR7i7nZW1Fd@ Ara{詑|(T*dN]Ko?s=@ |_EvF]׍kR)eBJc" MUUbY6`~V޴dJKß&~'d3i WWWWWW
Current Directory: /usr/lib64/python3.6/__pycache__
Viewing File: /usr/lib64/python3.6/__pycache__/optparse.cpython-36.opt-1.pyc
3 \���@s�dZdZdddddddd d d d d dddddgZdZddlZddlZddlZdd�ZyddlmZm Z Wn$e k r�dd�Zdd�Z YnXeZ Gdd �d e �Z Gdd�de �ZGdd�de�ZGd d�de �ZGd!d�de �ZGd"d#�d#e�ZGd$d �d �ZGd%d �d e�ZGd&d �d e�Zd'd(�Zd)d*�Zee d+�fee d+�fee d,�fee d-�fd.�Zd/d0�Zd1d�Zd>ZGd4d�d�Zd?Zd@Z Gd8d�d�Z!Gd9d�d�Z"Gd:d�de"�Z#Gd;d �d e"�Z$d<d=�Z%eZ&dS)Aa�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. �NcCsd|jjt|�|fS)Nz<%s at 0x%x: %s>)� __class__�__name__�id)�self�r� /usr/lib64/python3.6/optparse.py�_reprOsr)�gettext�ngettextcCs|S)Nr)�messagerrrr\srcCs|dkr |S|S)N�r)ZsingularZplural�nrrrr_src@seZdZdd�Zdd�ZdS)r cCs ||_dS)N)�msg)rrrrr�__init__hszOptParseError.__init__cCs|jS)N)r)rrrr�__str__kszOptParseError.__str__N)r� __module__� __qualname__r r!rrrrr gsc@s eZdZdZdd�Zdd�ZdS)r z] Raised if an Option instance is created with invalid or inconsistent arguments. cCs||_t|�|_dS)N)r�str� option_id)rr�optionrrrr uszOptionError.__init__cCs |jrd|j|jfS|jSdS)Nz option %s: %s)r%r)rrrrr!yszOptionError.__str__N)rr"r#�__doc__r r!rrrrr osc@seZdZdZdS)rzE Raised if conflicting options are added to an OptionParser. N)rr"r#r'rrrrrsc@seZdZdZdS)rzS Raised if an invalid option value is encountered on the command line. N)rr"r#r'rrrrr�sc@s eZdZdZdd�Zdd�ZdS)rzB Raised if an invalid option is seen on the command line. cCs ||_dS)N)�opt_str)rr(rrrr �szBadOptionError.__init__cCstd�|jS)Nzno such option: %s)�_r()rrrrr!�szBadOptionError.__str__N)rr"r#r'r r!rrrrr�sc@s eZdZdZdd�Zdd�ZdS)�AmbiguousOptionErrorzD Raised if an ambiguous option is seen on the command line. cCstj||�||_dS)N)rr � possibilities)rr(r+rrrr �s zAmbiguousOptionError.__init__cCstd�|jdj|j�fS)Nzambiguous option: %s (%s?)z, )r)r(�joinr+)rrrrr!�szAmbiguousOptionError.__str__N)rr"r#r'r r!rrrrr*�sr*c@s�eZdZdZdZdd�Zdd�Zdd�Zd d �Zd d �Z d d�Z dd�Z dd�Z dd�Z dd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!S)"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"). ZnonecCs�d|_||_|dkrLyttjd�}Wnttfk rBd}YnX|d8}||_t|t |d|d��|_ |_ d|_ d|_ d|_||_d|_i|_d|_d|_dS) NZCOLUMNS�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)rr1r;r7r?rrrr �s$  zHelpFormatter.__init__cCs ||_dS)N)r0)rr0rrr� set_parser�szHelpFormatter.set_parsercCs&|dkrtd|��d|d|_dS)N�� z/invalid metavar delimiter for short options: %rz%s)rErF)r6rB)r�delimrrr�set_short_opt_delimiter�s z%HelpFormatter.set_short_opt_delimitercCs&|dkrtd|��d|d|_dS)N�=rFz.invalid metavar delimiter for long options: %rz%s)rIrF)r6rC)rrGrrr�set_long_opt_delimiter�s z$HelpFormatter.set_long_opt_delimitercCs"|j|j7_|jd7_dS)Nr)r<r1r=)rrrr�indent�szHelpFormatter.indentcCs"|j|j8_|jd8_dS)Nr)r<r1r=)rrrr�dedent�szHelpFormatter.dedentcCs td��dS)Nzsubclasses must implement)�NotImplementedError)r�usagerrr� format_usage�szHelpFormatter.format_usagecCs td��dS)Nzsubclasses must implement)rM)r�headingrrr�format_headingszHelpFormatter.format_headingcCs.t|j|jd�}d|j}tj||||d�S)z� Format a paragraph of free-form text for inclusion in the help output at the current indentation level. � rF)Zinitial_indentZsubsequent_indent)r9r7r<�textwrapZfill)r�textZ text_widthrKrrr� _format_texts  zHelpFormatter._format_textcCs|r|j|�dSdSdS)N� rE)rU)r� descriptionrrr�format_descriptionsz HelpFormatter.format_descriptioncCs|rd|j|�dSdSdS)NrVrE)rU)r�epilogrrr� format_epilogszHelpFormatter.format_epilogcCsR|jdks|j r|jS|jjj|j�}|tks8|dkr>|j}|jj|jt |��S)N) r0r@�help�defaults�get�dest� NO_DEFAULT�NO_DEFAULT_VALUE�replacer$)rr&Z default_valuerrr�expand_defaults zHelpFormatter.expand_defaultcs�g}�j|}�j�jd}t|�|krBd�jd|f}�j}nd�jd||f}d}|j|�|jr��j|�}tj|�j �}|jd|d|df�|j �fdd�|dd�D��n|d d kr�|jd �dj |�S) Nr.z%*s%s rEz %*s%-*s rcsg|]}d�jd|f�qS)z%*s%s rE)r:)�.0�line)rrr� <listcomp>Esz/HelpFormatter.format_option.<locals>.<listcomp>rrV���) rAr:r<�len�appendr[rbrSZwrapr>�extendr,)rr&�result�optsZ opt_widthZ indent_firstZ help_textZ help_linesr)rr� format_option(s$      zHelpFormatter.format_optioncCs�|j�d}x6|jD],}|j|�}||j|<t|t|�|j�}qW|j�xF|jD]<}x6|jD],}|j|�}||j|<t|t|�|j�}q`WqTW|j�|j�t |d|j �|_ t|j |j d�|_ dS)Nrr.rR)rK� option_list�format_option_stringsrAr9rgr<� option_groupsrLr8r;r:r7r>)rr0Zmax_len�optZstrings�grouprrr�store_option_stringsKs        z"HelpFormatter.store_option_stringscst|j�rF|jp|jj����fdd�|jD�}��fdd�|jD�}n |j}|j}�jrb||}n||}dj|�S)z@Return a comma-separated list of option strings & metavariables.csg|]}�j|�f�qSr)rB)rcZsopt)�metavarrrrreasz7HelpFormatter.format_option_strings.<locals>.<listcomp>csg|]}�j|�f�qSr)rC)rcZlopt)rsrrrrecsz, )� takes_valuersr^�upper� _short_opts� _long_optsr?r,)rr&Z short_optsZ long_optsrkr)rsrrrn]s     z#HelpFormatter.format_option_stringsN)rr"r#r'r`r rDrHrJrKrLrOrQrUrXrZrbrlrrrnrrrrr �s")  #c@s*eZdZdZd dd�Zdd �Zd d �ZdS) r z.Format help with indented section bodies. r.�NrcCstj|||||�dS)N)r r )rr1r;r7r?rrrr tszIndentedHelpFormatter.__init__cCs td�|S)Nz Usage: %s )r))rrNrrrrO|sz"IndentedHelpFormatter.format_usagecCsd|jd|fS)Nz%*s%s: rE)r<)rrPrrrrQsz$IndentedHelpFormatter.format_heading)r.rxNr)rr"r#r'r rOrQrrrrr ps c@s*eZdZdZd dd�Zdd�Zd d �ZdS) r z1Format help with underlined section headers. rrxNcCstj|||||�dS)N)r r )rr1r;r7r?rrrr �szTitledHelpFormatter.__init__cCsd|jtd��|fS)Nz%s %s ZUsage)rQr))rrNrrrrO�sz TitledHelpFormatter.format_usagecCsd|d|jt|�fS)Nz%s %s z=-)r=rg)rrPrrrrQ�sz"TitledHelpFormatter.format_heading)rrxNr)rr"r#r'r rOrQrrrrr �s cCsh|dd�j�dkrd}nD|dd�j�dkrDd}|dd�p@d}n|dd�dkrZd}nd}|||�S) Nr.Z0x�Z0b�0r�� )�lower)�val�type�radixrrr� _parse_num�sr�cCs t|t�S)N)r�r2)r~rrr� _parse_int�sr�Zintegerzfloating-point�complex)r2�long�floatr�c CsFt|j\}}y||�Stk r@ttd�|||f��YnXdS)Nzoption %s: invalid %s value: %r)� _builtin_cvtrr6rr))r&rp�valueZcvtZwhatrrr� check_builtin�s r�cCs:||jkr|Sdjtt|j��}ttd�|||f��dS)Nz, z.option %s: invalid choice: %r (choose from %s))�choicesr,�map�reprrr))r&rpr�r�rrrr�s  �NO�DEFAULTc @s�eZdZdZdddddddd d d d d g ZdBZdCZdDZdEZdFZ dGZ e e e e e d�Z dZdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�ZeeeeeeegZd4d5�ZeZd6d7�Zd8d9�Zd:d;�Zd<d=�Z d>d?�Z!d@dA�Z"dS)Hrar 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 �actionrr^�default�nargs�constr��callback� callback_args�callback_kwargsr[rs�store� store_const� store_true� store_falserh� append_const�count�version�stringr2r�r�r��choice)r2r�r�r�r�NcOsFg|_g|_|j|�}|j|�|j|�x|jD] }||�q2WdS)N)rvrw�_check_opt_strings�_set_opt_strings� _set_attrs� CHECK_METHODS)rrk�attrs�checkerrrrr 4s    zOption.__init__cCsdd�|D�}|std��|S)NcSsg|] }|r|�qSrr)rcrprrrreKsz-Option._check_opt_strings.<locals>.<listcomp>z+at least one option string must be supplied)� TypeError)rrkrrrr�GszOption._check_opt_stringscCs�x�|D]�}t|�dkr&td||��qt|�dkrf|ddkoH|ddksXtd||��|jj|�q|dd�dko�|ddks�td||��|jj|�qWdS) Nr.z>invalid option string %r: must be at least two characters longr�-rzMinvalid short option string %r: must be of the form -x, (x any non-dash char)z--zGinvalid long option string %r: must start with --, followed by non-dash)rgr rvrhrw)rrkrprrrr�Ps$    zOption._set_opt_stringscCszxP|jD]F}||kr,t||||�||=q|dkrBt||t�qt||d�qW|rvt|j��}tddj|�|��dS)Nr�zinvalid keyword arguments: %sz, )�ATTRS�setattrr_�sorted�keysr r,)rr��attrrrrr�es   zOption._set_attrscCs2|jdkrd|_n|j|jkr.td|j|��dS)Nr�zinvalid action: %r)r��ACTIONSr )rrrr� _check_actionxs  zOption._check_actioncCs�|jdkr0|j|jkr�|jdk r(d|_q�d|_n^t|jt�rF|jj|_|jdkrVd|_|j|jkrrtd|j|��|j|jkr�td|j|��dS)Nr�r�r$zinvalid option type: %rz$must not supply a type for action %r) rr��ALWAYS_TYPED_ACTIONSr�� isinstancer�TYPESr � TYPED_ACTIONS)rrrr� _check_type~s        zOption._check_typecCsr|jdkrT|jdkr td|��qnt|jttf�sntdtt|j��jd�d|��n|jdk rntd|j|��dS)Nr�z/must supply a list of choices for type 'choice'z1choices must be a list of strings ('%s' supplied)�'rz#must not supply choices for type %r)rr�r r��tuple�listr$�split)rrrr� _check_choice�s     zOption._check_choicecCs\|j|jkp|jdk }|jdkrX|rX|jrH|jddd�jdd�|_n|jdd|_dS)Nrr.r�r)r)r�� STORE_ACTIONSrr^rwrarv)rrtrrr� _check_dest�s   zOption._check_destcCs*|j|jkr&|jdk r&td|j|��dS)Nz*'const' must not be supplied for action %r)r�� CONST_ACTIONSr�r )rrrr� _check_const�szOption._check_constcCs<|j|jkr|jdkr8d|_n|jdk r8td|j|��dS)Nrz*'nargs' must not be supplied for action %r)r�r�r�r )rrrr� _check_nargs�s   zOption._check_nargscCs�|jdkrvt|j�s$td|j|��|jdk rLt|jt� rLtd|j|��|jdk r�t|jt� r�td|j|��nB|jdk r�td|j|��|jdk r�td|��|jdk r�td|��dS)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�r r�r�r�r��dict)rrrr�_check_callback�s0         zOption._check_callbackcCsdj|j|j�S)N�/)r,rvrw)rrrrr!�szOption.__str__cCs |jdk S)N)r)rrrrrt�szOption.takes_valuecCs|jr|jdS|jdSdS)Nr)rwrv)rrrr�get_opt_string�s zOption.get_opt_stringcCs*|jj|j�}|dkr|S||||�SdS)N)� TYPE_CHECKERr]r)rrpr�r�rrr� check_value�szOption.check_valuecs:|dk r6�jdkr�j�|�St��fdd�|D��SdS)Nrcsg|]}�j�|��qSr)r�)rc�v)rprrrresz(Option.convert_value.<locals>.<listcomp>)r�r�r�)rrpr�r)rprr� convert_values  zOption.convert_valuecCs$|j||�}|j|j|j||||�S)N)r�� take_actionr�r^)rrpr��valuesr0rrr�processs zOption.processc Cs:|dkrt|||��n|dkr2t|||j��n|dkrHt||d�n�|dkr^t||d�n�|dkrz|j|g�j|�n�|dkr�|j|g�j|j�n�|d kr�t|||j|d �d �n||d kr�|jp�f}|jp�i}|j||||f|�|�nF|d k�r |j�|j�n*|dk�r(|j �|j�nt d|j ��d S)Nr�r�r�Tr�Frhr�r�rrr�r[r�zunknown action %r) r�r�� ensure_valuerhr�r�r�� print_help�exit� print_versionr6r�) rr�r^rpr�r�r0�args�kwargsrrrr�s4      zOption.take_action) r�r�r�r�rhr�r�r�r[r�)r�r�r�r�rhr�r�)r�rhr�)r�rh)r�r�)r�r2r�r�r�r�)#rr"r#r'r�r�r�r�r�r�r�r�rr�r�r r�r�r�r�r�r�r�r�r�r�r!r�__repr__rtr�r�r�r�r�rrrrr�s�      ZSUPPRESSZHELPZUSAGEc@s^eZdZddd�Zdd�ZeZdd�Zdd �Zd d �Z d d �Z ddd�Z ddd�Z dd�Z dS)rNcCs*|r&x |j�D]\}}t|||�qWdS)N)�itemsr�)rr\r�r~rrrr 9szValues.__init__cCs t|j�S)N)r$�__dict__)rrrrr!>szValues.__str__cCs2t|t�r|j|jkSt|t�r*|j|kStSdS)N)r�rr�r��NotImplemented)r�otherrrr�__eq__Cs     z Values.__eq__cCs:x4t|�D](}||kr ||}|dk r t|||�q WdS)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�Zdvalrrr�_update_carefulKs zValues._update_carefulcCs|jj|�dS)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)r��update)rr�rrr� _update_looseXszValues._update_loosecCs8|dkr|j|�n |dkr(|j|�n td|��dS)N�carefulZloosezinvalid update mode: %r)r�r�r6)rr��moderrr�_update`s   zValues._updater�cCs&t|�tj|}|jt|�|�dS)N)� __import__�sys�modulesr��vars)r�modnamer��modrrr� read_modulehs zValues.read_modulecCs&i}tt|�j�|�|j||�dS)N)�exec�open�readr�)r�filenamer�r�rrr� read_filemszValues.read_filecCs0t||� st||�dkr&t|||�t||�S)N)�hasattr�getattrr�)rr�r�rrrr�rs zValues.ensure_value)N)r�)r�)rr"r#r r!rr�r�r�r�r�r�r�r�rrrrr7s    c@s�eZdZdZdd�Zdd�Zdd�Zdd �Zd d �Zd d �Z dd�Z dd�Z dd�Z dd�Z dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"S)#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. cCs&|j�||_|j|�|j|�dS)N)�_create_option_list� option_class�set_conflict_handler�set_description)rr��conflict_handlerrWrrrr �s zOptionContainer.__init__cCsi|_i|_i|_dS)N)� _short_opt� _long_optr\)rrrr�_create_option_mappings�sz'OptionContainer._create_option_mappingscCs|j|_|j|_|j|_dS)N)r�r�r\)rr0rrr�_share_option_mappings�sz&OptionContainer._share_option_mappingscCs|dkrtd|��||_dS)N�error�resolvez$invalid conflict_resolution value %r)r�r�)r6r�)r�handlerrrrr��s z$OptionContainer.set_conflict_handlercCs ||_dS)N)rW)rrWrrrr��szOptionContainer.set_descriptioncCs|jS)N)rW)rrrr�get_description�szOptionContainer.get_descriptioncCs|`|`|`dS)zsee OptionParser.destroy().N)r�r�r\)rrrr�destroy�szOptionContainer.destroycCs�g}x,|jD]"}||jkr |j||j|f�q Wx,|jD]"}||jkr:|j||j|f�q:W|r�|j}|dkr�tddjdd�|D��|��nh|dkr�x^|D]V\}}|jd�r�|jj |�|j|=n|jj |�|j|=|jp�|js�|j j j |�q�WdS)Nr�z conflicting option string(s): %sz, cSsg|] }|d�qS)rr)rc�corrrre�sz3OptionContainer._check_conflict.<locals>.<listcomp>r�z--) rvr�rhrwr�r�rr,� startswith�remove� containerrm)rr&Z conflict_optsrpr�Zc_optionrrr�_check_conflict�s.         zOptionContainer._check_conflictcOs�t|dt�r|j||�}n:t|�dkrN| rN|d}t|t�sVtd|��ntd��|j|�|jj|�||_ x|j D]}||j |<qzWx|j D]}||j |<q�W|jdk r�|jtk r�|j|j|j<n|j|jkr�d|j|j<|S)zOadd_option(Option) add_option(opt_str, ..., kwarg=val, ...) rrznot an Option instance: %rzinvalid argumentsN)r�r$r�rgrr�r�rmrhr�rvr�rwr�r^r�r_r\)rr�r�r&rprrr� add_option�s(         zOptionContainer.add_optioncCsx|D]}|j|�qWdS)N)r�)rrmr&rrr� add_optionss zOptionContainer.add_optionscCs|jj|�p|jj|�S)N)r�r]r�)rr(rrr� get_options zOptionContainer.get_optioncCs||jkp||jkS)N)r�r�)rr(rrr� has_option s zOptionContainer.has_optioncCsv|jj|�}|dkr |jj|�}|dkr4td|��x|jD] }|j|=q<Wx|jD] }|j|=qTW|jjj|�dS)Nzno such option %r) r�r]r�r6rvrwr�rmr�)rr(r&rprrr� remove_options       zOptionContainer.remove_optioncCsB|js dSg}x(|jD]}|jtk r|j|j|��qWdj|�S)NrE)rmr[rrhrlr,)r� formatterrjr&rrr�format_option_helps  z"OptionContainer.format_option_helpcCs|j|j��S)N)rXr�)rrrrrrX(sz"OptionContainer.format_descriptioncCs:g}|jr|j|j|��|jr0|j|j|��dj|�S)NrV)rWrhrXrmrr,)rrrjrrr� format_help+s zOptionContainer.format_helpN)rr"r#r'r r�r�r�r�r�r�r�r�r�r�r�rrrXrrrrrrxs"    c@s6eZdZd dd�Zdd�Zdd�Zdd �Zd d �ZdS) rNcCs$||_tj||j|j|�||_dS)N)r0rr r�r��title)rr0rrWrrrr 6szOptionGroup.__init__cCsg|_|j|j�dS)N)rmr�r0)rrrrr�<szOptionGroup._create_option_listcCs ||_dS)N)r)rrrrr� set_title@szOptionGroup.set_titlecCstj|�|`dS)zsee OptionParser.destroy().N)rr�rm)rrrrr�Cs zOptionGroup.destroycCs0|j|j�}|j�|tj||�7}|j�|S)N)rQrrKrrrL)rrrjrrrrJs  zOptionGroup.format_help)N)rr"r#r r�rr�rrrrrr4s  c @sbeZdZdZgZddedddddddf dd�Zdd�Zd d �Zd d �Z d d�Z dPdd�Z dd�Z dd�Z dd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�ZdQd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Z dRd<d=�Z!d>d?�Z"d@dA�Z#dSdBdC�Z$dDdE�Z%dTdFdG�Z&dUdHdI�Z'dJdK�Z(dVdLdM�Z)dWdNdO�Z*dS)Xra$ 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 have defined custom types; see SF bug #955889.) Set it to false to restore the behaviour of Optik 1.4.1 and earlier. rargs : [string] the argument list currently being parsed. Only set when parse_args() is active, and continually trimmed down as we consume arguments. Mainly there for the benefit of callback options. largs : [string] the list of leftover arguments that we have skipped while parsing options. If allow_interspersed_args is false, this list is always empty. values : Values the set of option values currently being accumulated. Only set when parse_args() is active. Also mainly for callbacks. Because of the 'rargs', 'largs', and 'values' attributes, OptionParser is not thread-safe. If, for some perverse reason, you need to parse command-line arguments simultaneously in different threads, use different OptionParser instances. Nr�Tc Csrtj||||�|j|�| |_||_d|_d|_|dkr@t�}||_|jj |�| |_ |j ||d�|j �dS)NT)�add_help) rr � set_usage�progr��allow_interspersed_args�process_default_valuesr rrDrY�_populate_option_list�_init_parsing_state) rrNrmr�r�r�rWrZadd_help_optionrrYrrrr �s    zOptionParser.__init__cCs2tj|�x|jD] }|j�qW|`|`|`dS)a Declare that you are done with this OptionParser. This cleans up reference cycles so the OptionParser (and all objects referenced by it) can be garbage-collected promptly. After calling destroy(), the OptionParser is unusable. N)rr�rormr)rrqrrrr��s    zOptionParser.destroycCsg|_g|_|j�dS)N)rmror�)rrrrr��sz OptionParser._create_option_listcCs|jdddtd�d�dS)Nz-hz--helpr[zshow this help message and exit)r�r[)r�r))rrrr�_add_help_option�szOptionParser._add_help_optioncCs|jddtd�d�dS)Nz --versionr�z&show program's version number and exit)r�r[)r�r))rrrr�_add_version_option�sz OptionParser._add_version_optioncCs>|jr|j|j�|r |j|�|jr.|j�|r:|j�dS)N)�standard_option_listr�r�rr )rrmrrrrr �s  z"OptionParser._populate_option_listcCsd|_d|_d|_dS)N)�rargs�largsr�)rrrrr �sz OptionParser._init_parsing_statecCsL|dkrtd�|_n4|tkr$d|_n$|j�jd�rB|dd�|_n||_dS)Nz%prog [options]zusage: �)r)rNrr}r�)rrNrrrr�s zOptionParser.set_usagecCs d|_dS)aSet parsing to not stop on the first non-option, allowing interspersing switches with command arguments. This is the default behavior. See also disable_interspersed_args() and the class documentation description of the attribute allow_interspersed_args.TN)r )rrrr�enable_interspersed_args�sz%OptionParser.enable_interspersed_argscCs d|_dS)z�Set parsing to stop on the first non-option. Use this if you have a command processor which runs another command that has options of its own and you want to make sure these options don't get confused. FN)r )rrrr�disable_interspersed_argssz&OptionParser.disable_interspersed_argscCs ||_dS)N)r )rr�rrr�set_process_default_values sz'OptionParser.set_process_default_valuescCs||j|<dS)N)r\)rr^r�rrr� set_defaultszOptionParser.set_defaultcKs|jj|�dS)N)r\r�)rr�rrr� set_defaultsszOptionParser.set_defaultscCs.|jdd�}x|jD]}|j|j�qW|S)N)rmrori)rZoptionsrqrrr�_get_all_optionss zOptionParser._get_all_optionscCsd|jst|j�S|jj�}x@|j�D]4}|j|j�}t|t�r$|j �}|j ||�||j<q$Wt|�S)N) r rr\�copyrr]r^r�r$r�r�)rr\r&r�r(rrr�get_default_valuess    zOptionParser.get_default_valuescOs|t|dt�r t|f|�|�}nLt|�dkrd| rd|d}t|t�sPtd|��|j|k rltd��ntd��|jj|�|S)Nrrznot an OptionGroup instance: %rz"invalid OptionGroup (wrong parser)zinvalid arguments) r�r$rrgr�r0r6rorh)rr�r�rqrrr�add_option_group+s     zOptionParser.add_option_groupcCs0|jj|�p|jj|�}|r,|j|k r,|jSdS)N)r�r]r�r�)rr(r&rrr�get_option_group;s   zOptionParser.get_option_groupcCs&|dkrtjdd�S|dd�SdS)Nr)r��argv)rr�rrr� _get_argsEszOptionParser._get_argscCs�|j|�}|dkr|j�}||_g|_}||_y|j|||�}Wn4ttfk rv}z|jt |��WYdd}~XnX||}|j ||�S)aR parse_args(args : [string] = sys.argv[1:], values : Values = None) -> (values : Values, args : [string]) Parse the command-line options found in 'args' (default: sys.argv[1:]). Any errors result in a call to 'error()', which by default prints the usage message to stderr and calls sys.exit() with an error message. On success returns a pair (values, args) where 'values' is a Values instance (with all your option values) and 'args' is the list of arguments left over after parsing options. N) rrrrr�� _process_argsrrr�r$� check_values)rr�r�rr�stop�errrrr� parse_argsKs    zOptionParser.parse_argscCs||fS)a� check_values(values : Values, args : [string]) -> (values : Values, args : [string]) Check that the supplied option values and leftover arguments are valid. Returns the option values and leftover arguments (possibly adjusted, possibly completely new -- whatever you like). Default implementation just returns the passed-in values; subclasses may override as desired. r)rr�r�rrrr rs zOptionParser.check_valuescCs�x�|r�|d}|dkr |d=dS|dd�dkr>|j||�q|dd�dkrht|�dkrh|j||�q|jr�|j|�|d=qdSqWdS)a�_process_args(largs : [string], rargs : [string], values : Values) Process command-line arguments and populate 'values', consuming options and arguments from 'rargs'. If 'allow_interspersed_args' is false, stop at the first non-option argument. If true, accumulate any interspersed non-option arguments in 'largs'. rz--Nr.rr�)�_process_long_optrg�_process_short_optsr rh)rrrr��argrrrrs  zOptionParser._process_argscCs t||j�S)a_match_long_opt(opt : string) -> string Determine which long option string 'opt' matches, ie. which one it is an unambiguous abbreviation for. Raises BadOptionError if 'opt' doesn't unambiguously match any long option string. )� _match_abbrevr�)rrprrr�_match_long_opt�szOptionParser._match_long_optc Cs�|jd�}d|kr4|jdd�\}}|jd|�d}n|}d}|j|�}|j|}|j�r�|j}t|�|kr�|jt dd|�||d��q�|dkr�|jd�} q�t |d|��} |d|�=n|r�|jt d �|�nd} |j || ||�dS) NrrIrTFz.%(option)s option requires %(number)d argumentz/%(option)s option requires %(number)d arguments)r&�numberz%s option does not take a value) �popr��insertr(r�rtr�rgr�rr�r)r�) rrr�r&rpZnext_argZhad_explicit_valuer&r�r�rrrr$�s0       zOptionParser._process_long_optc Cs�|jd�}d}d}x�|dd�D]�}d|}|jj|�}|d7}|sLt|��|j�r�|t|�krx|jd||d��d}|j} t|�| kr�|jt dd| �|| d��q�| dkr�|jd�} q�t |d| ��} |d| �=nd} |j || ||�|r Pq WdS) NrFrr�Tz.%(option)s option requires %(number)d argumentz/%(option)s option requires %(number)d arguments)r&r)) r*r�r]rrtrgr+r�r�rr�r�) rrr�r&r!�iZchrpr&r�r�rrrr%�s6      z OptionParser._process_short_optscCs&|jdkrtjjtjd�S|jSdS)Nr)rr3�path�basenamer�r)rrrr� get_prog_names zOptionParser.get_prog_namecCs|jd|j��S)Nz%prog)rar/)r�srrr�expand_prog_nameszOptionParser.expand_prog_namecCs |j|j�S)N)r1rW)rrrrr�szOptionParser.get_descriptionrcCs|rtjj|�tj|�dS)N)r��stderr�writer�)rZstatusrrrrr�s zOptionParser.exitcCs(|jtj�|jdd|j�|f�dS)z�error(msg : string) Print a usage message incorporating 'msg' to stderr and exit. If you override this in a subclass, it should not return -- it should either exit or raise an exception. r.z%s: error: %s N)� print_usager�r2r�r/)rrrrrr�s zOptionParser.errorcCs"|jr|jj|j|j��SdSdS)NrE)rNrrOr1)rrrr� get_usage#szOptionParser.get_usagecCs|jrt|j�|d�dS)aaprint_usage(file : file = stdout) Print the usage message for the current program (self.usage) to 'file' (default stdout). Any occurrence of the string "%prog" in self.usage is replaced with the name of the current program (basename of sys.argv[0]). Does nothing if self.usage is empty or not defined. )�fileN)rN�printr5)rr6rrrr4*s zOptionParser.print_usagecCs|jr|j|j�SdSdS)NrE)r�r1)rrrr� get_version6s zOptionParser.get_versioncCs|jrt|j�|d�dS)aEprint_version(file : file = stdout) Print the version message for this program (self.version) to 'file' (default stdout). As with print_usage(), any occurrence of "%prog" in self.version is replaced by the current program's name. Does nothing if self.version is empty or undefined. )r6N)r�r7r8)rr6rrrr�<szOptionParser.print_versioncCs�|dkr|j}|j|�g}|j|jtd���|j�|jrZ|jtj||��|jd�x(|j D]}|j|j |��|jd�qbW|j �dj |dd��S)NZOptionsrVrErrf) rrrrhrQr)rKrmrrrorrLr,)rrrjrqrrrrGs   zOptionParser.format_option_helpcCs |j|j�S)N)rZrY)rrrrrrZXszOptionParser.format_epilogcCsn|dkr|j}g}|jr*|j|j�d�|jrD|j|j|�d�|j|j|��|j|j|��dj|�S)NrVrE) rrNrhr5rWrXrrZr,)rrrjrrrr[szOptionParser.format_helpcCs |dkrtj}|j|j��dS)z�print_help(file : file = stdout) Print an extended help message, listing all options and any help text provided with them, to 'file' (default stdout). N)r��stdoutr3r)rr6rrrr�gszOptionParser.print_help)T)NN)rN)N)N)N)N)N)+rr"r#r'rrr r�r�r rr r rrrrrrrrrrrr#r rr(r$r%r/r1r�r�r�r5r4r8r�rrZrr�rrrrrRs`D      ' 3 $)     csZ�|kr �S�fdd�|j�D�}t|�dkr6|dS|sDt���n|j�t�|��dS)z�_match_abbrev(s : string, wordmap : {string : Option}) -> string Return the string key in 'wordmap' for which 's' is an unambiguous abbreviation. If 's' is found to be ambiguous or doesn't match any of 'words', raise BadOptionError. csg|]}|j��r|�qSr)r�)rcZword)r0rrre�sz!_match_abbrev.<locals>.<listcomp>rrN)r�rgr�sortr*)r0Zwordmapr+r)r0rr'ts  r')r�r�Z SUPPRESSHELPZ SUPPRESSUSAGE)'r'� __version__�__all__Z __copyright__r�r3rSrrr� ImportErrorr)� Exceptionr r rrrr*r r r r�r�r�r�r�r�rr_rrrrrrrr'rrrrr�<module>s~    P     uA=&