403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /usr/lib64/python3.9/site-packages/mercurial/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /usr/lib64/python3.9/site-packages/mercurial/__pycache__/fancyopts.cpython-39.opt-1.pyc
a

�+�b7-�@s�ddlmZddlZddlZddlmZddlmZmZhd�Z	dd�Z
dd
d�ZGdd
�d
e�Z
Gdd�de
�ZGdd�de
�ZGdd�de
�ZGdd�de
�Zdd�Zddd�ZdS)�)�absolute_importN�)�_)�error�pycompat>sversionsnoninteractiveshelpcCs�|�d�r`|�d�\}}}|dd�|vr:|t|�|dfS|dd�d|vr�|t|�|dfSnl|�d�r�|dkr�|�d�s�|dd�|dd�}}|�|d	d��}|d
kr�|t|�||�d|d	�fSdS)
a�Check if the given arg is a valid unabbreviated option

    Returns (flag_str, has_embedded_value?, embedded_value, takes_value?)

    >>> def opt(arg):
    ...     return _earlyoptarg(arg, b'R:q', [b'cwd=', b'debugger'])

    long form:

    >>> opt(b'--cwd')
    ('--cwd', False, '', True)
    >>> opt(b'--cwd=')
    ('--cwd', True, '', True)
    >>> opt(b'--cwd=foo')
    ('--cwd', True, 'foo', True)
    >>> opt(b'--debugger')
    ('--debugger', False, '', False)
    >>> opt(b'--debugger=')  # invalid but parsable
    ('--debugger', True, '', False)

    short form:

    >>> opt(b'-R')
    ('-R', False, '', True)
    >>> opt(b'-Rfoo')
    ('-R', True, 'foo', True)
    >>> opt(b'-q')
    ('-q', False, '', False)
    >>> opt(b'-qfoo')  # invalid but parsable
    ('-q', True, 'foo', False)

    unknown or invalid:

    >>> opt(b'--unknown')
    ('', False, '', False)
    >>> opt(b'-u')
    ('', False, '', False)
    >>> opt(b'-ufoo')
    ('', False, '', False)
    >>> opt(b'--')
    ('', False, '', False)
    >>> opt(b'-')
    ('', False, '', False)
    >>> opt(b'-:')
    ('', False, '', False)
    >>> opt(b'-:foo')
    ('', False, '', False)
    �--�=�NFT�-s-:rr�:)�FrF)�
startswith�	partition�bool�find)�arg�	shortlist�namelist�flag�eq�val�i�r�9/usr/lib64/python3.9/site-packages/mercurial/fancyopts.py�_earlyoptargs1
rFc
Cs�g}g}d}|t|�kr�||}|dkr4||7}q�t|||�\}	}
}}|
sb|rb|dt|�krbq�|	rn|
r�|s�|r�|�|�|d7}q�q�q|
|kr�|�|	|f�|d7}q|�|	||df�|d7}q|�||d��||fS)as
Parse options like getopt, but ignores unknown options and abbreviated
    forms

    If gnu=False, this stops processing options as soon as a non/unknown-option
    argument is encountered. Otherwise, option and non-option arguments may be
    intermixed, and unknown-option arguments are taken as non-option.

    If keepsep=True, '--' won't be removed from the list of arguments left.
    This is useful for stripping early options from a full command arguments.

    >>> def get(args, gnu=False, keepsep=False):
    ...     return earlygetopt(args, b'R:q', [b'cwd=', b'debugger'],
    ...                        gnu=gnu, keepsep=keepsep)

    default parsing rules for early options:

    >>> get([b'x', b'--cwd', b'foo', b'-Rbar', b'-q', b'y'], gnu=True)
    ([('--cwd', 'foo'), ('-R', 'bar'), ('-q', '')], ['x', 'y'])
    >>> get([b'x', b'--cwd=foo', b'y', b'-R', b'bar', b'--debugger'], gnu=True)
    ([('--cwd', 'foo'), ('-R', 'bar'), ('--debugger', '')], ['x', 'y'])
    >>> get([b'--unknown', b'--cwd=foo', b'--', '--debugger'], gnu=True)
    ([('--cwd', 'foo')], ['--unknown', '--debugger'])

    restricted parsing rules (early options must come first):

    >>> get([b'--cwd', b'foo', b'-Rbar', b'x', b'-q', b'y'], gnu=False)
    ([('--cwd', 'foo'), ('-R', 'bar')], ['x', '-q', 'y'])
    >>> get([b'--cwd=foo', b'x', b'y', b'-R', b'bar', b'--debugger'], gnu=False)
    ([('--cwd', 'foo')], ['x', 'y', '-R', 'bar', '--debugger'])
    >>> get([b'--unknown', b'--cwd=foo', b'--', '--debugger'], gnu=False)
    ([], ['--unknown', '--cwd=foo', '--', '--debugger'])

    stripping early options (without loosing '--'):

    >>> get([b'x', b'-Rbar', b'--', '--debugger'], gnu=True, keepsep=True)[1]
    ['x', '--', '--debugger']

    last argument:

    >>> get([b'--cwd'])
    ([], ['--cwd'])
    >>> get([b'--cwd=foo'])
    ([('--cwd', 'foo')], [])
    >>> get([b'-R'])
    ([], ['-R'])
    >>> get([b'-Rbar'])
    ([('-R', 'bar')], [])
    >>> get([b'-q'])
    ([('-q', '')], [])
    >>> get([b'-q', b'--'])
    ([('-q', '')], [])

    '--' may be a value:

    >>> get([b'-R', b'--', b'x'])
    ([('-R', '--')], ['x'])
    >>> get([b'--cwd', b'--', b'x'])
    ([('--cwd', '--')], ['x'])

    value passed to bool options:

    >>> get([b'--debugger=foo', b'x'])
    ([], ['--debugger=foo', 'x'])
    >>> get([b'-qfoo', b'x'])
    ([], ['-qfoo', 'x'])

    short option isn't separated with '=':

    >>> get([b'-R=bar'])
    ([('-R', '=bar')], [])

    ':' may be in shortlist, but shouldn't be taken as an option letter:

    >>> get([b'-:', b'y'])
    ([], ['-:', 'y'])

    '-' is a valid non-option argument:

    >>> get([b'-', b'y'])
    ([], ['-', 'y'])
    rrrr	N)�lenr�append�extend)
�argsrr�gnuZkeepsepZ
parsedoptsZ
parsedargs�posrrZhasvalrZtakevalrrr�earlygetopt^s.R




r!c@s<eZdZdZejZdd�Zdd�Zdd�Z	ej
dd	��Zd
S)�	customoptz2Manage defaults and mutations for any type of opt.cCs
||_dS�N��
_defaultvalue)�selfZdefaultvaluerrr�__init__�szcustomopt.__init__cCsdS)NFr�r&rrr�
_isboolopt�szcustomopt._isbooloptcCs|jS)z�Returns the default value for this opt.

        Subclasses should override this to return a new value if the value type
        is mutable.r$r(rrr�getdefaultvalue�szcustomopt.getdefaultvaluecCsdS)zzAdds newparam to oldstate and returns the new state.

        On failure, abort can be called with a string error message.Nr�r&ZoldstateZnewparam�abortrrr�newstate�szcustomopt.newstateN)�__name__�
__module__�__qualname__�__doc__�abc�ABCMetaZ
__metaclass__r'r)r*�abstractmethodr-rrrrr"�sr"c@seZdZdd�Zdd�ZdS)�
_simpleoptcCst|jttd�f�Sr#)�
isinstancer%r�typer(rrrr)�sz_simpleopt._isbooloptcCs|Sr#rr+rrrr-�sz_simpleopt.newstateN)r.r/r0r)r-rrrrr5�sr5cs$eZdZ�fdd�Zdd�Z�ZS)�_callableoptcs||_tt|��d�dSr#)�
callablefn�superr8r')r&r9��	__class__rrr'�sz_callableopt.__init__cCs
|�|�Sr#)r9r+rrrr-�sz_callableopt.newstate)r.r/r0r'r-�
__classcell__rrr;rr8�sr8c@seZdZdd�Zdd�ZdS)�_listoptcCs|jdd�Sr#r$r(rrrr*�sz_listopt.getdefaultvaluecCs|�|�|Sr#)rr+rrrr-�s
z_listopt.newstateN)r.r/r0r*r-rrrrr>�sr>c@seZdZdd�ZdS)�_intoptcCs.z
t|�WSty(|td��Yn0dS)Nsexpected int)�int�
ValueErrorrr+rrrr-s
z_intopt.newstateN)r.r/r0r-rrrrr?sr?cCs\t|t�r|St|�rt|�St|t�r8t|dd��St|�td�urPt|�St|�SdS)z<Returns a default opt implementation, given a default value.Nr)	r6r"�callabler8�listr>r7r?r5)�defaultrrr�_defaultopts

rEcs|duri}g}d}i}i}	i}
dd�|D�}|D�]*}t|�dkrT|\}
}}}}n|\}
}}}|g}|�|�|g��|�dd�}||d|
<|D]}||d|<q�t|�|	|<|	|��||<|	|��s�|
r�|
d	7}
d
d�|D�}nX|tv�rB|D]H}|�d��r|d
d�}nd|}||vr�d||
d|<|�	|�q�|
�rP||
7}|r2|�|�q2|�rvt
jt|d�}n|�r�t
j}nt
j}||||�\}}|D]t\��d}|
��d�}|�r�|�d}|�}|	|}|���r�|||<n(��fdd�}|	|�||�|�||<�q�|S)ar
    read args, parse options, and store options in state

    each option is a tuple of:

      short option or ''
      long option
      default value
      description
      option value label(optional)

    option types include:

      boolean or none - option sets variable in state to true
      string - parameter string is stored in state
      list - parameter string is added to a list
      integer - parameter strings is stored as int
      function - call function with parameter
      customopt - subclass of 'customopt'

    optaliases is a mapping from a canonical option name to a list of
    additional long options. This exists for preserving backward compatibility
    of early options. If we want to use it extensively, please consider moving
    the functionality to the options table (e.g separate long options by '|'.)

    non-option args are returned
    NrcSsh|]}|d�qS)rr)�.0�orrr�	<setcomp>=rzfancyopts.<locals>.<setcomp>�r
�_rrcSsg|]}|d�qS)rr)rF�nrrr�
<listcomp>Urzfancyopts.<locals>.<listcomp>sno-�)rTFcs"t�td�t����|f��dS)Ns"invalid value %r for option %s, %s)rZ
InputErrorrrZmaybebytestr)�s��optrrrr,~s
��zfancyopts.<locals>.abort)rr�get�replacerEr*r)�nevernegater
r�	functools�partialr!rZ
gnugetoptbZgetoptbr-)r�options�staterZearlyZ
optaliasesrrZargmapZdefmapZ	negationsZalllong�optionZshort�namerDZcommentZdummyZonamesrK�insert�parseZoptsZboolvalZnegation�objr,rrOr�	fancyoptssn



r])FF)FFN)Z
__future__rr2rTZi18nr�rrrSrr!�objectr"r5r8r>r?rEr]rrrr�<module>s?
r		

Youez - 2016 - github.com/yon3zu
LinuXploit